Python 如何调试一个无响应、模糊的Werkzeug 404错误?

Python 如何调试一个无响应、模糊的Werkzeug 404错误?,python,flask,gunicorn,werkzeug,Python,Flask,Gunicorn,Werkzeug,我们正在使用一个Flask应用程序,由gunicorn+Nginx在docker容器中提供。我们的记录器大约每24小时显示一次或两次以下消息: Dec 31 00:27:36 Computer logger: [12/31/2019 08:27:36] backend ERROR: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check

我们正在使用一个Flask应用程序,由gunicorn+Nginx在docker容器中提供。我们的记录器大约每24小时显示一次或两次以下消息:

Dec 31 00:27:36 Computer logger: [12/31/2019 08:27:36] backend ERROR:   404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. Traceback (most recent call last):   File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request     rv = self.dispatch_request()   File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1925, in dispatch_request     self.raise_routing_exception(req)   File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1907, in raise_routing_exception     raise request.routing_exception   File "/usr/local/lib/python3.6/site-packages/flask/ctx.py", line 350, in match_request     result = self.url_adapter.match(return_rule=True)   File "/usr/local/lib/python3.6/site-packages/werkzeug/routing.py", line 1799, in match     import pdb werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. 
这会影响到什么或者是由什么引起的完全是个谜,而回溯一点帮助都没有。面向用户的一侧没有明显变化。我尝试过很多事情,包括启动应用程序。在调试模式下。我最近的一次尝试是进入
/usr/local/lib/python3.6/site packages/werkzeug/routing.py
本身并更改错误的行为。然而,上面记录的消息只是打印出我的代码更改,但似乎并没有实际运行更改本身。(即,无论我如何更改该文件,所有内容看起来都以完全相同的方式运行。相反,更改本身会被记录下来[而不是运行更改后的代码的效果])


如何调试这样一个无响应的Werkzeug 404错误?我缺少哪些选项/设置/方法?为什么对
routing.py
(例如)代码的更改会被忽略,但会打印到屏幕上(好像Python正在做的只是打印
行x
行y
之间的代码块)。

您能在Nginx日志中查找生成404s的请求URL吗?@Ry-好主意!我检查了,但遇到了问题,所以我必须等到错误再次出现你能在Nginx日志中查找生成404s的请求URL吗?@Ry-好主意!我检查了,但遇到了问题,所以我必须等到错误再次出现L