Cannot restart aphlict

Hi, I’ve just updated and move phabricator instance into new server. But when I start aphlict it produce an error:

> ./phabricator/bin/aphlict restart
> Reading configuration from: phabricator/conf/aphlict/aphlict.default.json
> Aphlict is not running.
> [2019-10-25 14:42:32] EXCEPTION: (CommandException) Command failed with error #1!
> COMMAND
> nodejs '--max-old-space-size=256' -- '/var/www/html/phabricator/support/aphlict/server/aphlict_server.js' '--config=/var/www/html/phabricator/conf/aphlict/aphlict.default.json' '--test=true'
> 
> STDOUT
> [10/25/2019, 7:42:32 AM]
> <<< UNCAUGHT EXCEPTION! >>>
> 
> Error: You need to install the Node.js "ws" module for websocket support. See "Notifications User Guide: Setup and Configuration" in the documentation for instructions. SyntaxError: Unexpected token ...
>     at Object.<anonymous> (/var/www/html/phabricator/support/aphlict/server/aphlict_server.js:73:9)
>     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)
>     at Module.runMain (module.js:611:10)
>     at run (bootstrap_node.js:394:7)
>     at startup (bootstrap_node.js:160:9)
>     at bootstrap_node.js:507:3
> 
> 
> STDERR
> (empty) at [<phutil>/src/future/exec/ExecFuture.php:380]
> arcanist(head=master, ref.master=da6d4f85eefb), phabricator(head=master, ref.master=38694578e1d0), phutil(head=master, ref.master=39ed96cd818a)
>   #0 ExecFuture::resolvex() called at [<phutil>/src/future/exec/execx.php:17]
>   #1 execx(string, PhutilCommandString) called at [<phabricator>/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php:378]
>   #2 PhabricatorAphlictManagementWorkflow::willLaunch() called at [<phabricator>/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php:443]
>   #3 PhabricatorAphlictManagementWorkflow::executeStartCommand() called at [<phabricator>/src/applications/aphlict/management/PhabricatorAphlictManagementRestartWorkflow.php:21]
>   #4 PhabricatorAphlictManagementRestartWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:457]
>   #5 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:349]
>   #6 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/support/aphlict/server/aphlict_launcher.php:23]
> Version:
> phabricator   38694578e1d0c416e992a0fa95edbc270c8af5e8 (Fri, Oct 25)
> arcanist        da6d4f85eefb0ae9c945e41659b678549fbb8c8a (Thu, Oct 17)
> phutil            39ed96cd818aae761ec92613a9ba0800824d0ab0 (Mon, Sep 30)
> /var/www/html/phabricator/support/aphlict/server# node -v
> v6.17.1
> /var/www/html/phabricator/support/aphlict/server# cat package.json
> {
>   "name": "server",
>   "version": "1.0.0",
>   "main": "aphlict_server.js",
>   "scripts": {
>     "test": "echo \"Error: no test specified\" && exit 1"
>   },
>   "keywords": [],
>   "author": "",
>   "license": "ISC",
>   "dependencies": {
>     "ws": "^7.2.0"
>   },
>   "devDependencies": {},
>   "description": ""
> }

Please enlighten me.
Thanks :slight_smile:

Did you notice the part in the error where it says:

You need to install the Node.js “ws” module for websocket support. See “Notifications User Guide: Setup and Configuration” in the documentation for instructions.

?

I did, but when I install it by following the user guide, it seem not installed.

> root@07219a09150f:/var/www/html/phabricator/support/aphlict/server# npm init -y
> Wrote to /var/www/html/phabricator/support/aphlict/server/package.json:
> 
> {
>   "name": "server",
>   "version": "1.0.0",
>   "description": "",
>   "main": "aphlict_server.js",
>   "dependencies": {
>     "ws": "^7.2.0"
>   },
>   "devDependencies": {},
>   "scripts": {
>     "test": "echo \"Error: no test specified\" && exit 1"
>   },
>   "keywords": [],
>   "author": "",
>   "license": "ISC"
> }
> 
> 
> root@07219a09150f:/var/www/html/phabricator/support/aphlict/server# npm install ws
> server@1.0.0 /var/www/html/phabricator/support/aphlict/server
> `-- ws@7.2.0
> 
> npm WARN server@1.0.0 No description
> npm WARN server@1.0.0 No repository field.
>
> root@07219a09150f:/var/www/html/phabricator/support/aphlict/server# cd /var/www/html/phabricator/
>
> root@07219a09150f:/var/www/html/phabricator# bin/aphlict start
> Reading configuration from: phabricator/conf/aphlict/aphlict.default.json
> Usage Exception: The notification server should not be run as root.
>
> root@07219a09150f:/var/www/html/phabricator# su me
>
> $ bin/aphlict start
> Reading configuration from: phabricator/conf/aphlict/aphlict.default.json
> [2019-10-26 09:30:49] EXCEPTION: (CommandException) Command failed with error #1!
> COMMAND
> nodejs '--max-old-space-size=256' -- '/var/www/html/phabricator/support/aphlict/server/aphlict_server.js' '--config=/var/www/html/phabricator/conf/aphlict/aphlict.default.json' '--test=true'
> 
> STDOUT
> [10/26/2019, 2:30:49 AM]
> <<< UNCAUGHT EXCEPTION! >>>
> 
> Error: You need to install the Node.js "ws" module for websocket support. See "Notifications User Guide: Setup and Configuration" in the documentation for instructions. SyntaxError: Unexpected token ...
>     at Object.<anonymous> (/var/www/html/phabricator/support/aphlict/server/aphlict_server.js:73:9)
>     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)
>     at Module.runMain (module.js:611:10)
>     at run (bootstrap_node.js:394:7)
>     at startup (bootstrap_node.js:160:9)
>     at bootstrap_node.js:507:3
> 
> 
> STDERR
> (empty) at [<phutil>/src/future/exec/ExecFuture.php:380]
> arcanist(head=master, ref.master=da6d4f85eefb), phabricator(head=master, ref.master=38694578e1d0), phutil(head=master, ref.master=39ed96cd818a)
>   #0 ExecFuture::resolvex() called at [<phutil>/src/future/exec/execx.php:17]
>   #1 execx(string, PhutilCommandString) called at [<phabricator>/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php:378]
>   #2 PhabricatorAphlictManagementWorkflow::willLaunch() called at [<phabricator>/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php:443]
>   #3 PhabricatorAphlictManagementWorkflow::executeStartCommand() called at [<phabricator>/src/applications/aphlict/management/PhabricatorAphlictManagementStartWorkflow.php:15]
>   #4 PhabricatorAphlictManagementStartWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:457]
>   #5 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:349]
>   #6 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/support/aphlict/server/aphlict_launcher.php:23]

Any suggestion what I should do next?

Resolved by upgrading nodejs from version 6.x to 11.x
Sorry for the noice :slight_smile: