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

Crashes from missing pip modules only return a 404 #12

Open
Denperidge opened this issue May 24, 2023 · 1 comment
Open

Crashes from missing pip modules only return a 404 #12

Denperidge opened this issue May 24, 2023 · 1 comment

Comments

@Denperidge
Copy link

Steps to recreate:

  1. Try to import a module that is not installed in web.py (or a file that gets imported from web.py)
  2. Run the service (this should happen in both prod or dev)

Output:

identifier_1  | 15:05:51.998 [info]  GET /repo-harvester/
identifier_1  | keeping user_id
dispatcher_1  | 
dispatcher_1  | 15:05:51.999 [info]  GET /repo-harvester
harvester_1   | 172.24.0.5 - - [24/May/2023 15:05:52] "GET / HTTP/1.1" 404 -
dispatcher_1  | 
dispatcher_1  | 15:05:52.004 [info]  Sent 404 in 4ms
identifier_1  | 
identifier_1  | 15:05:52.005 [info]  Sent 404 in 6ms
identifier_1  | 

If possible, a clearer error as to where the lack of functional routes comes from would be optimal

@sergiofenoll
Copy link

sergiofenoll commented Oct 18, 2023

We should definitely handle this better.

I think the cause is that we're importing service code here, but failure to import (as you say because of a missing requirement but also because of syntax errors for example) doesn't cause the service to fail, Flask still sets up the app, just without any routes (that's why everything ends up returning a 404).

Would it be better to have the service not boot up at all if there's an error importing the service code? I'm not sure how such errors are handled in other templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants