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

    Xen Orchestra web UI becomes unresponsive when an NFS backup remote goes offline

    Scheduled Pinned Locked Moved Xen Orchestra
    6 Posts 3 Posters 22 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.
    • F
      frb94
      last edited by

      Hi everyone,

      I am a very new user of XCPNG in my homelab. I think it's a fantastic product and i'm very happy with it. I have an issue that i did not find any reference online. I tried to troubleshoot it with my knowledge, but i did not go far. The following paragraph was written by chatgpt with the finding "we" had. It's all correct as far as i can tell.

      I'm experiencing a reproducible issue with Xen Orchestra when an NFS backup remote becomes unavailable.

      My backup storage is hosted on a Synology NAS configured with Auto Poweroff, which automatically shuts down the NAS after a period of inactivity.

      Xen Orchestra remains powered on 24/7.

      The expectation is that an unavailable backup remote should not affect the availability of the Xen Orchestra management interface, especially when no backup job is running.

      However, after the NAS has been powered off for some time, the entire XO web interface becomes unresponsive.

      After investigating the issue, I found that multiple Node.js libuv worker threads become blocked inside NFS kernel operations.

      Environment

      • Xen Orchestra: Installed from source (ronivay script)
      • XO build: xen-orchestra-202611011738 (November 1, 2026)
      • XO server: Linux, managed by systemd
      • XO server IP: 10.0.0.30
      • Backup storage: Synology NAS
      • NAS IP: 10.0.0.28
      • Remote type: NFS
      • NFS version: 4.0
      • NFS mount options: hard,timeo=600,retrans=2
      • NAS power management: Automatic shutdown after inactivity

      Steps to reproduce

      • Configure an NFS backup remote in Xen Orchestra.
      • Run backup jobs successfully.
      • Wait until all backup operations have finished.
      • Allow the Synology NAS to shut down automatically.
      • Keep Xen Orchestra running.
      • After some time, try opening the XO web interface.

      Same behaviour when trying to enable the already-disabled remote while nas is off.

      Observed result: Chrome keeps loading indefinitely, without displaying the login page.

      The issue occurs even when accessing XO directly by its IP address.

      Investigation

      1. The NFS mount remains active

      Even though the NAS is offline, the NFS remote remains mounted:

      10.0.0.28:/volume2/xobackup
      /run/xo-server/mounts/9fc232df-4d0c-4a15-93b5-c0585c1dd9c9
      nfs4 rw,vers=4.0,hard,proto=tcp,timeo=600,retrans=2

      The Linux kernel repeatedly reports:

      nfs: server 10.0.0.28 not responding, timed out
      nfs: server 10.0.0.28 not responding, still trying

      These messages continue for hours while the NAS is unavailable.

      1. XO remains running

      The service is still reported as active:

      xo-server.service - XO Server
      Active: active (running)
      Main PID: 729 (MainThread)

      The main Node.js thread is not blocked in NFS I/O:

      PID STAT WCHAN
      729 Ssl do_epoll_wait

      1. Multiple libuv workers are blocked

      This is the most interesting finding.

      Running:

      ps -T -p 729 -o pid,tid,stat,wchan:32,comm

      produces:

      PID TID STAT WCHAN COMMAND
      729 729 Ssl do_epoll_wait MainThread
      729 862 Dsl rpc_wait_bit_killable libuv-worker
      729 863 Dsl rpc_wait_bit_killable libuv-worker
      729 864 Dsl rpc_wait_bit_killable libuv-worker
      729 865 Dsl rpc_wait_bit_killable libuv-worker
      729 2840 Ssl futex_wait_queue libuv-worker

      Four libuv workers are blocked in uninterruptible sleep, waiting for NFS RPC operations.

      1. HTTP works without compression

      Interestingly, XO still responds correctly to uncompressed HTTP requests.

      From the XO machine:

      curl -k https://127.0.0.1/signin

      Result:

      HTTP: 200
      Time: 0.005740s

      From another Windows PC:

      curl.exe -k -v https://10.0.0.30/signin -o NUL

      Result:

      HTTP/1.1 200 OK
      Content-Length: 5664
      100 5664

      The entire HTML document is transferred successfully.

      1. HTTP compression hangs

      However, enabling HTTP compression causes the request to hang.

      From Windows:

      curl.exe -k -v --compressed --max-time 10 https://10.0.0.30/signin -o NUL

      Result:

      Accept-Encoding: deflate, gzip
      Request completely sent off

      Operation timed out after 10012 milliseconds
      with 0 bytes received

      The same behavior can be reproduced locally on the XO server using curl --compressed.

      This appears to explain why Chrome cannot display the login page, while basic uncompressed HTTP requests still succeed.

      1. XO logs reference backup remote operations

      The xo-server logs also show stack traces involving:

      BackupNg._listVmBackupsOnRemote
      BackupNg._listVmBackupsWithBackoff

      This suggests XO is attempting to access backup metadata on the unavailable remote.

      Possible root cause

      My hypothesis is that filesystem operations against the unavailable NFS hard mount block libuv worker threads.

      Node.js uses the libuv thread pool for asynchronous filesystem operations and some other operations, including zlib compression.

      If the available workers become blocked waiting for NFS RPC responses, HTTP compression tasks may be unable to complete.

      This would explain the observed behavior:

      • Uncompressed HTTP requests work.
      • Compressed HTTP requests hang.
      • The browser cannot load the GUI.
      • Several libuv workers are stuck in rpc_wait_bit_killable.

      I have confirmed the blocked workers and the compression-dependent HTTP timeout, but I have not yet confirmed the internal scheduling mechanism within Node.js.

      Recovery attempt

      I attempted to terminate the blocked worker threads with kill -9.

      This caused the main Node.js thread to enter a zombie state, while one worker remained blocked:

      PID TID STAT WCHAN
      729 729 Zsl -
      729 864 Dsl rpc_wait_bit_killable

      I also tried a lazy unmount:

      umount -l /run/xo-server/mounts/9fc232df-4d0c-4a15-93b5-c0585c1dd9c9

      The command completed, but the blocked worker remained in the same state.

      These were recovery experiments, not recommended procedures.

      Expected behavior

      Ideally, if an NFS backup remote becomes unavailable:

      • Backup operations involving that remote should report an error or remain isolated.
      • The management GUI should remain responsive.
      • Unrelated operations should continue functioning.
      • An unavailable backup repository should not exhaust the Node.js worker pool.
      • Temporary unavailability of the backup storage should not require force restarting the XO VM.

      Questions

      Is this a known issue with Xen Orchestra's handling of unavailable NFS remotes?

      Is there a recommended configuration for NFS repositories hosted on NAS devices that may power off automatically?

      Does Xen Orchestra periodically access or keep NFS remotes mounted even when no backup jobs are running?

      Would increasing UV_THREADPOOL_SIZE be a reasonable mitigation, or could filesystem operations still exhaust the larger pool?

      Could the remote filesystem operations be isolated from the main xo-server process to prevent this scenario?

      I would prefer to retain NFS hard mounts for backup integrity rather than switching to soft.

      I can provide additional logs and diagnostics if useful.

      Thanks!

      poddingueP 1 Reply Last reply
      Reply Quote 0
      • poddingueP
        poddingue Vates 🪐 @frb94
        last edited by

        This looks like the same thing @acebmxer ran into in July (https://xcp-ng.org/forum/topic/12339), and your libuv reading matches what the XO devs wrote in https://github.com/vatesfr/xen-orchestra/pull/10587.

        As I read their write-up, with a hard mount every background operation on the dead remote (listing backups, retries) holds one of xo-server's file-access threads until the NAS comes back, and once they're all taken the web UI can't be served either.

        Olivier's advice back then (https://xcp-ng.org/forum/post/106632) was to disable the remote while the NAS is still up and only then power it off, and acebmxer scripted that on the Synology so the remote gets disabled at shutdown and enabled again at startup through the XO API.

        If XO is already stuck, XO 6.10.0 added xo-server-db disable-remote <id>, which you run while xo-server is stopped so the remote isn't mounted again on the next start; your November 1 build should have it if I read the dates right, but I haven't tried it myself.

        About UV_THREADPOOL_SIZE I'm only guessing, but since a hung NFS call never gives its thread back I'd expect a bigger pool to just take longer to fill, and the PR says they tried capping the threads one remote can use and dropped the idea for now. @Team-XO-Backend will know better than me whether more is planned.

        F acebmxerA 2 Replies Last reply
        Reply Quote 1
        • F
          frb94 @poddingue
          last edited by

          @poddingue

          Thank you very much for the answer.

          This is my idea for now, but i'll look into better ways to do this.

          */5 * * * * /opt/scripts/enabledisableremote.sh
          
          #!/bin/bash
          
          export PATH="/usr/local/bin:/usr/bin:/bin:$HOME/.npm-global/bin:$PATH"
          
          REMOTE="9fc232df-4d0c-4a15-93b5-c0585c1dd9c9"
          NAS="10.0.0.28"
          
          # Stato attuale del Remote
          CURRENT=$(/usr/local/bin/xo-cli remote.getAll --json | jq -r --arg id "$REMOTE" '.[] | select(.id == $id) | .enabled')
          
          # Stato desiderato in base alla raggiungibilità del NAS
          if ping -c 1 -W 2 "$NAS" > /dev/null 2>&1; then
              DESIRED=true
          else
              DESIRED=false
          fi
          
          # Cambia stato solo se necessario
          if [[ "$CURRENT" == "true" || "$CURRENT" == "false" ]]; then
              if [[ "$CURRENT" != "$DESIRED" ]]; then
                  /usr/local/bin/xo-cli remote.set id="$REMOTE" enabled="$DESIRED"
              fi
          fi
          
          1 Reply Last reply
          Reply Quote 0
          • acebmxerA
            acebmxer @poddingue
            last edited by

            @poddingue @frb94

            Yes if I recall (I may not have stated on the forum) that I still ended up with issues and just abounded the idea. Not sure on the time line when they attempted a patch to when i stopped disabling the remote.

            F 1 Reply Last reply
            Reply Quote 0
            • F
              frb94 @acebmxer
              last edited by

              @acebmxer So what are you doing now? Given the manual, NFS is the way, but i can't have the remote available h24 and also i would like to have a functioning XO 😀

              acebmxerA 1 Reply Last reply
              Reply Quote 0
              • acebmxerA
                acebmxer @frb94
                last edited by

                @frb94

                Just leaving it on 24/7 😞 winter is here now or so we thought (its 75f outside today) . If there is any update on this i would try again. but as it seems you are having the same issue i did then, it does not appear to be fixed.

                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