Call to dcim.devices.all() fails with a 504 when using nginx and uwsgi
See original GitHub issueEnvironment
- Python version: 3.8.11
- Nautobot version: 1.2.3
- nginx version: 1:1.16-1-1.el7.ngx
- uwsgi version: 2.0.19.1
Steps to Reproduce
- Deploy nautobot with nginx and uwsgi
- Import a number of devices into nautobot
- Call dcim.devices.all (either through restapi or pynautobot)
Expected Behaviour
All devices should be returned via the api Note: this worked against demo.nautobot.com (~300 devices), local install has ~5200 devices
Observed Behaviour
504 gateway timeout from the server
client log:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/demo/Library/Python/3.8/lib/python/site-packages/pynautobot/core/endpoint.py", line 99, in all
return response_loader(req.get(), self.return_obj, self)
File "/Users/demo/Library/Python/3.8/lib/python/site-packages/pynautobot/core/query.py", line 295, in get
return req_all()
File "/Users/demo/Library/Python/3.8/lib/python/site-packages/pynautobot/core/query.py", line 253, in req_all
req = self._make_call(add_params=add_params)
File "/Users/demo/Library/Python/3.8/lib/python/site-packages/pynautobot/core/query.py", line 226, in _make_call
raise RequestError(req)
pynautobot.core.query.RequestError: The request failed with code 504 Gateway Time-out but more specific details were not returned in json. Check the Nautobot Logs or investigate this exception's error attribute.
uwsgi log:
Thu Feb 3 11:35:17 2022 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET /api/dcim/devices/ (192.0.2.55)
OSError: write error
nginx log:
2022/02/03 11:34:56 [error] 28892#28892: *35577 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.0.2.55, server: nautobot-dev-1.example.com, request: "GET /api/dcim/devices/ HTTP/1.1", upstream: "uwsgi://unix:///run/nautobot-dev/uwsgi.socket", host: "nautobot-dev-1.example.com"
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Call to dcim.devices.all() fails with a 504 when using nginx ...
Call to dcim.devices.all() fails with a 504 when using nginx and uwsgi #1329. Environment. Python version: 3.8.11; Nautobot version: 1.2.
Read more >nginx and uWSGI gives "504 Gateway timeout" - Stack Overflow
I use the unmodified version of uwsgi_params , from the tutorial: uwsgi_param QUERY_STRING $query_string; uwsgi_param REQUEST_METHOD $ ...
Read more >504 Gateway Time-out uwsgi + nginx django application
This solution addresses 90% of 504 error caused in different scenarios. Your project conf should be same as you've mentioned above.
Read more >How to Fix 504 Gateway Timeout Error in NGINX - Ubiq BI
Log into your proxy server and try connecting to your web server using curl/ping command.
Read more >Django Uwsgi Nginx 504 Gateway Timeout | TimOnWeb
I had a long running process (data import) and encountered 504 Gateway Timeout error. I use Nginx / uwsgi pair to serve my...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not seeing any of the signs of paginated requests in the nginx access logs
@glennmatthews sure, I’m happy to close this out