ronivay / XenOrchestraInstallerUpdater

Xen Orchestra install/update script
GNU General Public License v3.0
1.18k stars 189 forks source link

Error: Cannot find module 'bluebird' #75

Closed xnfra closed 3 years ago

xnfra commented 3 years ago

After updating my debian vm and installing the nodesource.com repo for node version 14.x I ran this updater with option 2. Everything exits successfully but xo isn't running. systemctl shows that xo-server exits on a error. I checked /var/log/syslog while restarting the service and it shows the failure. syslog.txt

This was an attempted upgrade from a prior xo install that ran on node 12.x . After getting the "expected node 14.x" error from the updater. I installed the node 14.x repo and package. Any idea?

ronivay commented 3 years ago

Hi,

Please use the issue template in the future.

What OS and version you're running?

I'm not sure what you mean by "expected node 14.x" error, can you give some actual output/log message example? Make sure you run the latest version of this script.

xnfra commented 3 years ago

Sorry about that.

Running: Linux debian 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux

I'm not sure what you mean by "expected node 14.x" error

The error when trying to update xo but the node version was older. I added the repo for node v14.x myself. Next I re-ran the updater and it finishes updating successfully but xo isn't running. I then try systemctl status xo-server.service and it shows Active: failed (Result: exit-code). See the syslog.txt for the system log of xo crashing. It is saying it cannot find the module bluebird.

xnfra commented 3 years ago

Apr 25 21:38:30 debian systemd[1]: xo-server.service: Main process exited, code=exited, status=1/FAILURE Apr 25 21:38:30 debian systemd[1]: xo-server.service: Failed with result 'exit-code'. Apr 25 21:38:30 debian systemd[1]: xo-server.service: Service RestartSec=100ms expired, scheduling restart. Apr 25 21:38:30 debian systemd[1]: xo-server.service: Scheduled restart job, restart counter is at 5. Apr 25 21:38:30 debian systemd[1]: Stopped XO Server. Apr 25 21:38:30 debian systemd[1]: xo-server.service: Start request repeated too quickly. Apr 25 21:38:30 debian systemd[1]: xo-server.service: Failed with result 'exit-code'. Apr 25 21:38:30 debian systemd[1]: Failed to start XO Server. Apr 25 21:40:18 debian systemd[1]: Started XO Server. Apr 25 21:40:18 debian xo-server[2362]: internal/modules/cjs/loader.js:883 Apr 25 21:40:18 debian xo-server[2362]: throw err; Apr 25 21:40:18 debian xo-server[2362]: ^ Apr 25 21:40:18 debian xo-server[2362]: Error: Cannot find module 'bluebird' Apr 25 21:40:18 debian xo-server[2362]: Require stack: Apr 25 21:40:18 debian xo-server[2362]: - /etc/xo/xo-builds/xen-orchestra-202125041023/packages/xo-server/bin/xo-server Apr 25 21:40:18 debian xo-server[2362]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) Apr 25 21:40:18 debian xo-server[2362]: at Function.Module._load (internal/modules/cjs/loader.js:725:27) Apr 25 21:40:18 debian xo-server[2362]: at Module.require (internal/modules/cjs/loader.js:952:19) Apr 25 21:40:18 debian xo-server[2362]: at require (internal/modules/cjs/helpers.js:88:18) Apr 25 21:40:18 debian xo-server[2362]: at Object. (/etc/xo/xo-builds/xen-orchestra-202125041023/packages/xo-server/bin/xo-server:21:18) Apr 25 21:40:18 debian xo-server[2362]: at Module._compile (internal/modules/cjs/loader.js:1063:30) Apr 25 21:40:18 debian xo-server[2362]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) Apr 25 21:40:18 debian xo-server[2362]: at Module.load (internal/modules/cjs/loader.js:928:32) Apr 25 21:40:18 debian xo-server[2362]: at Function.Module._load (internal/modules/cjs/loader.js:769:14) Apr 25 21:40:18 debian xo-server[2362]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) { Apr 25 21:40:18 debian xo-server[2362]: code: 'MODULE_NOT_FOUND', Apr 25 21:40:18 debian xo-server[2362]: requireStack: [ Apr 25 21:40:18 debian xo-server[2362]: '/etc/xo/xo-builds/xen-orchestra-202125041023/packages/xo-server/bin/xo-server' Apr 25 21:40:18 debian xo-server[2362]: ] Apr 25 21:40:18 debian xo-server[2362]: }

ronivay commented 3 years ago

Yeah, got that. Bluebird error is just a symptom of something else which isn’t clear yet.

Script should handle node.js upgrade unless you’ve specifically denied it in config. That’s why i wondered if you’re running latest version.

Can you give me the full installation log from the latest seamingly successful run you did. These should by default be inside logs directory.

xnfra commented 3 years ago

Can you give me the full installation log from the latest seamingly successful run you did. These should by default be inside logs directory.

EDIT: I just saw that I need to increase the memory for my vm even more. I just did a git pull to update the script. I'm assuming the problem was with the older version of this script not throwing any errors during the update. I will report back and close this request once I run this again and if everything works fine. xo-install.log

ronivay commented 3 years ago

You're running out of memory. Make sure you have at least 4GB allocated to the VM. I think i know now what happened. You were running outdated version of this script which had an issue that it didn't exit correctly if xen orchestra build failed. That ended up to error about bluebird module when trying to start service.

That issue is now fixed and script exits correctly when it encounters an issue which in this case is OOM (out of memory) error.

Give your VM some RAM, re-run update and let me know how it goes.

xnfra commented 3 years ago

Yes, the problem was with the older version of this script not throwing any errors other then the node version being out of date. The install was failing to start. After pulling the latest version and adjusting my guest ram I was able to successfully update my xo install.