Shell access error

I’m hitting an error when selecting shell access under the Clusters tab. The full output from the ondemand_nginx log is below. Seems to be a Node.js version mismatch? Any help/suggestions are appreciated!

[ E 2022-05-05 13:07:30.2574 1819743/Ty age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /var/www/ood/apps/sys/shell: The application process exited prematurely.
  Error ID: 4920929e
  Error details saved to: /tmp/passenger-error-xPDVtD.html

[ E 2022-05-05 13:07:30.2631 1819743/T8 age/Cor/Con/CheckoutSession.cpp:276 ]: [Client 1-2] Cannot checkout session because a spawning error occurred. The identifier of the error is 4920929e. Please see earlier logs for details about the error.
App 1821309 output: [2022-05-05 13:10:24 -0400 ]  INFO "method=GET path=/pun/sys/dashboard/ format=html controller=DashboardController action=index status=200 duration=15.83 view=8.84"
App 1821309 output: [2022-05-05 13:10:30 -0400 ]  INFO "method=GET path=/pun/sys/dashboard/files/fs/grid/it/home/heywood format=html controller=FilesController action=fs status=200 duration=12.12 view=7.08"
App 1821309 output: [2022-05-05 13:10:30 -0400 ]  INFO "method=GET path=/pun/sys/dashboard/files/fs/grid/it/home/heywood format=html controller=FilesController action=fs status=200 duration=97.97 view=40.30"
App 1821840 output: innerError Error: Cannot find module '../build/Debug/pty.node'
App 1821840 output: Require stack:
App 1821840 output: - /var/www/ood/apps/sys/shell/node_modules/node-pty/lib/unixTerminal.js
App 1821840 output: - /var/www/ood/apps/sys/shell/node_modules/node-pty/lib/index.js
App 1821840 output: - /var/www/ood/apps/sys/shell/app.js
App 1821840 output: - /opt/ood/ondemand/root/usr/share/passenger/helper-scripts/node-loader.js
App 1821840 output:     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:952:15)
App 1821840 output:     at Function.Module._load (internal/modules/cjs/loader.js:835:27)
App 1821840 output:     at Module.require (internal/modules/cjs/loader.js:1012:19)
App 1821840 output:     at Module.require (/opt/ood/ondemand/root/usr/share/passenger/helper-scripts/node-loader.js:80:25)
App 1821840 output:     at require (internal/modules/cjs/helpers.js:72:18)
App 1821840 output:     at Object.<anonymous> (/var/www/ood/apps/sys/shell/node_modules/node-pty/lib/unixTerminal.js:30:15)
App 1821840 output:     at Module._compile (internal/modules/cjs/loader.js:1123:30)
App 1821840 output:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
App 1821840 output:     at Module.load (internal/modules/cjs/loader.js:972:32)
App 1821840 output:     at Function.Module._load (internal/modules/cjs/loader.js:872:14) {
App 1821840 output:   code: 'MODULE_NOT_FOUND',
App 1821840 output:   requireStack: [
App 1821840 output:     '/var/www/ood/apps/sys/shell/node_modules/node-pty/lib/unixTerminal.js',
App 1821840 output:     '/var/www/ood/apps/sys/shell/node_modules/node-pty/lib/index.js',
App 1821840 output:     '/var/www/ood/apps/sys/shell/app.js',
App 1821840 output:     '/opt/ood/ondemand/root/usr/share/passenger/helper-scripts/node-loader.js'
App 1821840 output:   ]
App 1821840 output: }
App 1821840 output: /var/www/ood/apps/sys/shell/node_modules/node-pty/lib/unixTerminal.js:35
App 1821840 output:         throw outerError;
App 1821840 output:         ^
App 1821840 output:
App 1821840 output: Error: The module '/var/www/ood/apps/sys/shell/node_modules/node-pty/build/Release/pty.node'
App 1821840 output: was compiled against a different Node.js version using
App 1821840 output: NODE_MODULE_VERSION 72. This version of Node.js requires
App 1821840 output: NODE_MODULE_VERSION 79. Please try re-compiling or re-installing
App 1821840 output: the module (for instance, using `npm rebuild` or `npm install`).
App 1821840 output:     at Object.Module._extensions..node (internal/modules/cjs/loader.js:1173:18)
App 1821840 output:     at Module.load (internal/modules/cjs/loader.js:972:32)
App 1821840 output:     at Function.Module._load (internal/modules/cjs/loader.js:872:14)
App 1821840 output:     at Module.require (internal/modules/cjs/loader.js:1012:19)
App 1821840 output:     at Module.require (/opt/ood/ondemand/root/usr/share/passenger/helper-scripts/node-loader.js:80:25)
App 1821840 output:     at require (internal/modules/cjs/helpers.js:72:18)
App 1821840 output:     at Object.<anonymous> (/var/www/ood/apps/sys/shell/node_modules/node-pty/lib/unixTerminal.js:26:11)
App 1821840 output:     at Module._compile (internal/modules/cjs/loader.js:1123:30)
App 1821840 output:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
App 1821840 output:     at Module.load (internal/modules/cjs/loader.js:972:32)
[ E 2022-05-05 13:10:36.7312 1819743/T13 age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /var/www/ood/apps/sys/shell: The application process exited prematurely.
  Error ID: 30353881
  Error details saved to: /tmp/passenger-error-obbtIB.html

[ E 2022-05-05 13:10:36.7369 1819743/T8 age/Cor/Con/CheckoutSession.cpp:276 ]: [Client 1-3] Cannot checkout session because a spawning error occurred. The identifier of the error is 30353881. Please see earlier logs for details about the error.

Have you tried a rebuild already? I’d make sure to see what node version is being used before the rebuild maybe as well. It seems like something in the environment was not set right and so it was built against the wrong version somehow, which resulted in the wrong version of another node module.

No I did not do anything like a rebuild yet, since this doesn’t make much sense to me. From an old ticket, I checked node (not module) versions like this…

[root@lightshare]# node --version
v13.13.0
[root@lightshare]# /opt/ood/nginx_stage/bin/node --version
v13.13.0
[root@lightshare]#

Would you try a rebuild? :slight_smile:

Thanks.

Yeah I’d say to start try a rebuild because I’m also not sure why that would happen yet.

Does everything else seem to look fine? What happens when you select something like Active Jobs or Job Composer?

Yes, Active Jobs and Job Composer work normally. I am not really familiar with Node, so let me sanity check here to be careful… I should do the following, correct?

npm rebuild node-pty --update-binary

Can you downgrade the node version to v12.9.1 and issue the bin/setup again in the shell to rebuild and see what that results with?

Downgrade using dnf or npm? Sorry, I’m more HPC than Linux so would appreciate the details (commands)!

Thanks.

Where is the bin/setup you need to run after downgrading node? I’m not finding it. See below.

I ran “n 12.9.1” which downgraded /opt/ood/nginx_stage/bin/node, but the issue remains.

[root@lightshare ~]# find /opt/ood -name setup
/opt/ood/ondemand/root/usr/share/gems/2.7/ondemand/2.0.20/gems/beaker-puppet-1.21.0/setup
/opt/ood/ondemand/root/usr/share/gems/2.7/ondemand/2.0.20/gems/bootstrap_form-4.5.0/demo/bin/setup
/opt/ood/ondemand/root/usr/share/gems/2.7/ondemand/2.0.20/gems/mini_mime-1.1.1/bin/setup
/opt/ood/ondemand/root/usr/share/gems/2.7/ondemand/2.0.20/gems/net-telnet-0.1.1/bin/setup
/opt/ood/ondemand/root/usr/share/gems/2.7/ondemand/2.0.20/gems/ood_core-0.17.6/bin/setup
/opt/ood/ondemand/root/usr/share/gems/2.7/ondemand/2.0.20/gems/ood_core-0.18.1/bin/setup
/opt/ood/ondemand/root/usr/share/gems/2.7/ondemand/2.0.20/gems/osc_machete_rails-1.3.1/test/dummy/bin/setup
/opt/ood/ondemand/root/usr/share/gems/2.7/ondemand/2.0.20/gems/pbs-2.2.1/bin/setup
/opt/ood/ondemand/root/usr/share/gems/2.7/ondemand/2.0.20/gems/rails-controller-testing-1.0.5/test/dummy/bin/setup
/opt/ood/ondemand/root/usr/share/gems/2.7/ondemand/2.0.20/gems/rake-13.0.0/bin/setup
[root@lightshare ~]# find /etc/ood -name setup
[root@lightshare ~]#

Sorry for missing the npm question! I was meaning to use nvm for the version change in node.

There should be a script in apps/shell/bin for setup to rebuild the shell app.