spatie / ray

Debug with Ray to fix problems faster
https://myray.app
MIT License
574 stars 102 forks source link

Ray not receiving events anymore #559

Closed io238 closed 3 years ago

io238 commented 3 years ago

Describe the bug Ray does not receive any events anymore. It used to work in the past, but has stopped working now. I don't recall making any changes to the setup/environment.

Versions

PHP version: 8.0.10 Laravel version: 8.61.0

To Reproduce Steps to reproduce the behavior:

  1. Open tinker
  2. Send test via ray('Hello World');

Expected behavior Test string should appear in Ray.

Screenshots No output received by Ray image

Output by RayProxy https://github.com/permafrost-dev/ray-proxy

{"level":30,"time":1631702904516,"pid":580,"hostname":"152784d7f7e8","reqId":"req-5","res":{"statusCode":404},"responseTime":259.6536000003107,"msg":"request completed"}
{"level":30,"time":1631702904519,"pid":580,"hostname":"152784d7f7e8","reqId":"req-6","req":{"method":"POST","url":"/","hostname":"localhost:23517","remoteAddress":"127.0.0.1","remotePort":33790},"msg":"incoming request"}
{"level":50,"time":1631702904520,"pid":580,"hostname":"152784d7f7e8","reqId":"req-6","req":{"method":"POST","url":"/","hostname":"localhost:23517","remoteAddress":"127.0.0.1","remotePort":33790},"res":{"statusCode":500},"err":{"message":"connect ECONNREFUSED 127.0.0.1:23516","stack":"Error: connect ECONNREFUSED 127.0.0.1:23516\n    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1146:16)","config":{"url":"http://localhost:23516","method":"post","data":"{\"uuid\":\"3f791b93-3e49-4e36-813c-17c719c4bbf1\",\"payloads\":[{\"type\":\"log\",\"content\":{\"values\":[\"Hello world\"]},\"origin\":{\"file\":\"/var/www/html/vendor/psy/psysh/src/ExecutionLoopClosure.php(55) : eval()'d code\",\"line_number\":1,\"hostname\":\"152784d7f7e8\"}}],\"meta\":{\"php_version\":\"8.0.10\",\"php_version_id\":80010,\"laravel_version\":\"8.61.0\",\"laravel_ray_package_version\":\"1.25.2.0\",\"ray_package_version\":\"1.30.2.0\"}}","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/0.21.4","Content-Length":410},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false}},"code":"ECONNREFUSED"},"msg":"connect ECONNREFUSED 127.0.0.1:23516"}
{"level":30,"time":1631702904521,"pid":580,"hostname":"152784d7f7e8","reqId":"req-6","res":{"statusCode":500},"responseTime":1.8287999997846782,"msg":"request completed"}

Desktop:

io238 commented 3 years ago

image

hypnotox commented 3 years ago

I have the same problem since i tried to use it a few days ago. No changes to the setup. It has worked without any problems before.

Version: 1.17.0 OS: macOS 11.4

I tried it with spatie/ray and spatie/laravel-ray. Port 23517 is assigned to the process and listening.

AdrianMrn commented 3 years ago

There haven't been any changes to the way logs are sent or received in quite a while. Could you please try uninstalling the app and reinstalling it, and trying to send messages in a new, clean Laravel app?

io238 commented 3 years ago

I reinstalled the app + also reinstalled Ray into a fresh Laravel app. Still did not work for any project within Docker, nevertheless, I was able to send messages directly from Windows (w/o using Docker).

I was able to get it working again by publishing a fresh version of the docker config into the project root with php artisan ray:publish-config --docker.

Other than stated in the docs, Ray does not seem to be picking up the ray.php, if it's stored in a parent directory.

AdrianMrn commented 3 years ago

@freekmurze is this something we need to push a fix for?

freekmurze commented 3 years ago

We'll need to see if we can reproduce this. I think we already have a couple of tests that prove that ray.php is getting picked up a parent directory.

I'll take a look soon.

ryanmortier commented 3 years ago

I just installed Ray for the first time today with Windows and WSL2. I followed the WSL2 instructions in the docs and I'm now wondering if this is related to this issue.

I've set a static IP for my windows host and have the IP set in my .env file with the RAY_HOST variable.

image

Inside WSL2 I'm able to connect to ray:

➜  export git:(develop) ✗ telnet 10.0.0.100 23517
Trying 10.0.0.100...
Connected to 10.0.0.100.
Escape character is '^]'.

However, when I try to run ray('test'), nothing appears.

@io238 did you ever get resolution?

edit: I know it's not my WSL setup because the app HELO from Beyondcode works the same way and it's working for me using my static IP.

ryanmortier commented 3 years ago

@AdrianMrn can this be reopened?

AdrianMrn commented 3 years ago

Hi @ryanmortier, could you please open a new issue with the information from your above comment? We like to keep these kind of issues separate, in case they're not entirely related to the same cause. This way, you'll also fill out the issue template, and we get more information to help us debug this problem.

Feel free to refer to this issue when creating yours.