Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WS/ASGI “no route found for path” #221

Open
secsonthebeach opened this issue Oct 9, 2024 · 9 comments · May be fixed by #222
Open

WS/ASGI “no route found for path” #221

secsonthebeach opened this issue Oct 9, 2024 · 9 comments · May be fixed by #222
Labels
bug Something isn't working EMBArk

Comments

@secsonthebeach
Copy link

Hello,

The websocket connection seems to be broken. I keep seeing the error mentioned above.

I notice that embark/embark/routing.py mentions being the equivalent of urls.py but it is not the same.

embark/embark/urls.py shows the inclusion of embark/reporter/urls.py which then contains the variable EMBA_LOG_URL containing the proper file location. Is this missing from ASGI?

I cannot otherwise seem to find where the file location is being passed to Daphne when executing run-server.sh.

Please let me know what you think.

@BenediktMKuehne
Copy link
Member

Sorry I only saw this now.

I recognize this from some issues with the contents of the log-directory
If you find some content you can not access while clicking through the html report, you could mark the request here and I'll try and adjust the routing

@BenediktMKuehne BenediktMKuehne added bug Something isn't working EMBArk labels Oct 21, 2024
@secsonthebeach
Copy link
Author

secsonthebeach commented Oct 22, 2024

I have not had trouble viewing the HTML report by going to the “Reports” and selecting it from the drop down menu. Similarly, I can view the “raw log”.

The problem I am seeing is with the websockets (I think). I can’t be sure, because this is all my first time with Embark, but I think the expected behavior is a live stream of /ws/progress from the “Progress” UI tab, or a live stream of the logging data /ws/logs/<id> from the “Reports -> View Log” UI.

In my case, every call to a websocket returns an error message of “No route found for path”.

I think my initial question may have misguided, but I do think the issue lies within Daphne and the application passed to it, and the ASGI stuff.

Also, I removed and reinstalled yesterday, just to ensure that I hadn’t made some change that introduced the error.

Below is the error output observed from run-server.sh when a websocket connection is attempted:

2024-10-22 15:36:56,106 ERROR Exception inside application: No route found for path '/ws/progress/'.
Traceback (most recent call last):
  File "/var/www/.venv/lib/python3.10/site-packages/channels/routing.py", line 62, in __call__
    return await application(scope, receive, send)
  File "/var/www/.venv/lib/python3.10/site-packages/channels/sessions.py", line 47, in __call__
    return await self.inner(dict(scope, cookies=cookies), receive, send)
  File "/var/www/.venv/lib/python3.10/site-packages/channels/sessions.py", line 263, in __call__
    return await self.inner(wrapper.scope, receive, wrapper.send)
  File "/var/www/.venv/lib/python3.10/site-packages/channels/auth.py", line 185, in __call__
    return await super().__call__(scope, receive, send)
  File "/var/www/.venv/lib/python3.10/site-packages/channels/middleware.py", line 24, in __call__
    return await self.inner(scope, receive, send)
  File "/var/www/.venv/lib/python3.10/site-packages/channels/routing.py", line 116, in __call__
    raise ValueError("No route found for path %r." % path)
ValueError: No route found for path '/ws/progress/'.
2024-10-22 15:37:56,182 ERROR Exception inside application: No route found for path '/ws/logs/63d76550-96e4-4f77-83e0-6c3e4c352dba'.
Traceback (most recent call last):
  File "/var/www/.venv/lib/python3.10/site-packages/channels/routing.py", line 62, in __call__
    return await application(scope, receive, send)
  File "/var/www/.venv/lib/python3.10/site-packages/channels/sessions.py", line 47, in __call__
    return await self.inner(dict(scope, cookies=cookies), receive, send)
  File "/var/www/.venv/lib/python3.10/site-packages/channels/sessions.py", line 263, in __call__
    return await self.inner(wrapper.scope, receive, wrapper.send)
  File "/var/www/.venv/lib/python3.10/site-packages/channels/auth.py", line 185, in __call__
    return await super().__call__(scope, receive, send)
  File "/var/www/.venv/lib/python3.10/site-packages/channels/middleware.py", line 24, in __call__
    return await self.inner(scope, receive, send)
  File "/var/www/.venv/lib/python3.10/site-packages/channels/routing.py", line 116, in __call__
    raise ValueError("No route found for path %r." % path)
ValueError: No route found for path '/ws/logs/63d76550-96e4-4f77-83e0-6c3e4c352dba'.

@BenediktMKuehne
Copy link
Member

So far I haven't been able to reproduce the issue on my machines.

Can you give me more info?
installation log / server logs

@secsonthebeach
Copy link
Author

Hello. ‘Unable to reproduce’ makes me hopeful that it’s just something on my end. I have a network proxy to contend with too.
Below are a couple of screenshots from relevant logs that I could find. I could not find an installation log. Do I need to run the installer again and tee it to a file?

  • This one is from /var/www/logs/daphne.log
    var-www-logs-daphne-log

  • This one is from /var/www/embark/embark.log
    var-www-embark-embark-log

@secsonthebeach
Copy link
Author

Hello, I decided to uninstall and then reinstall. Everything seems to run smoothly, but I still encounter errors for the websockets. I exported the output for the install and run_server to rich text, but had to convert to pdf to upload. Please let me know what you think.

embark-run-server-log.pdf
embark-install-log.pdf

@BenediktMKuehne
Copy link
Member

Those two logs look normal - no installation errors.
Maybe the pipenv installation failed somewhere the first time 🤔

Are there still routing errors with the websockets?

@secsonthebeach
Copy link
Author

secsonthebeach commented Nov 17, 2024

Yes, the re-install doesn’t seem to make any difference.
I’ll do some digging for Pipenv logs.
Do you have a suggestion of where & what to look for?

Just poking around /var/www/.venv and it looks like things are installed, but I didn’t check line-by-line.

The overall web app works as expected. I am running a small firmware analysis now, just to have some data in there.

My particular setup does have some firewalling in front of it, which had me wondering if that could be the problem. So I have been testing on the local host with a tool called “websocat”.

From the same host, running websocat ws://embark.local:8001/ws/progress/ returns a “500 Internal Server Error”, and I see the same stderr output from run_server.sh as I do when navigating to the “Progress” tab in a browser.

I get the same thing when using “localhost” instead of “embark.local”, and when trying the web socket client tool against the “/ws/logs/” URL path.

I also just ran pip list from the activated Pipenv. All the default packages show as installed and the versions match the Pipfile.lock from the Embark repo. I do not have the packages listed under ‘develop’ section of Pipfile.lock

@BenediktMKuehne
Copy link
Member

We are seeing the same behavior on a fresh installation.
Will try and fix it in the next PR

@BenediktMKuehne BenediktMKuehne linked a pull request Nov 20, 2024 that will close this issue
@BenediktMKuehne
Copy link
Member

my tests indicate some change within the daphne application
#222 should fix the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working EMBArk
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants