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

    action rolling_update fails with strange error

    Scheduled Pinned Locked Moved Solved REST API
    6 Posts 3 Posters 316 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.
    • V Offline
      vmpr
      last edited by

      hi everyone,

      I am on the last version of XO and wanted to play around with the REST-AP. scheduling a rolling pool update but I got an error I can't figure out:

      curl -X POST -b authenticationToken=XXX https://xo.xxx/rest/v0/pools/5222b44b-e25b-a14d-4da2-c7a0dd8cf59f/actions/rolling_update
      /rest/v0/tasks/0m1agafzh
      

      the log says:

      curl -b authenticationToken=XXX https://xo.xxx/rest/v0/tasks/0m1agafzh
      {
        "id": "0m1agafzh",
        "properties": {
          "name": "REST: rolling_update pool",
          "objectId": "5222b44b-e25b-a14d-4da2-c7a0dd8cf59f"
        },
        "start": 1726820415341,
        "status": "failure",
        "updatedAt": 1726820415449,
        "end": 1726820415449,
        "result": {
          "message": "Cannot read properties of undefined (reading 'user')",
          "name": "TypeError",
          "stack": "TypeError: Cannot read properties of undefined (reading 'user')\n    at file:///opt/xo/xo-builds/xen-orchestra-202409201003/packages/xo-server/src/xo-mixins/xen-servers.mjs:704:82\n    at AsyncLocalStorage.run (node:async_hooks:346:14)\n    at Task.runInside (/opt/xo/xo-builds/xen-orchestra-202409201003/@vates/task/index.js:169:41)\n    at Task.run (/opt/xo/xo-builds/xen-orchestra-202409201003/@vates/task/index.js:153:31)\n    at XenServers.rollingPoolUpdate (file:///opt/xo/xo-builds/xen-orchestra-202409201003/packages/xo-server/src/xo-mixins/xen-servers.mjs:703:16)\n    at rolling_update (file:///opt/xo/xo-builds/xen-orchestra-202409201003/packages/xo-server/src/xo-mixins/rest-api.mjs:634:11)\n    at Task.runInside (/opt/xo/xo-builds/xen-orchestra-202409201003/@vates/task/index.js:169:22)\n    at Task.run (/opt/xo/xo-builds/xen-orchestra-202409201003/@vates/task/index.js:153:20)"
        }
      }
      

      Do you have any idea what the problem is here?

      If I start the update via XO everything works without errors.

      thanks and have a great day!
      cheers Ringo

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

        Hi!

        Thanks for the feedback, sounds like a typo. Pinging @julien-f

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

          @vmpr Thanks for your report, it's indeed a bug. I will try to fix it soon!

          V 1 Reply Last reply Reply Quote 1
          • V Offline
            vmpr @julien-f
            last edited by

            @julien-f happy to help 🙂 let me know when you fixed it and I will test it. cheers Ringo

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

              @vmpr It should be fixed, let me know if you have any issues 🙂

              https://github.com/vatesfr/xen-orchestra/commit/eb39e149723b2fb0e19c22931348485bead654ab

              0 julien-f committed to vatesfr/xen-orchestra
              fix(xo-server/rest-api): set apiContext
              
              This makes the REST API more closely resemblethe JSON-RPC API and addresses
              several issues such as the broken _Rolling Pool Update_ pool action.
              
              Fixes https://xcp-ng.org/forum/post/82867
              V 1 Reply Last reply Reply Quote 1
              • V Offline
                vmpr @julien-f
                last edited by

                @julien-f thanks! I have tested it and its working now! cheers Ringo

                1 Reply Last reply Reply Quote 0
                • V vmpr marked this topic as a question on
                • V vmpr has marked this topic as solved on
                • First post
                  Last post