exodus4d / pathfinder_websocket

WebSockets extension for Pathfinder
https://www.pathfinder-w.space
6 stars 13 forks source link

Socket connection test fails. #3

Open jrtashjian opened 7 years ago

jrtashjian commented 7 years ago

I'm running into an issue with the testWebSocket failing on the /setup route.

Here's the output of php cmd.php

2017-02-15 05:27:15 Server START ------------------------------------------
PHP Notice:  Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408

Notice: Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408
PHP Notice:  Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409

Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409
PHP Notice:  Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412

Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412
PHP Notice:  Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408

Notice: Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408
PHP Notice:  Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409

Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409
PHP Notice:  Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412

Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412
PHP Notice:  Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408

Notice: Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408
PHP Notice:  Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409

Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409
PHP Notice:  Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412

Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412
PHP Notice:  Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408

Notice: Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408
PHP Notice:  Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409

Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409
PHP Notice:  Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412

Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412
PHP Notice:  Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408

Notice: Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408
PHP Notice:  Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409

Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409
PHP Notice:  Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412

Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412

It seems to be failing somewhere around here: https://github.com/exodus4d/pathfinder/blob/master/public/js/v1.2.0/app/setup.js#L4222

I added a var_dump( $data ) at app/Main/MapUpdate.php on line 407 to see what was happening during the test. It returned the first healthCheck task and proper data but afterwards it looked like it was sending some blank data causing it to fail.

I haven't been able to dive into it too much but wanted to reported in case anyone had ideas.

exodus4d commented 7 years ago

You have updated your Pathfinder installation to 1.2.0I guess? Could you run Composer install in the base dir of Pathfinder as well? It should install the ZMQ plugin, if you haven´t done yet.

jrtashjian commented 7 years ago

I might have forgot to run composer install in my Pathfinder installation but even after doing so I'm seeing the same errors. I'm running off the Master branch of each repo, PHP 7.0 and the ZMQ extension is installed.

I don't think the issue is with the actual socket connection as much as the data being sent back and forth between them.

yozik04 commented 7 years ago

Test fails for me as well. Tells "Invalid response"

I did not updated anything. I am doing first installation.


Request Method:GET
Status Code:101 Switching Protocols
Response Headers
view source
Connection:upgrade
Date:Thu, 10 Aug 2017 19:47:58 GMT
Sec-WebSocket-Accept:Ri5fZ3tgOqqqGzCHSG9v8XzvR2E=
Server:nginx
Upgrade:websocket
X-Powered-By:Ratchet/0.3.6
Request Headers
view source
Accept-Encoding:gzip, deflate
Accept-Language:en
Cache-Control:no-cache
Connection:Upgrade
Cookie:cookie=1; char_360260ef83164353acf14bb6b23fd37=b49971a2df65773d763b5d2%3A3951d156d3982afecee6d1463ba39bda; pathfinder_session=i2g1vgnh3opb04568mehvvte0
Host:10.0.4.45
Origin:http://10.0.4.45
Pragma:no-cache
Sec-WebSocket-Extensions:permessage-deflate; client_max_window_bits
Sec-WebSocket-Key:7WflobQwDtFZQ5zDbKthrw==
Sec-WebSocket-Version:13
Upgrade:websocket
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36```

I do not see anything suspicious in request/response.
yozik04 commented 7 years ago

In my case pathfinder_websocket does not receive any TCP commands from setup.php request.

But var_dump((new Socket( Config::getSocketUri(), $ttl ))->sendData('healthCheck', $load)) returns 'OK'. Requests from browser also work fine.