Bench update ERROR message: frappe-bench-node-socketio: ERROR (abnormal termination)

@clarkej now I have some logs:

node-socketio.error.log

/home/frappe/frappe-bench/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/index.js:9
const WebSocket = require(‘./lib/WebSocket’);
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Server.init (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/engine.io/lib/server.js:119:16)
at new Server (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/engine.io/lib/server.js:65:8)
at Function.attach (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/engine.io/lib/engine.io.js:123:16)
at /home/frappe/frappe-bench/node_modules/socket.io/lib/index.js:258:23
at Encoder.encode (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/socket.io-parser/index.js:138:5)

/home/frappe/frappe-bench/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/index.js:9
const WebSocket = require(‘./lib/WebSocket’);
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Server.init (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/engine.io/lib/server.js:119:16)
at new Server (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/engine.io/lib/server.js:65:8)
at Function.attach (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/engine.io/lib/engine.io.js:123:16)
at /home/frappe/frappe-bench/node_modules/socket.io/lib/index.js:258:23
at Encoder.encode (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/socket.io-parser/index.js:138:5)

/home/frappe/frappe-bench/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/index.js:9
const WebSocket = require(‘./lib/WebSocket’);
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Server.init (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/engine.io/lib/server.js:119:16)
at new Server (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/engine.io/lib/server.js:65:8)
at Function.attach (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/engine.io/lib/engine.io.js:123:16)
at /home/frappe/frappe-bench/node_modules/socket.io/lib/index.js:258:23
at Encoder.encode (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/socket.io-parser/index.js:138:5)

/home/frappe/frappe-bench/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/index.js:9
const WebSocket = require(‘./lib/WebSocket’);
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Server.init (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/engine.io/lib/server.js:119:16)
at new Server (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/engine.io/lib/server.js:65:8)
at Function.attach (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/engine.io/lib/engine.io.js:123:16)
at /home/frappe/frappe-bench/node_modules/socket.io/lib/index.js:258:23
at Encoder.encode (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/socket.io-parser/index.js:138:5)


redis-socketio.log

[1609] 15 May 07:33:08.581 # Server started, Redis version 2.8.4
[1609] 15 May 07:33:08.581 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
[1609] 15 May 07:33:08.581 * The server is now ready to accept connections on port 12000
[1524] 15 May 07:56:20.133 # Unable to set the max number of files limit to 10032 (Operation not permitted), setting the max clients configuration to 3984.
[1524] 15 May 07:56:20.133 # Warning: 32 bit instance detected but no memory limit set. Setting 3 GB maxmemory limit with ‘noeviction’ policy now.
.
.-__ ''-._ _.- . . ‘’-._ Redis 2.8.4 (00000000/0) 32 bit
.- .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in stand alone mode |`-._`-...-` __...-.-.|'_.-'| Port: 12000 | -. ._ / _.-' | PID: 1524 -._ -._ -./ .-’ .-’
|-._-.
-.__.-' _.-'_.-'| | -.
-._ _.-'_.-' | http://redis.io -._ -._-..-'.-’ .-’
|-._-.
-.__.-' _.-'_.-'| | -.
-._ _.-'_.-' | -._ -._-.
.-‘_.-’ _.-’
-._ -..-’ _.-’
-._ _.-' -.
.-’

[1524] 15 May 07:56:20.134 # Server started, Redis version 2.8.4
[1524] 15 May 07:56:20.134 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
[1524] 15 May 07:56:20.134 * The server is now ready to accept connections on port 12000
[1515] 15 May 09:56:22.890 # Unable to set the max number of files limit to 10032 (Operation not permitted), setting the max clients configuration to 3984.
[1515] 15 May 09:56:22.890 # Warning: 32 bit instance detected but no memory limit set. Setting 3 GB maxmemory limit with ‘noeviction’ policy now.
.
.-__ ''-._ _.- . . ‘’-._ Redis 2.8.4 (00000000/0) 32 bit
.- .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in stand alone mode |`-._`-...-` __...-.-.|'_.-'| Port: 12000 | -. ._ / _.-' | PID: 1515 -._ -._ -./ .-’ .-’
|-._-.
-.__.-' _.-'_.-'| | -.
-._ _.-'_.-' | http://redis.io -._ -._-..-'.-’ .-’
|-._-.
-.__.-' _.-'_.-'| | -.
-._ _.-'_.-' | -._ -._-.
.-‘_.-’ _.-’
-._ -..-’ _.-’
-._ _.-' -.
.-’

