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

    xo-server/bin doesn't exist after updating with yarn build.

    Scheduled Pinned Locked Moved Solved Xen Orchestra
    25 Posts 5 Posters 5.6k Views 1 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.
    • R Offline
      runevn @Danp
      last edited by

      Danp

      Does this means that XO can't find its own module or is it node's module?

      mex@xo-community:~$ node --trace-warnings ...
      internal/modules/cjs/loader.js:905
        throw err;
        ^
      
      Error: Cannot find module '/home/mex/...'
          at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
          at Function.Module._load (internal/modules/cjs/loader.js:746:27)
          at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
          at internal/main/run_main_module.js:17:47 {
        code: 'MODULE_NOT_FOUND',
        requireStack: []
      }
      
      DanpD 1 Reply Last reply Reply Quote 0
      • DanpD Offline
        Danp Pro Support Team @runevn
        last edited by

        runevn IDK. Maybe julien-f can suggest a solution for this.

        R 1 Reply Last reply Reply Quote 1
        • R Offline
          runevn @Danp
          last edited by

          Danp said in xo-server/bin doesn't exist after updating with yarn build.:

          runevn IDK. Maybe julien-f can suggest a solution for this.

          But thank you for your effort! I really appreciate it.

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

            runevn Don't know much about forever, in the meantime, you can try to run xo-server manually:

            > cd packages/xo-server
            > ./dist/cli.mjs
            
            R DanpD 2 Replies Last reply Reply Quote 1
            • R Offline
              runevn @julien-f
              last edited by

              julien-f said in xo-server/bin doesn't exist after updating with yarn build.:

              runevn Don't know much about forever, in the meantime, you can try to run xo-server manually:

              > cd packages/xo-server
              > ./dist/cli.mjs
              

              Thanks for your reply julien-f . When I manually run xo-server it still doesn't work. Here is the output

              mex@xo-community:~/xen-orchestra/packages/xo-server$ sudo ./dist/cli.mjs
              (node:65352) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
              (Use `node --trace-warnings ...` to show where the warning was created)
              /home/mex/xen-orchestra/packages/xo-server/dist/xapi/mixins/index.js:2
              import _gpu, * as __gpu from "./gpu";
              ^^^^^^
              
              SyntaxError: Cannot use import statement outside a module
                  at wrapSafe (internal/modules/cjs/loader.js:1001:16)
                  at Module._compile (internal/modules/cjs/loader.js:1049:27)
                  at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
                  at Module.load (internal/modules/cjs/loader.js:950:32)
                  at Function.Module._load (internal/modules/cjs/loader.js:790:14)
                  at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:199:29)
                  at ModuleJob.run (internal/modules/esm/module_job.js:169:25)
                  at async Loader.import (internal/modules/esm/loader.js:177:24)
                  at async Object.loadESM (internal/process/esm_loader.js:68:5)
              mex@xo-community:~/xen-orchestra/packages/xo-server$
              

              Is there any other information that I can provide?

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

                runevn https://xcp-ng.org/forum/post/39787

                DanpD 1 Reply Last reply Reply Quote 1
                • DanpD Offline
                  Danp Pro Support Team @julien-f
                  last edited by

                  git clean -d -f should work to remove any untracked files.

                  1 Reply Last reply Reply Quote 1
                  • DanpD Offline
                    Danp Pro Support Team @julien-f
                    last edited by

                    julien-f Do we know what leads to these untracked files? Could it be file renaming such as here?

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

                      Danp No, those are generated files.

                      Unfortunately they are not cleaned-up automatically but hopefully this won't happen too often šŸ™‚

                      R 1 Reply Last reply Reply Quote 1
                      • R Offline
                        runevn @julien-f
                        last edited by

                        julien-f and Danp thanks a lot for your help! Now it works if I manually run cli.mjs

                        mex@xo-community:~/xen-orchestra/packages/xo-server$ sudo ./dist/cli.mjs
                        2021-06-30T06:21:41.457Z xo:main INFO Configuration loaded.
                        2021-06-30T06:21:41.478Z xo:main INFO Web server listening on http://[::]:80
                        2021-06-30T06:21:41.924Z xo:main INFO Setting up / → /home/mex/xen-orchestra/packages/xo-web/dist
                        

                        However, what should I do to recreate the service to start on boot. When setting up and using forever as described here. I'm still not able to load the web interface.

                        It seems that the service starts and is active

                        mex@xo-community:~/xen-orchestra/packages/xo-server$ sudo service orchestra status
                        ā— orchestra.service - LSB: forever-service startup script for orchestra
                           Loaded: loaded (/etc/init.d/orchestra; generated)
                           Active: active (exited) since Wed 2021-06-30 08:28:05 CEST; 3min 15s ago
                             Docs: man:systemd-sysv-generator(8)
                          Process: 1141 ExecStart=/etc/init.d/orchestra start (code=exited, status=0/SUCCESS)
                        
                        Jun 30 08:28:04 xo-community systemd[1]: Starting LSB: forever-service startup script for orchestra...
                        Jun 30 08:28:05 xo-community orchestra[1141]: (node:1145) Warning: Accessing non-existent property 'padLevels' of module exports inside c
                        Jun 30 08:28:05 xo-community orchestra[1141]: (Use `node --trace-warnings ...` to show where the warning was created)
                        Jun 30 08:28:05 xo-community orchestra[1141]: (node:1145) Warning: Accessing non-existent property 'padLevels' of module exports inside c
                        Jun 30 08:28:05 xo-community orchestra[1141]: Starting orchestra
                        Jun 30 08:28:05 xo-community orchestra[1141]: (node:1162) Warning: Accessing non-existent property 'padLevels' of module exports inside c
                        Jun 30 08:28:05 xo-community orchestra[1141]: (Use `node --trace-warnings ...` to show where the warning was created)
                        Jun 30 08:28:05 xo-community orchestra[1141]: (node:1162) Warning: Accessing non-existent property 'padLevels' of module exports inside c
                        Jun 30 08:28:05 xo-community systemd[1]: Started LSB: forever-service startup script for orchestra.
                        
                        1 Reply Last reply Reply Quote 0
                        • R Offline
                          runevn
                          last edited by runevn

                          Just a little update: I didn't find a solution to the problem so I ended up restoring from my backup. However, I think I found what originally created the problems:

                          It was not directly related to XO, but before I upgraded XO, which caused the problems, I ran sudo apt upgrade and somehow the redis-server service stalled and maybe corrupted the update and thus created problems when I tried to update XO.

                          So what I did was, after I restored from the backup I shutdown the redis-server.service and then sudo apt upgrade and then upgraded XO from git. And now it works. But thanks a lot for your help julien-f and @Danp.

                          R 1 Reply Last reply Reply Quote 0
                          • R Offline
                            runevn @runevn
                            last edited by

                            Just to information if anyone else ends in a similar situation. My problem was created by two issues: 1) Failing to updating redis-server packet 2) Trouble with node modules.

                            1. Failing to update redis-server: I found out that I had trouble updating redis with the apt package manager. It stalled because the Forever service blocked apt upgrade. So I stopped the forever service forever stop orchestra and then updated redis.

                            2. The trouble with the node modules: Followed this post and removed the node modules and rebuild.

                            Thanks to julien-f and Danp for your help!

                            A 1 Reply Last reply Reply Quote 0
                            • A Offline
                              Alexander 0 @runevn
                              last edited by

                              I had same issue.
                              doing: git clean -d -f
                              and then running yarn build again helped.

                              1 Reply Last reply Reply Quote 1
                              • DanpD Danp referenced this topic on
                              • First post
                                Last post