Error launching Shell in 4.0.3

I’m getting an error trying to launch the Shell in 4.0.3. I checked the PUN error log and I am showing the below error.

App 3709 output: innerError Error: Cannot find module '../build/Debug/pty.node'
App 3709 output: Require stack:
App 3709 output: - /var/www/ood/apps/sys/shell/node_modules/node-pty/lib/unixTerminal.js
App 3709 output: - /var/www/ood/apps/sys/shell/node_modules/node-pty/lib/index.js
App 3709 output: - /var/www/ood/apps/sys/shell/app.js
App 3709 output: - /opt/ood/ondemand/root/usr/share/passenger/helper-scripts/node-loader.js
App 3709 output:     at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)
App 3709 output:     at Module._load (node:internal/modules/cjs/loader:1043:27)
App 3709 output:     at Module.require (node:internal/modules/cjs/loader:1298:19)
App 3709 output:     at Module.require (/opt/ood/ondemand/root/usr/share/passenger/helper-scripts/node-loader.js:80:25)
App 3709 output:     at require (node:internal/modules/helpers:182:18)
App 3709 output:     at Object.<anonymous> (/var/www/ood/apps/sys/shell/node_modules/node-pty/lib/unixTerminal.js:34:15)
App 3709 output:     at Module._compile (node:internal/modules/cjs/loader:1529:14)
App 3709 output:     at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
App 3709 output:     at Module.load (node:internal/modules/cjs/loader:1275:32)
App 3709 output:     at Module._load (node:internal/modules/cjs/loader:1096:12) {
App 3709 output:   code: 'MODULE_NOT_FOUND',
App 3709 output:   requireStack: [
App 3709 output:     '/var/www/ood/apps/sys/shell/node_modules/node-pty/lib/unixTerminal.js',
App 3709 output:     '/var/www/ood/apps/sys/shell/node_modules/node-pty/lib/index.js',
App 3709 output:     '/var/www/ood/apps/sys/shell/app.js',
App 3709 output:     '/opt/ood/ondemand/root/usr/share/passenger/helper-scripts/node-loader.js'
App 3709 output:   ]
App 3709 output: }
App 3709 output: /var/www/ood/apps/sys/shell/node_modules/node-pty/lib/unixTerminal.js:40
App 3709 output:         throw outerError;
App 3709 output:         ^
App 3709 output:
App 3709 output: Error: /var/www/ood/apps/sys/shell/node_modules/node-pty/build/Release/pty.node: undefined symbol: _ZN2v88internal20CanHaveInternalFieldEi
App 3709 output:     at Module._extensions..node (node:internal/modules/cjs/loader:1651:18)
App 3709 output:     at Module.load (node:internal/modules/cjs/loader:1275:32)
App 3709 output:     at Module._load (node:internal/modules/cjs/loader:1096:12)
App 3709 output:     at Module.require (node:internal/modules/cjs/loader:1298:19)
App 3709 output:     at Module.require (/opt/ood/ondemand/root/usr/share/passenger/helper-scripts/node-loader.js:80:25)
App 3709 output:     at require (node:internal/modules/helpers:182:18)
App 3709 output:     at Object.<anonymous> (/var/www/ood/apps/sys/shell/node_modules/node-pty/lib/unixTerminal.js:29:11)
App 3709 output:     at Module._compile (node:internal/modules/cjs/loader:1529:14)
App 3709 output:     at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
App 3709 output:     at Module.load (node:internal/modules/cjs/loader:1275:32) {
App 3709 output:   code: 'ERR_DLOPEN_FAILED'
App 3709 output: }
App 3709 output:
App 3709 output: Node.js v20.19.1
[ E 2025-05-19 18:51:21.8464 3151/Tq 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: 7ef372cb
  Error details saved to: /tmp/passenger-error-8io1SD.html

[ E 2025-05-19 18:51:21.8495 3151/Tb age/Cor/Con/CheckoutSession.cpp:282 ]: [Client 2-5] Cannot checkout session because a spawning error occurred. The identifier of the error is 7ef372cb. Please see earlier logs for details about the error.

Seems like an issue with the libraries we’re linking too. What does this ldd command show on that same pty.node binary?

[johrstrom ~()] 🐷  ldd /var/www/ood/apps/sys/shell/node_modules/node-pty/build/Release/pty.node
        linux-vdso.so.1 (0x00007ffe1cbd5000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007efca2c00000)
        libm.so.6 => /lib64/libm.so.6 (0x00007efca2b25000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007efca2e73000)
        libc.so.6 => /lib64/libc.so.6 (0x00007efca2800000)
        /lib64/ld-linux-x86-64.so.2 (0x00007efca2ea1000)

And htere’s other various information from my RHEL9 system.

[johrstrom ~()] 🐨  which node
/usr/bin/node
[johrstrom ~()] 🐬  node --version
v20.18.2
[johrstrom ~()] 🐧  ldd --version
ldd (GNU libc) 2.34

Here’s my output. I’m running AL2023

[root@ip-10-0-3-148 Admin]# ldd /var/www/ood/apps/sys/shell/node_modules/node-pty/build/Release/pty.node
        linux-vdso.so.1 (0x00007fffc3dd7000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fd7d8600000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fd7d8a35000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fd7d8200000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fd7d895a000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fd7d8a75000)
[root@ip-10-0-3-148 Admin]# which node
/usr/bin/node
[root@ip-10-0-3-148 Admin]# node --version
v20.19.1
[root@ip-10-0-3-148 Admin]# ldd --version
ldd (GNU libc) 2.34
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

Maybe it’s a nodejs version error? Looking at the 4.0.3 build logs for AL2023, I see we installed these packages and built against them.

 nodejs                         x86_64  1:18.20.6-1.amzn2023.0.1          amazonlinux    13 M
 nodejs-libs                    x86_64  1:18.20.6-1.amzn2023.0.1          amazonlinux    14 M
``

I’ll try another fresh install and see if I run into this. Should I try downgrading nodejs to 20.18.2?

Yes I think so, down to 1.18.20 by the looks of it.

I believe the error is related to a Node.js module compatibility issue with the shell app in Open OnDemand. The node-pty module needs to be rebuilt for the current Node.js version. Here’s how i fixed it:

# Install development tools needed for rebuilding Node modules
sudo dnf install gcc-c++ make nodejs-devel -y

# Navigate to the shell app directory
cd /var/www/ood/apps/sys/shell

# Rebuild the node-pty module
sudo npm rebuild node-pty

# Restart Apache to apply changes
sudo systemctl restart httpd

This solution worked, thank you!