[1515] 15 May 09:56:22.890 # Server started, Redis version 2.8.4
[1515] 15 May 09:56:22.890 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
[1515] 15 May 09:56:22.890 * The server is now ready to accept connections on port 12000
[1533] 15 May 21:56:22.742 # Unable to set the max number of files limit to 10032 (Operation not permitted), setting the max clients configuration to 3984.
[1533] 15 May 21:56:22.746 # Warning: 32 bit instance detected but no memory limit set. Setting 3 GB maxmemory limit with ‘noeviction’ policy now.
.
.-__ ''-._ _.- . . ‘’-._ Redis 2.8.4 (00000000/0) 32 bit
.- .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in stand alone mode |`-._`-...-` __...-.-.|'_.-'| Port: 12000 | -. ._ / _.-' | PID: 1533 -._ -._ -./ .-’ .-’
|-._-.
-.__.-' _.-'_.-'| | -.
-._ _.-'_.-' | http://redis.io -._ -._-..-'.-’ .-’
|-._-.
-.__.-' _.-'_.-'| | -.
-._ _.-'_.-' | -._ -._-.
.-‘_.-’ _.-’
-._ -..-’ _.-’
-._ _.-' -.
.-’

[1533] 15 May 21:56:22.746 # Server started, Redis version 2.8.4
[1533] 15 May 21:56:22.746 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
[1533] 15 May 21:56:22.747 * The server is now ready to accept connections on port 12000


node-socketio.log

listening on *: 9000
listening on *: 9000
listening on *: 9000


redis-socketio.error.log

NOTHING

I have exactly the same issue, tried everything but nothing worked :cry:

Finally I found the solution, the issue was that the VM version is shipped with old nodejs version, you need to update nodejs version to work.

curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -

sudo apt-get install -y nodejs
2 Likes

@imobde3 appreciate your help

Will try out soon

Keeping you informed

The nodejs is up to date

Unfortunately the same error as above.

In the mean time it is updated:

Installed Apps ERPNext: v8.0.27 (master)
Frappe Framework: v8.0.44 (master)

This error message exist:
frappe-bench-node-socketio: ERROR (abnormal termination)

Possibly the recent socket.io update switched the js compiler or code generator or parser to strict mode!?

/home/frappe/frappe-bench/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/index.js:9
const WebSocket = require(‘./lib/WebSocket’);
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Server.init (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/engine.io/lib/server.js:119:16)
at new Server (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/engine.io/lib/server.js:65:8)
at Function.attach (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/engine.io/lib/engine.io.js:123:16)
at /home/frappe/frappe-bench/node_modules/socket.io/lib/index.js:258:23
at Encoder.encode (/home/frappe/frappe-bench/node_modules/socket.io/node_modules/socket.io-parser/index.js:138:5)

ok the culprit is on line 7 - I think this is generated rather than static in which case where is the master switch to turn this off!?

frappe@erpnext:~/frappe-bench$ less -N /home/frappe/frappe-bench/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/index.js

@clarkej nice to hear from you again!

What should I do in this case?

Maybe comment out ‘use strict’ then restart the server. If the code compiles without error then problem solved until the experts pronounce otherwise.

To manually compile the code we would need to trace through the server startup scripts…

FWIW ‘npm list’ shows these node modules -

├─┬ socket.io@2.0.1
│ ├─┬ debug@2.6.6
│ │ └── ms@0.7.3
│ ├─┬ engine.io@3.1.0
│ │ ├─┬ accepts@1.3.3
│ │ │ ├─┬ mime-types@2.1.15
│ │ │ │ └── mime-db@1.27.0
│ │ │ └── negotiator@0.6.1
│ │ ├── base64id@1.0.0
│ │ ├─┬ engine.io-parser@2.1.1
│ │ │ ├── after@0.8.2
│ │ │ ├── arraybuffer.slice@0.0.6
│ │ │ ├── base64-arraybuffer@0.1.5
│ │ │ ├── blob@0.0.4
│ │ │ └─┬ has-binary2@1.0.2
│ │ │ └── isarray@2.0.1
│ │ ├── uws@0.14.5
│ │ └─┬ ws@2.3.1
│ │ ├── safe-buffer@5.0.1
│ │ └── ultron@1.1.0
│ ├── object-assign@4.1.1
│ ├─┬ socket.io-adapter@1.1.0
│ │ └─┬ debug@2.3.3
│ │ └── ms@0.7.2
│ ├─┬ socket.io-client@2.0.1
│ │ ├── backo2@1.0.2
│ │ ├── base64-arraybuffer@0.1.5
│ │ ├── component-bind@1.0.0
│ │ ├── component-emitter@1.2.1
│ │ ├─┬ debug@2.6.4
│ │ │ └── ms@0.7.3
│ │ ├─┬ engine.io-client@3.1.0
│ │ │ ├── component-inherit@0.0.3
│ │ │ ├─┬ engine.io-parser@2.1.1
│ │ │ │ ├── after@0.8.2
│ │ │ │ ├── arraybuffer.slice@0.0.6
│ │ │ │ ├── blob@0.0.4
│ │ │ │ └─┬ has-binary2@1.0.2
│ │ │ │ └── isarray@2.0.1
│ │ │ ├─┬ parsejson@0.0.3
│ │ │ │ └─┬ better-assert@1.0.2
│ │ │ │ └── callsite@1.0.0
│ │ │ ├─┬ parseqs@0.0.5
│ │ │ │ └─┬ better-assert@1.0.2
│ │ │ │ └── callsite@1.0.0
│ │ │ ├─┬ ws@2.3.1
│ │ │ │ ├── safe-buffer@5.0.1
│ │ │ │ └── ultron@1.1.0
│ │ │ ├── xmlhttprequest-ssl@1.5.3
│ │ │ └── yeast@0.1.2
│ │ ├── has-cors@1.1.0
│ │ ├── indexof@0.0.1
│ │ ├── object-component@0.0.3
│ │ ├─┬ parseuri@0.0.5
│ │ │ └─┬ better-assert@1.0.2
│ │ │ └── callsite@1.0.0
│ │ └── to-array@0.1.4
│ └─┬ socket.io-parser@3.1.2
│ ├── component-emitter@1.2.1
│ ├── has-binary2@1.0.2
│ └── isarray@2.0.1

@clarkej , as you proposed I take out ‘use strict’

no change…

To make it short, I pulled a new Dev instance.

I made:
sudo apt-get update
sudo apt-get upgrade
cd frappe-bench
bench update --upgrade / supervisor error

bench setup socketio
bench setup supervisor
bench setup nginx
edit: bench setup redis-cache ← if ‘redis-cache’ is not recognized try ‘redis’
sudo service nginx reload
sudo supervisorctl reload

then

sudo bench setup production frappe

then

as @imobde3 suggested

curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -

sudo apt-get install -y nodejs

finally:

bench update woks!!!

Thank you @clarkej , @imobde3

Please close this subject!

6 Likes

If I want to leave it at Development which lines would I need and not need. Any thanks would be appreciated.

Thanks Again.

1 Like

If you do the steps it stay in Dev.

To change between dev or master:
sudo bench switch-to-master
sudo bench switch-to-develop

I meant stay in developer mode. not switch to develop branch

Hey @clarkej - my file structure on Ubuntu looks pretty different from the path you gave. Is that an OSX installation?

Hi tmatteson!

You refer to that ‘npm list’ result above? That is my ‘screen scrape’ copy of the display output from that command (not the file system folder hierarchy) if I grok your question…

I see. I think my problem lies elsewhere.
https://discuss.frappe.io/t/make-random-py-install-error/24586

https://frappe.github.io/frappe/user/en/guides/app-development/how-enable-developer-mode-in-frappe

May this helps for dev mode.

This worked on me with V7.2

Hi all,

I had a similar issue (frappe-bench-node-socketio: ERROR (abnormal termination)) after a vanilla install (Debian 8.7, ERPNExt v10.0) with

$ bench restart
/home/frappe/frappe-bench$ sudo bench restart
INFO:bench.utils:sudo supervisorctl restart frappe-bench-workers: frappe-bench-web:
frappe-bench-frappe-schedule: stopped
frappe-bench-frappe-default-worker-0: stopped
frappe-bench-frappe-long-worker-0: stopped
frappe-bench-frappe-short-worker-0: stopped
frappe-bench-frappe-web: stopped
frappe-bench-frappe-schedule: started
frappe-bench-frappe-default-worker-0: started
frappe-bench-frappe-long-worker-0: started
frappe-bench-frappe-short-worker-0: started
frappe-bench-node-socketio: ERROR (abnormal termination)
frappe-bench-frappe-web: started

The error trace shows (logs/node-socketio.error.log)

$ cat logs/node-socketio.error.log
Error: Cannot find module 'express'
  at Function.Module._resolveFilename (module.js:476:15)
  at Function.Module._load (module.js:424:25)
  at Module.require (module.js:504:17)
  at require (internal/module.js:20:19)
  at Object.<anonymous> (/home/frappe/frappe-bench/apps/frappe/socketio.js:1:91)
  at Module._compile (module.js:577:32)
  at Object.Module._extensions..js (module.js:586:10)
  at Module.load (module.js:494:32)
  at tryModuleLoad (module.js:453:12)
  at Function.Module._load (module.js:445:3)

Trying to resolve it with

$ sudo npm install express
$ sudo npm install socket.io

has resolved the issue… Maybe this helps someone else :wink:

1 Like

For me it didn’t work, for node version 7 & 8 then I updated to 12 and now that’s working for me