XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    xo-cli --register produces "invalid parameters" errors in xo logs

    Scheduled Pinned Locked Moved Solved Xen Orchestra
    18 Posts 4 Posters 2.5k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      mietek
      last edited by mietek

      I have written a script downloading info about the whole cluster using xo-cli.

      The simple command:

      /usr/bin/xo-cli --register --allowUnauthorized https://<web\_address> <user> <pass>
      

      even though login is successful:

      Successfully logged with <username>
      

      is producing these errors in xo logs:

      token.create
      {
        "description": "xo-cli --register"
      }
      {
        "code": 10,
        "data": {
          "errors": [
            {
              "code": null,
              "reason": "strict",
              "message": "should not contains property [\"description\"]",
              "property": "@"
            }
          ]
        },
        "message": "invalid parameters",
        "name": "XoError",
        "stack": "XoError: invalid parameters
          at Module.invalidParameters (/opt/xen-orchestra/packages/xo-common/src/api-errors.js:21:32)
          at Object.call (file:///opt/xen-orchestra/packages/xo-server/src/xo-mixins/api.mjs:73:18)
          at Api.callApiMethod (file:///opt/xen-orchestra/packages/xo-server/src/xo-mixins/api.mjs:303:19)"
      }
      

      Any tips on what is the issue and how to eliminate it spamming the logs?

      (script has to run periodically)

      DarkbeldinD julien-fJ 2 Replies Last reply Reply Quote 0
      • julien-fJ Offline
        julien-f Vates 🪐 Co-Founder XO Team @mietek
        last edited by julien-f

        @mietek Hello, this is due to incompatibility between xo-cli and xo-server due a change introduced 6 months ago, you can resolve it by updating xo-server.

        Another solution is to update xo-cli as the recent versions contains a work-around for old versions of xo-server.

        M 2 Replies Last reply Reply Quote 0
        • DarkbeldinD Offline
          Darkbeldin Vates 🪐 Pro Support Team @mietek
          last edited by

          @mietek pinging @julien-f for him to take a look

          1 Reply Last reply Reply Quote 0
          • julien-fJ Offline
            julien-f Vates 🪐 Co-Founder XO Team @mietek
            last edited by julien-f

            @mietek Hello, this is due to incompatibility between xo-cli and xo-server due a change introduced 6 months ago, you can resolve it by updating xo-server.

            Another solution is to update xo-cli as the recent versions contains a work-around for old versions of xo-server.

            M 2 Replies Last reply Reply Quote 0
            • julien-fJ julien-f marked this topic as a question on
            • julien-fJ julien-f has marked this topic as solved on
            • M Offline
              mietek @julien-f
              last edited by

              @julien-f Hey, thanks for the info. Let me update the client and get back to you.

              M 1 Reply Last reply Reply Quote 0
              • M Offline
                mietek @mietek
                last edited by olivierlambert

                @julien-f
                upgrade or reinstall of xo-cli crashes now with an error:

                internal/process/esm_loader.js:74
                    internalBinding('errors').triggerUncaughtException(
                                              ^
                
                Error [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:assert/strict
                    at new NodeError (internal/errors.js:322:7)
                    at Function.Module._load (internal/modules/cjs/loader.js:781:13)
                    at Module.require (internal/modules/cjs/loader.js:1003:19)
                    at require (internal/modules/cjs/helpers.js:107:18)
                    at Object.<anonymous> (/usr/lib/node_modules/xo-cli/node_modules/http-request-plus/index.js:5:16)
                    at Module._compile (internal/modules/cjs/loader.js:1114:14)
                    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
                    at Module.load (internal/modules/cjs/loader.js:979:32)
                    at Function.Module._load (internal/modules/cjs/loader.js:819:12)
                    at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:203:29) {
                  code: 'ERR_UNKNOWN_BUILTIN_MODULE'
                

                I am not really a Java guy. What am I missing here?

                julien-fJ 1 Reply Last reply Reply Quote 0
                • julien-fJ Offline
                  julien-f Vates 🪐 Co-Founder XO Team @mietek
                  last edited by

                  @mietek Does xo-cli crash? Or npm during the install?

                  M 1 Reply Last reply Reply Quote 0
                  • M Offline
                    mietek @julien-f
                    last edited by

                    @julien-f xo-cli installation runs fine. Trying to run it fails.
                    I have rolled it back to 0.14.0 and it works fine.

                    julien-fJ 1 Reply Last reply Reply Quote 0
                    • julien-fJ Offline
                      julien-f Vates 🪐 Co-Founder XO Team @mietek
                      last edited by

                      @mietek Ok, which version of Node are you using?

                      M 1 Reply Last reply Reply Quote 0
                      • M Offline
                        mietek @julien-f
                        last edited by

                        @julien-f v14.21.3

                        julien-fJ 1 Reply Last reply Reply Quote 0
                        • julien-fJ Offline
                          julien-f Vates 🪐 Co-Founder XO Team @mietek
                          last edited by

                          @mietek Please use latest Node LTS as explained in the documentation.

                          M 1 Reply Last reply Reply Quote 0
                          • M Offline
                            mietek @julien-f
                            last edited by olivierlambert

                            @julien-f I have installed node LTS ver and the new xo-cli works fine:

                            nodejs:
                            ->     v16.20.0   (Latest LTS: Gallium)
                            xo-cli:
                            └── xo-cli@0.17.1
                            

                            Thanks for help.

                            1 Reply Last reply Reply Quote 1
                            • olivierlambertO Offline
                              olivierlambert Vates 🪐 Co-Founder CEO
                              last edited by olivierlambert

                              That's why it's important to read the doc, because it means less interruption and more time for @julien-f to actually work on improving XO šŸ˜‰

                              1 Reply Last reply Reply Quote 0
                              • M Offline
                                mietek @julien-f
                                last edited by

                                Hey @julien-f, I have to get back to the issue as I had to move witn node and xo-cli to other machine and even though I have node: v16.20.0 and xo-cli: v0.17.1
                                I see those errors again.
                                Is there any way to have it fixed without upgrading xo-server? [ver: 5.87.0]

                                julien-fJ 1 Reply Last reply Reply Quote 0
                                • julien-fJ Offline
                                  julien-f Vates 🪐 Co-Founder XO Team @mietek
                                  last edited by

                                  @mietek The No such built-in module: node:assert/strict cannot occur with Node 16.20.0.

                                  What exact issues do you have?

                                  M 1 Reply Last reply Reply Quote 0
                                  • olivierlambertO Offline
                                    olivierlambert Vates 🪐 Co-Founder CEO
                                    last edited by

                                    If you are using xo-server 5.87.0 you are indeed very very outdated. Remember to keep everything up to date on master branch as possible.

                                    1 Reply Last reply Reply Quote 0
                                    • M Offline
                                      mietek @julien-f
                                      last edited by

                                      @julien-f Hey, I am back to the original issue now:
                                      "message": "should not contains property ["description"]

                                      If there is anything I can do to not have it in logs then great, but if not
                                      @olivierlambert might be right that it's time to finally upgrade the server version.

                                      julien-fJ 1 Reply Last reply Reply Quote 0
                                      • julien-fJ Offline
                                        julien-f Vates 🪐 Co-Founder XO Team @mietek
                                        last edited by

                                        @mietek I cannot reproduce the problem with xo-cli@0.17.1, either with xo-server@5.87.0 nor with xo-server@5.111.1.

                                        Anyway, old versions are not supported, please upgrade.

                                        If you have a paying subscription and a special need, please open a support ticket.

                                        M 1 Reply Last reply Reply Quote 0
                                        • M Offline
                                          mietek @julien-f
                                          last edited by

                                          @julien-f OK, server upgrade it is.
                                          Thanks for a prompt reply. Appreciate it.

                                          1 Reply Last reply Reply Quote 0

                                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                          With your input, this post could be even better šŸ’—

                                          Register Login
                                          • First post
                                            Last post