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

    XO5 breaks after defaulting to XO6 (from source)

    Scheduled Pinned Locked Moved Xen Orchestra
    27 Posts 6 Posters 266 Views 6 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.
    • P Offline
      ph7 @ph7
      last edited by ph7

      I'm not running https and still on node v22

      GheppyG 1 Reply Last reply Reply Quote 0
      • GheppyG Online
        Gheppy @ph7
        last edited by Gheppy

        @ph7
        On http it works, but without the lines below (those with /v5) in the config. On https it is the problem and it shouldn't be.

        ...
        # List of files/directories which will be served.
        [http.mounts]
        '/v6' = '../../@xen-orchestra/web/dist/'
        '/' = '../xo-web/dist/'
        
        # List of proxied URLs (HTTP & WebSockets).
        [http.proxies]
        #'/v5/api' = 'ws://localhost:9000/api'
        #'/v5/api/updater' = 'ws://localhost:9001'
        #'/v5/rest' = 'http://localhost:9000/rest'
        ...
        
        GheppyG 1 Reply Last reply Reply Quote 0
        • GheppyG Online
          Gheppy @Gheppy
          last edited by

          I managed to get it working, although the solution is not exactly to my liking.
          I enabled both 80 and 443

          [http]
          
          [[http.listen]]
          port = 80
          
          [[http.listen]]
          port = 443
          cert = '/opt/ssl-local/fullchain.pem'
          key = '/opt/ssl-local/privkey.pem'
          
          # CRITICAL WEBSOCKET CONFIGURATION
          [http.upgrade]
          '/v5/api' = true
          '/v5/api/updater' = true
          
          # Make sure these routes are allowed for WebSocket upgrade
          [http.routes]
          '/v5/api' = { upgrade = true }
          '/v5/api/updater' = { upgrade = true }
          
          # List of files/directories which will be served.
          [http.mounts]
          '/v6' = '../../@xen-orchestra/web/dist/'
          '/' = '../xo-web/dist/'
          
          [redis]
          
          [remoteOptions]
          
          [plugins]
          
          
          MathieuRAM 2 Replies Last reply Reply Quote 0
          • MathieuRAM Online
            MathieuRA Vates 🪐 XO Team @Gheppy
            last edited by

            @Gheppy If I understand correctly, when you click the XO5 link from XO6, you are redirected to <url>/v5?

            If so, this appears to be a bug, because according to your configuration file, your XO5 instance is located at the root (/).

            can you fetch this endpoint please? /rest/v0/gui-routes

            1 Reply Last reply Reply Quote 0
            • MathieuRAM Online
              MathieuRA Vates 🪐 XO Team
              last edited by

              I've identified various issues with proxied URLs. I'm on it

              1 Reply Last reply Reply Quote 0
              • MathieuRAM Online
                MathieuRA Vates 🪐 XO Team @Gheppy
                last edited by

                @probain @Gheppy Can you please try this branch mra-fix-proxies?

                D GheppyG 2 Replies Last reply Reply Quote 0
                • D Offline
                  dpanegassi @MathieuRA
                  last edited by

                  @MathieuRA I was with the same problem, the branch mra-fix-proxies fixed it for me, now i can acess the V5 correctly

                  1 Reply Last reply Reply Quote 1
                  • GheppyG Online
                    Gheppy @MathieuRA
                    last edited by

                    @MathieuRA
                    I also confirm that it works. Thank you

                    1 Reply Last reply Reply Quote 1
                    • A Offline
                      acebmxer
                      last edited by acebmxer

                      @MathieuRA said in XO5 breaks after defaulting to XO6 (from source):

                      mra-fix-proxies

                      Confirm test branch works... This is with Ronivay's script. Include_V6 option is set to false in config file. Maybe that is why it still defaults to v5. At least all links work now...

                      Screenshot 2025-12-15 190921.png

                      Screenshot 2025-12-15 190657.png

                      Screenshot 2025-12-15 190719.png

                      Screenshot 2025-12-15 190739.png

                      1 Reply Last reply Reply Quote 1
                      • MathieuRAM Online
                        MathieuRA Vates 🪐 XO Team
                        last edited by

                        Thank you all for your feedback!

                        A 1 Reply Last reply Reply Quote 2
                        • A Offline
                          acebmxer @MathieuRA
                          last edited by

                          @MathieuRA

                          Just updated to the current commit 7c176. And all is working as in test commit. Question what is needed now to make v6 the default? Still as previously or has anything changed this last commit?

                          MathieuRAM 1 Reply Last reply Reply Quote 0
                          • MathieuRAM Online
                            MathieuRA Vates 🪐 XO Team @acebmxer
                            last edited by

                            @acebmxer the procedure remains the same

                            P 1 Reply Last reply Reply Quote 0
                            • P Online
                              probain @MathieuRA
                              last edited by

                              @MathieuRA

                              Unfortunately this didn't solve it for me.
                              But I am behind a haproxy for this., yes. However I haven't been able to get this to work. Even when I did the same "fixes" that helped my second lab.

                              Is there anything I could provide to maybe help out? Which logs would be helpfull?

                              Thank you

                              MathieuRAM 1 Reply Last reply Reply Quote 0
                              • MathieuRAM Online
                                MathieuRA Vates 🪐 XO Team @probain
                                last edited by

                                @probain Do you have a configuration file that overrides xo-server configuration for [http.mounts] and [http.proxies]?
                                `

                                P 1 Reply Last reply Reply Quote 0
                                • P Online
                                  probain @MathieuRA
                                  last edited by

                                  @MathieuRA said in XO5 breaks after defaulting to XO6 (from source):

                                  @probain Do you have a configuration file that overrides xo-server configuration for [http.mounts] and [http.proxies]?
                                  `

                                  Adding the following, breaks XO6 ("Cannot get /"). And XO5 still is stuck on "Still Loading.

                                  [http.upgrade]
                                  '/v5/api' = true
                                  '/v5/api/updater' = true
                                  
                                  [http.routes]
                                  '/v5/api' = { upgrade = true }
                                  '/v5/api/updater' = { upgrade = true }
                                  
                                  # List of files/directories which will be served.
                                  [http.mounts]
                                  #'/any/url' = '/path/to/directory'
                                  '/v6' = '../../@xen-orchestra/web/dist/'
                                  '/' = '../xo-web/dist/'
                                  

                                  If you're curious as to how I set everything up. I use my ansible-role (shared previously).
                                  Link for reference: https://github.com/cloudrootab/ansible_role_xoce/

                                  MathieuRAM 1 Reply Last reply Reply Quote 0
                                  • MathieuRAM Online
                                    MathieuRA Vates 🪐 XO Team @probain
                                    last edited by

                                    @probain Do you have any xo-server logs?

                                    can you fetch /rest/v0/gui-routes endpoint?

                                    P 1 Reply Last reply Reply Quote 0
                                    • P Online
                                      probain @MathieuRA
                                      last edited by olivierlambert

                                      @MathieuRA said in XO5 breaks after defaulting to XO6 (from source):

                                      @probain Do you have any xo-server logs?

                                      can you fetch /rest/v0/gui-routes endpoint?

                                      This is what results on the page

                                      {
                                        "xo5": "/v5",
                                        "xo6": "/v6"
                                      }
                                      
                                      MathieuRAM 1 Reply Last reply Reply Quote 0
                                      • MathieuRAM Online
                                        MathieuRA Vates 🪐 XO Team @probain
                                        last edited by

                                        @probain Can you provide me with the logs from xo-server at its launch?

                                        P 1 Reply Last reply Reply Quote 0
                                        • P Online
                                          probain @MathieuRA
                                          last edited by probain

                                          @MathieuRA said in XO5 breaks after defaulting to XO6 (from source):

                                          @probain Can you provide me with the logs from xo-server at its launch?

                                          I would love to. However, I'm unsure which logs you're refering to.
                                          Since I can't work with XO5. The logs from therein aren't available.

                                          However. Doing a journalctl -ef when doing a systemctl start xo-server results in

                                          Dec 16 16:54:00 xo sudo[50689]: pam_unix(sudo:session): session opened for user root(uid=0) by REDACTED(uid=1002)
                                          Dec 16 16:54:00 xo systemd[1]: Started xo-server.service - XO Server.
                                          Dec 16 16:54:00 xo sudo[50689]: pam_unix(sudo:session): session closed for user root
                                          Dec 16 16:54:02 xo xo-server[50694]: 2025-12-16T15:54:02.774Z xo:main WARN could not detect current commit {
                                          Dec 16 16:54:02 xo xo-server[50694]:   error: Error: Command failed: git rev-parse --short HEAD
                                          Dec 16 16:54:02 xo xo-server[50694]:   fatal: detected dubious ownership in repository at '/opt/xen-orchestra'
                                          Dec 16 16:54:02 xo xo-server[50694]:   To add an exception for this directory, call:
                                          Dec 16 16:54:02 xo xo-server[50694]:
                                          Dec 16 16:54:02 xo xo-server[50694]:           git config --global --add safe.directory /opt/xen-orchestra
                                          Dec 16 16:54:02 xo xo-server[50694]:
                                          Dec 16 16:54:02 xo xo-server[50694]:       at genericNodeError (node:internal/errors:983:15)
                                          Dec 16 16:54:02 xo xo-server[50694]:       at wrappedFn (node:internal/errors:537:14)
                                          Dec 16 16:54:02 xo xo-server[50694]:       at ChildProcess.exithandler (node:child_process:417:12)
                                          Dec 16 16:54:02 xo xo-server[50694]:       at ChildProcess.emit (node:events:519:28)
                                          Dec 16 16:54:02 xo xo-server[50694]:       at ChildProcess.patchedEmit [as emit] (/opt/xen-orchestra/@xen-orchestra/log/configure.js:52:17)
                                          Dec 16 16:54:02 xo xo-server[50694]:       at maybeClose (node:internal/child_process:1101:16)
                                          Dec 16 16:54:02 xo xo-server[50694]:       at Socket.<anonymous> (node:internal/child_process:456:11)
                                          Dec 16 16:54:02 xo xo-server[50694]:       at Socket.emit (node:events:519:28)
                                          Dec 16 16:54:02 xo xo-server[50694]:       at Socket.patchedEmit [as emit] (/opt/xen-orchestra/@xen-orchestra/log/configure.js:52:17)
                                          Dec 16 16:54:02 xo xo-server[50694]:       at Pipe.<anonymous> (node:net:346:12)
                                          Dec 16 16:54:02 xo xo-server[50694]:       at Pipe.callbackTrampoline (node:internal/async_hooks:130:17) {
                                          Dec 16 16:54:02 xo xo-server[50694]:     code: 128,
                                          Dec 16 16:54:02 xo xo-server[50694]:     killed: false,
                                          Dec 16 16:54:02 xo xo-server[50694]:     signal: null,
                                          Dec 16 16:54:02 xo xo-server[50694]:     cmd: 'git rev-parse --short HEAD'
                                          Dec 16 16:54:02 xo xo-server[50694]:   }
                                          Dec 16 16:54:02 xo xo-server[50694]: }
                                          Dec 16 16:54:02 xo xo-server[50694]: 2025-12-16T15:54:02.777Z xo:main INFO Starting xo-server v5.194.2 (https://github.com/vatesfr/xen-orchestra/commit/7c1764a39)
                                          Dec 16 16:54:02 xo xo-server[50694]: 2025-12-16T15:54:02.794Z xo:main INFO Configuration loaded.
                                          Dec 16 16:54:02 xo xo-server[50694]: 2025-12-16T15:54:02.818Z xo:main INFO Web server listening on https://[::]:8443
                                          Dec 16 16:54:02 xo xo-server[50694]: 2025-12-16T15:54:02.819Z xo:main INFO Group changed to xo-user
                                          Dec 16 16:54:02 xo xo-server[50694]: 2025-12-16T15:54:02.820Z xo:main INFO User changed to xo-user
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.296Z xo:mixins:hooks WARN start failure {
                                          Dec 16 16:54:03 xo xo-server[50694]:   error: Error: spawn xenstore-read ENOENT
                                          Dec 16 16:54:03 xo xo-server[50694]:       at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
                                          Dec 16 16:54:03 xo xo-server[50694]:       at onErrorNT (node:internal/child_process:483:16)
                                          Dec 16 16:54:03 xo xo-server[50694]:       at processTicksAndRejections (node:internal/process/task_queues:90:21) {
                                          Dec 16 16:54:03 xo xo-server[50694]:     errno: -2,
                                          Dec 16 16:54:03 xo xo-server[50694]:     code: 'ENOENT',
                                          Dec 16 16:54:03 xo xo-server[50694]:     syscall: 'spawn xenstore-read',
                                          Dec 16 16:54:03 xo xo-server[50694]:     path: 'xenstore-read',
                                          Dec 16 16:54:03 xo xo-server[50694]:     spawnargs: [ 'vm' ],
                                          Dec 16 16:54:03 xo xo-server[50694]:     cmd: 'xenstore-read vm'
                                          Dec 16 16:54:03 xo xo-server[50694]:   }
                                          Dec 16 16:54:03 xo xo-server[50694]: }
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.302Z xo:mixins:hooks WARN start failure {
                                          Dec 16 16:54:03 xo xo-server[50694]:   error: Error: Command failed with exit code 1: losetup -D
                                          Dec 16 16:54:03 xo xo-server[50694]:   losetup: /dev/loop1: detach failed: Permission denied
                                          Dec 16 16:54:03 xo xo-server[50694]:   losetup: /dev/loop4: detach failed: Permission denied
                                          Dec 16 16:54:03 xo xo-server[50694]:   losetup: /dev/loop2: detach failed: Permission denied
                                          Dec 16 16:54:03 xo xo-server[50694]:   losetup: /dev/loop0: detach failed: Permission denied
                                          Dec 16 16:54:03 xo xo-server[50694]:   losetup: /dev/loop5: detach failed: Permission denied
                                          Dec 16 16:54:03 xo xo-server[50694]:   losetup: /dev/loop3: detach failed: Permission denied
                                          Dec 16 16:54:03 xo xo-server[50694]:       at makeError (file:///opt/xen-orchestra/packages/xo-server/node_modules/execa/lib/error.js:60:11)
                                          Dec 16 16:54:03 xo xo-server[50694]:       at handlePromise (file:///opt/xen-orchestra/packages/xo-server/node_modules/execa/index.js:124:26) {
                                          Dec 16 16:54:03 xo xo-server[50694]:     shortMessage: 'Command failed with exit code 1: losetup -D',
                                          Dec 16 16:54:03 xo xo-server[50694]:     command: 'losetup -D',
                                          Dec 16 16:54:03 xo xo-server[50694]:     escapedCommand: 'losetup -D',
                                          Dec 16 16:54:03 xo xo-server[50694]:     exitCode: 1,
                                          Dec 16 16:54:03 xo xo-server[50694]:     signal: undefined,
                                          Dec 16 16:54:03 xo xo-server[50694]:     signalDescription: undefined,
                                          Dec 16 16:54:03 xo xo-server[50694]:     stdout: '',
                                          Dec 16 16:54:03 xo xo-server[50694]:     stderr: 'losetup: /dev/loop1: detach failed: Permission denied\n' +
                                          Dec 16 16:54:03 xo xo-server[50694]:       'losetup: /dev/loop4: detach failed: Permission denied\n' +
                                          Dec 16 16:54:03 xo xo-server[50694]:       'losetup: /dev/loop2: detach failed: Permission denied\n' +
                                          Dec 16 16:54:03 xo xo-server[50694]:       'losetup: /dev/loop0: detach failed: Permission denied\n' +
                                          Dec 16 16:54:03 xo xo-server[50694]:       'losetup: /dev/loop5: detach failed: Permission denied\n' +
                                          Dec 16 16:54:03 xo xo-server[50694]:       'losetup: /dev/loop3: detach failed: Permission denied',
                                          Dec 16 16:54:03 xo xo-server[50694]:     cwd: '/',
                                          Dec 16 16:54:03 xo xo-server[50694]:     failed: true,
                                          Dec 16 16:54:03 xo xo-server[50694]:     timedOut: false,
                                          Dec 16 16:54:03 xo xo-server[50694]:     isCanceled: false,
                                          Dec 16 16:54:03 xo xo-server[50694]:     killed: false
                                          Dec 16 16:54:03 xo xo-server[50694]:   }
                                          Dec 16 16:54:03 xo xo-server[50694]: }
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.578Z xo:main INFO Setting up /robots.txt → /opt/xen-orchestra/packages/xo-server/robots.txt
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.769Z xo:plugin INFO register audit
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.770Z xo:plugin INFO register auth-github
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.770Z xo:plugin INFO register auth-google
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.770Z xo:plugin INFO register auth-ldap
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.771Z xo:plugin INFO register auth-oidc
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.771Z xo:plugin INFO register auth-saml
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.771Z xo:plugin INFO register backup-reports
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.772Z xo:plugin INFO register load-balancer
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.772Z xo:plugin INFO register netbox
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.772Z xo:plugin INFO register perf-alert
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.773Z xo:plugin INFO register sdn-controller
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.773Z xo:plugin INFO register test-plugin
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.773Z xo:plugin INFO register transport-email
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.774Z xo:plugin INFO register transport-icinga2
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.774Z xo:plugin INFO register transport-nagios
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.774Z xo:plugin INFO register transport-slack
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.775Z xo:plugin INFO register transport-xmpp
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.775Z xo:plugin INFO register usage-report
                                          Dec 16 16:54:03 xo xo-server[50694]: 2025-12-16T15:54:03.775Z xo:plugin INFO register web-hooks
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.422Z xo:plugin INFO successfully register auth-github
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.423Z xo:plugin INFO successfully register auth-google
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.423Z xo:plugin INFO successfully register auth-ldap
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.423Z xo:plugin INFO successfully register test-plugin
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.423Z xo:plugin INFO successfully register transport-icinga2
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.423Z xo:plugin INFO successfully register auth-oidc
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.423Z xo:plugin INFO successfully register netbox
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.423Z xo:plugin INFO successfully register transport-nagios
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.423Z xo:plugin INFO successfully register transport-slack
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.423Z xo:plugin INFO successfully register transport-xmpp
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.423Z xo:plugin INFO successfully register web-hooks
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.423Z xo:plugin INFO successfully register load-balancer
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.424Z xo:plugin INFO successfully register usage-report
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.424Z xo:plugin INFO successfully register backup-reports
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.424Z xo:plugin INFO successfully register auth-saml
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.424Z xo:plugin INFO successfully register transport-email
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.424Z xo:plugin INFO successfully register perf-alert
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.429Z xo:plugin INFO successfully register audit
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.451Z xo:plugin INFO successfully register sdn-controller
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.452Z xo:main INFO Setting up /v5 → /opt/xen-orchestra/packages/xo-web/dist
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.452Z xo:main INFO Setting up /v6 → /opt/xen-orchestra/@xen-orchestra/web/dist
                                          Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.452Z xo:main INFO Setting up / → /opt/xen-orchestra/@xen-orchestra/web/dist
                                          

                                          Update:
                                          I have no idea why your PR is shown.

                                          0 MathieuRA committed to vatesfr/xen-orchestra
                                          fix(xo-server): fix proxied urls when using ssl (#9314)
                                          
                                          introduced by 03cea8b24d48e685a2a5a04a39db70d67d87eca0
                                          
                                          Fixed [forum#11681](https://xcp-ng.org/forum/topic/11681/xo5-breaks-after-defaulting-to-xo6-from-source/16?_=1765875445829)
                                          MathieuRAM 1 Reply Last reply Reply Quote 0
                                          • MathieuRAM Online
                                            MathieuRA Vates 🪐 XO Team @probain
                                            last edited by MathieuRA

                                            @probain That's what I was looking for.

                                            It's strange you are saying you receive an error: ("Cannot get /") because logs show / is mounted and exposes XO6.

                                            Dec 16 16:54:04 xo xo-server[50694]: 2025-12-16T15:54:04.452Z xo:main INFO Setting up / → /opt/xen-orchestra/@xen-orchestra/web/dist

                                            Even when I did the same "fixes" that helped my second lab.

                                            The only difference with your second lab is that you use HAProxy?
                                            Both are listening on IPv6?

                                            P 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post