Page MenuHomePhabricator

Aphlict server does not respond to http requests on configured ports.
Closed, ResolvedPublic

Description

I upgraded my phabricator install last night and after the upgrade finished phabricator reported a setup issue that it couldn't contact the aphlict server.

I verified:

  1. The aphlict server was started and could be restarted, without any affect to the service.
  2. The log file (/var/log/aphlict.log) is owned by 'apache' user which runs the aphlict service.
  3. The log file's last log line indicates that it started the service around the time I upgraded, but no other activity in the log file even after restarting the service multiple times.

Relevant part of update script:

# If running the notification server, start it.
sudo -u apache $ROOT/phabricator/bin/aphlict start

Probing around

[cspeck@machine ~]$ ls -al /var/log/aphlict.log
-rw-r--r--. 1 apache apache 66234 Jan 18 12:23 /var/log/aphlict.log
[cspeck@machine ~]$ tail /var/log/aphlict.log 
...
[Sun Jan 18 2015 12:23:23 GMT-0500 (EST)] Started Server (PID 63146)
[cspeck@machine ~]$ ps aux | grep aphlict
apache   52523  0.3  0.2 325196 22220 pts/0    S    11:45   0:07 php /var/www/phabricator/phabricator/bin/aphlict start
[cspeck@machine ~]$ /var/www/phabricator/phabricator/bin/aphlict status
Aphlict (52523) is running.
[cspeck@machine ~]$ curl http://localhost:22281
curl: (7) couldn't connect to host
[cspeck@machine ~]$ curl http://localhost:22280
curl: (7) couldn't connect to host

Revisions and Commits

Event Timeline

cspeckmim raised the priority of this task from to Needs Triage.
cspeckmim updated the task description. (Show Details)
cspeckmim added a project: Aphlict.
cspeckmim added a subscriber: cspeckmim.

Two issues here:

  • D11426 fixes us not writing fatal errors to the log properly.
  • D11425 fixes the actual issue.

You can likely identify the error with bin/aphlict debug, which will print it to the console. My guess is that it will be require('ws') bork bork bork or similar. D11425 will fix the error; D11426 will get it into the log (in addition to bin/aphlict debug).

I forgot about the debug start of service. To confirm your suspicions @epriestley:

[cspeck@machine ~]$ sudo -u apache /var/www/phabricator/phabricator/bin/aphlict debug
Starting Aphlict server in foreground...
Launching server:

    $ 'node' '/var/www/phabricator/phabricator/support/aphlict/server/aphlict_server.js' '--client-port=22280' '--admin-port=22281' '--admin-host=localhost' '--log=/var/log/aphlict.log'

[Mon Jan 19 2015 14:21:07 GMT-0500 (EST)] 
<<< UNCAUGHT EXCEPTION! >>>

Error: Cannot find module 'ws'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at extra.require (/var/www/phabricator/phabricator/webroot/rsrc/externals/javelin/core/init_node.js:48:16)
    at /var/www/phabricator/phabricator/support/aphlict/server/lib/AphlictClientServer.js:7:17
    at Script.(anonymous function) [as runInNewContext] (vm.js:41:22)
    at Object.JX.require (/var/www/phabricator/phabricator/webroot/rsrc/externals/javelin/core/init_node.js:58:6)
    at Object.<anonymous> (/var/www/phabricator/phabricator/support/aphlict/server/aphlict_server.js:100:4)
    at Module._compile (module.js:456:26)
>>> Server exited!

Also from the logs:

bork.jpg (360×550 px, 49 KB)

(sorry but I found the 'bork bork bork' quite amusing)

Both of the linked fixes landed, so this should now be fixed in HEAD. Thanks for the report!