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

    Error after Xen Orchestra update | SyntaxError: The requested module 'node:crypto' does not provide an export named 'X509Certificate'

    Scheduled Pinned Locked Moved Solved Xen Orchestra
    8 Posts 4 Posters 753 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.
    • OhSoNoobO Offline
      OhSoNoob
      last edited by OhSoNoob

      Hi,

      After updating my from source installation of Xen Orchestra, the service will not start because of the following error.
      Any hints for a solution?

      Aug 04 17:14:06 xo systemd[1]: Started XO Server.
      Aug 04 17:14:06 xo xo-server[94935]: file:///opt/xo/xo-builds/xen-orchestra-202208041711/@xen-orchestra/mixins/SslCertificate.mjs:4
      Aug 04 17:14:06 xo xo-server[94935]: import { X509Certificate } from 'node:crypto'
      Aug 04 17:14:06 xo xo-server[94935]:          ^^^^^^^^^^^^^^^
      Aug 04 17:14:06 xo xo-server[94935]: SyntaxError: The requested module 'node:crypto' does not provide an export named 'X509Certificate'
      Aug 04 17:14:06 xo xo-server[94935]:     at ModuleJob._instantiate (internal/modules/esm/module_job.js:120:21)
      Aug 04 17:14:06 xo xo-server[94935]:     at async ModuleJob.run (internal/modules/esm/module_job.js:165:5)
      Aug 04 17:14:06 xo xo-server[94935]:     at async Loader.import (internal/modules/esm/loader.js:177:24)
      Aug 04 17:14:06 xo xo-server[94935]:     at async Object.loadESM (internal/process/esm_loader.js:68:5)
      Aug 04 17:14:06 xo systemd[1]: xo-server.service: Main process exited, code=exited, status=1/FAILURE
      Aug 04 17:14:06 xo systemd[1]: xo-server.service: Failed with result 'exit-code'.
      Aug 04 17:14:07 xo systemd[1]: xo-server.service: Scheduled restart job, restart counter is at 1.
      Aug 04 17:14:07 xo systemd[1]: Stopped XO Server.
      
      

      Status of the service is obviously stopped:

      ● xo-server.service - XO Server
           Loaded: loaded (/etc/systemd/system/xo-server.service; enabled; vendor preset: enabled)
           Active: failed (Result: exit-code) since Thu 2022-08-04 17:14:10 CEST; 8min ago
          Process: 94985 ExecStart=/opt/xo/xo-server/dist/cli.mjs (code=exited, status=1/FAILURE)
         Main PID: 94985 (code=exited, status=1/FAILURE)
              CPU: 601ms
      
      Aug 04 17:14:10 xo systemd[1]: xo-server.service: Scheduled restart job, restart counter is at 5.
      Aug 04 17:14:10 xo systemd[1]: Stopped XO Server.
      Aug 04 17:14:10 xo systemd[1]: xo-server.service: Start request repeated too quickly.
      Aug 04 17:14:10 xo systemd[1]: xo-server.service: Failed with result 'exit-code'.
      Aug 04 17:14:10 xo systemd[1]: Failed to start XO Server.
      
      

      OS is Debian 11

      1 Reply Last reply Reply Quote 0
      • OhSoNoobO Offline
        OhSoNoob @Danp
        last edited by

        Danp Yes, that was it!
        Last update I thougt to find a solution to a different problem bij installing nodejs 17.
        Removing version 17, and manually updating to the correct version did fix the issue.

        Thank you!

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

          Hi!

          Are you on the latest commit already?

          OhSoNoobO 2 Replies Last reply Reply Quote 0
          • OhSoNoobO Offline
            OhSoNoob @olivierlambert
            last edited by

            olivierlambert

            root@xo:~/XenOrchestraInstallerUpdater# ./xo-install.sh
            -----------------------------------------
            
            Welcome to automated Xen Orchestra install
            
            Following options will be used for installation:
            
            OS: Debian 11
            Basedir: /opt/xo
            User: root
            Port: 80
            HTTPS: false
            Git Branch for source: master
            Following plugins will be installed: all
            Number of previous installations to preserve: 3
            Node.js and yarn auto update: true
            
            Errorlog is stored to /root/XenOrchestraInstallerUpdater/logs/xo-install.log-202208041711 for debug purposes
            
            Depending on which installation is chosen:
            
            Xen Orchestra configuration will be stored to /root/.config/xo-server/config.toml, if you don't want it to be replaced with every update, set CONFIGUPDATE to false in xo-install.cfg
            Xen Orchestra Proxy configuration will be stored to /root/.config/xo-proxy/config.toml. Config won't be overwritten during update, ever
            -----------------------------------------
            
            1. Install
            2. Update
            3. Rollback
            4. Install proxy
            5. Update proxy
            6. Exit
            
            : 2
            
            [info] Checking current node.js version
            
            [ok] node.js version already on 17, checking updates
            
            [info] Fetching Xen Orchestra source code
            
            [info] Creating install directory: /opt/xo/xo-builds/xen-orchestra-202208041711
            
            [info] Updating Xen Orchestra from '30874b220' to 'f1f32c962'
            
            [ok] Shutting down xo-server
            
            [info] No 3rd party plugins to install
            
            [info] xo-server and xo-web build takes quite a while. Grab a cup of coffee and lay back
            
            [ok] Running installation
            
            [ok] Installing plugins
            
            [info] Fixing binary path in systemd service configuration file
            [info] Adding WorkingDirectory parameter to systemd service configuration file
            [info] Replacing systemd service configuration file
            [info] Reloading systemd configuration
            
            [info] Fixing relative path to xo-web installation in xo-server configuration file
            [info] Activating modified configuration file
            
            [info] Symlinking fresh xo-server install/update to /opt/xo/xo-server
            [info] Symlinking fresh xo-web install/update to /opt/xo/xo-web
            
            [info] Starting xo-server...
             waiting for port to be open
             waiting for port to be open
             waiting for port to be open
             waiting for port to be open
             waiting for port to be open
             waiting for port to be open
            
            [fail] Update completed, but looks like there was a problem when starting xo-server. Check /root/XenOrchestraInstallerUpdater/logs/xo-install.log-202208041711 for more details
            
            Control xo-server service with systemctl for stop/start/restart etc.
            
            
            DanpD 1 Reply Last reply Reply Quote 0
            • OhSoNoobO Offline
              OhSoNoob @olivierlambert
              last edited by

              olivierlambert
              I have been trying to update with this result for a couple of days now (to see if the fix is maybe in the commit).
              Since I have not seen another post regarding this issue, it might be a problem with my particular installation.

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

                You are showing me the result generated by a 3rd party script. I would advise to follow the documentation on how to react when this happens: https://xen-orchestra.com/docs/community.html

                1 Reply Last reply Reply Quote 0
                • DanpD Online
                  Danp Pro Support Team @OhSoNoob
                  last edited by

                  OhSoNoob

                  [ok] node.js version already on 17, checking updates

                  Can you try building with Node LTS, which is currently v16.16.0? FWIW, this works for me on my Ubuntu VM.

                  OhSoNoobO 1 Reply Last reply Reply Quote 1
                  • ronivayR Offline
                    ronivay Top contributor
                    last edited by

                    Yup, installed nodejs version is beyond LTS version, which could be the cause. It is probably installed manually outside of the script as well since it installs 16.x if missing/too old but doesn’t do anything if version is above.

                    1 Reply Last reply Reply Quote 2
                    • OhSoNoobO Offline
                      OhSoNoob @Danp
                      last edited by

                      Danp Yes, that was it!
                      Last update I thougt to find a solution to a different problem bij installing nodejs 17.
                      Removing version 17, and manually updating to the correct version did fix the issue.

                      Thank you!

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