XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Groups 0
    F Online
    1. Home
    2. frb94

    frb94

    @frb94

    0
    Reputation
    1
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    frb94 Unfollow Follow
    • RE: Xen Orchestra web UI becomes unresponsive when an NFS backup remote goes offline

      @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
      
      posted in Xen Orchestra
      F
      frb94
    • Xen Orchestra web UI becomes unresponsive when an NFS backup remote goes offline

      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!

      posted in Xen Orchestra
      F
      frb94