Motivations
In order to adress :
The instance is hosted in a virtualisation cluster that have a large bunch of IPV6 but only one IPv4 gateway and some dev cant access IPv6 (bad networks providers ect).
So I read T7097: Following documentation on Aphlict+nginx results in empty client-port for Aphlict wich basically describes the same issue.
@joshuaspence tryed something in D11423: Don't pass `--admin-host` to the Aphlict server but the revision was abandonned.
SO i digged into the code.
What works well
- let notification.client-uri to default value
- start aphlict
- output netstat -tulpn
tcp 0 0 localhost:22280 *:* LISTEN 7317/node tcp 0 0 localhost:22281 *:* LISTEN 7317/node
What doesn't works
- set notification.client-uri to default http://localhost/ws as specified in docs
- start aphlict
- output netstat -tulpn
tcp 0 0 localhost:22281 *:* LISTEN 6685/node
As you can see client is not started
As far as I understand
- ./bin/aphlict start ... call /bin/aphlict that redirect to AphlictLauncher
- call AphlictManagementStartWorklow
- call parent AphlictManagementWorklow
- call getPort
- which refer to libPhutil getPort
- this basically return ''
- this '' will replace default value in Aphlict server
- then listen wont happen since no port
My Fix proposal
Replace
for (var ii = 2; ii < argv.length; ii++) { var arg = argv[ii]; var matches = arg.match(/^--([^=]+)=(.*)$/); if (!matches) { throw new Error('Unknown argument "' + arg + '"!'); } if (!(matches[1] in config)) { throw new Error('Unknown argument "' + matches[1] + '"!'); } config[matches[1]] = matches[2]; }
with :
for (var ii = 2; ii < argv.length; ii++) { var arg = argv[ii]; var matches = arg.match(/^--([^=]+)=(.*)$/); if (!matches) { throw new Error('Unknown argument "' + arg + '"!'); } if (!(matches[1] in config)) { throw new Error('Unknown argument "' + matches[1] + '"!'); } if (matches[2] !== '') { config[matches[1]] = matches[2]; } }
If you guys think its OK let me do a diff !!