Aphlict fails to start. Node cmd error


#1

Versions:
OS: CentOS7
node: 11.1.0
ws: 6.1.0

I’ve installed phabricator and have it operating under https on my internal company network. I should have full access to all ports and I’ve kept the installation completely vanilla, no mods. This server was setup purely for the purpose of installing Phabricator so everything is a completely fresh install. After using Conpherence and realizing the notification server wasn’t working, I tried to follow the documentation here but keep running into a node command issue. I’ve installed nodejs and went into the aphlict directory pointed out in the docs and installed ws. When i try to start the aphlict server i get the following error:

$ ./bin/aphlict start
Reading configuration from: phabricator/conf/aphlict/aphlict.custom.json
[2018-11-06 14:44:24] EXCEPTION: (CommandException) Command failed with error #1!
COMMAND
node ‘–max-old-space-size=256’ – ‘/var/www/html/phabricator/support/aphlict/server/aphlict_server.js’ ‘–config=/var/www/html/phabricator/conf/aphlict/aphlict.custom.json’ ‘–test=true’

STDOUT
(empty)

STDERR
vm.js:167
throw new ERR_INVALID_ARG_TYPE(‘options’, ‘Object’, options);
^

TypeError [ERR_INVALID_ARG_TYPE]: The “options” argument must be of type Object. Received type string
at getRunInContextArgs (vm.js:167:11)
at Script.runInContext (vm.js:125:37)
at Script.runInNewContext (vm.js:136:17)
at Object.JX.require (/var/www/html/phabricator/webroot/rsrc/externals/javelin/core/init_node.js:52:6)
at Object. (/var/www/html/phabricator/support/aphlict/server/lib/javelin.js:4:4)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
at Function.Module._load (internal/modules/cjs/loader.js:536:3)
at [/src/future/exec/ExecFuture.php:369]
arcanist(head=master, ref.master=83661809e532), phabricator(head=master, ref.master=c206b066df38), phutil(head=master, ref.master=cf96fd681e7d)
#0 ExecFuture::resolvex() called at [/src/future/exec/execx.php:17]
#1 execx(string, PhutilCommandString) called at [/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php:378]
#2 PhabricatorAphlictManagementWorkflow::willLaunch() called at [/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php:443]
#3 PhabricatorAphlictManagementWorkflow::executeStartCommand() called at [/src/applications/aphlict/management/PhabricatorAphlictManagementStartWorkflow.php:15]
#4 PhabricatorAphlictManagementStartWorkflow::execute(PhutilArgumentParser) called at [/src/parser/argument/PhutilArgumentParser.php:457]
#5 PhutilArgumentParser::parseWorkflowsFull(array) called at [/src/parser/argument/PhutilArgumentParser.php:349]
#6 PhutilArgumentParser::parseWorkflows(array) called at [/support/aphlict/server/aphlict_launcher.php:23]

my aphlict.custom.json file is basically the default but with ssl keys added. I’ve tried admin with and without ssl keys but the result is the same since it probably isn’t even looking at this file yet:

$ cat aphlict.custom.json
{
“servers”: [
{
“type”: “client”,
“port”: 22280,
“listen”: “0.0.0.0”,
“ssl.key”: “/etc/ssl/private/phabricator.key”,
“ssl.cert”: “/etc/ssl/certs/phabricator.crt”,
“ssl.chain”: null
},
{
“type”: “admin”,
“port”: 22281,
“listen”: “127.0.0.1”,
“ssl.key”: “/etc/ssl/private/phabricator.key”,
“ssl.cert”: “/etc/ssl/certs/phabricator.crt”,
“ssl.chain”: null
}
],
“logs”: [
{
“path”: “/var/log/aphlict.log”
}
],
“pidfile”: “/var/tmp/aphlict/pid/aphlict.pid”
}

I can’t figure out why the following node command is failing preventing aphlict to start.

node ‘–max-old-space-size=256’ – ‘/var/www/html/phabricator/support/aphlict/server/aphlict_server.js’ ‘–config=/var/www/html/phabricator/conf/aphlict/aphlict.custom.json’ ‘–test=true’

Nothing gets logged since it can’t get past the init portion. I’ve tried node 10.x and have the same issue.


Aphlict server will not start in nodejs 10
#2

Hi,

I recently had this similar problem with Aphlict server. I searched, and someone else had a similar problem as well. Luckily, this person also provided a solution that worked for their instance, and also worked for me as well.

@enckse solution to nodejs 10 and aphlict server - link to thread


#3

I’ve seen that thread and I didn’t understand how they patched javelin. Can you explain the process?


#4

Sure.

I changed directory to

<my phabricator's instance>/webroot/rsrc/externals/javelin/core

I edited the file:

init_node.js

and replaced these two lines (at the end):

vm.createScript(content, path)
  .runInNewContext(sandbox, path);

with:

vm.runInNewContext(content, sandbox, path);

and finally saved the file and successfully started the aphlict server.


#5

That really brings that other post into context. I’m now having permission errors but that’s something I understand how to fix. Thank You!