Comments (2)
Sorry. I failed to spot my mistake, believing the added test case would tell me. It will
- confirm the exception is raised but will not also
- confirm its str(exception) is available for insertion in the HTTP error response.
I have suggested a change to the tests now.
from gunicorn.
Hi I just had it too in my service running gunicorn,
May 17 03:47:19 YeheskelServer gunicorn[2283854]: [2024-05-17 03:47:19 +0300] [2283854] [ERROR] Exception in worker process
May 17 03:47:19 YeheskelServer gunicorn[2283854]: Traceback (most recent call last):
May 17 03:47:19 YeheskelServer gunicorn[2283854]: File "/home/env-betim/lib/python3.12/site-packages/gunicorn/workers/sync.py", line 134, in handle
May 17 03:47:19 YeheskelServer gunicorn[2283854]: req = next(parser)
May 17 03:47:19 YeheskelServer gunicorn[2283854]: ^^^^^^^^^^^^
May 17 03:47:19 YeheskelServer gunicorn[2283854]: File "/home/env-betim/lib/python3.12/site-packages/gunicorn/http/parser.py", line 42, in __next__
May 17 03:47:19 YeheskelServer gunicorn[2283854]: self.mesg = self.mesg_class(self.cfg, self.unreader, self.source_addr, self.req_count)
May 17 03:47:19 YeheskelServer gunicorn[2283854]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 17 03:47:19 YeheskelServer gunicorn[2283854]: File "/home/env-betim/lib/python3.12/site-packages/gunicorn/http/message.py", line 257, in __init__
May 17 03:47:19 YeheskelServer gunicorn[2283854]: super().__init__(cfg, unreader, peer_addr)
May 17 03:47:19 YeheskelServer gunicorn[2283854]: File "/home/env-betim/lib/python3.12/site-packages/gunicorn/http/message.py", line 60, in __init__
May 17 03:47:19 YeheskelServer gunicorn[2283854]: unused = self.parse(self.unreader)
May 17 03:47:19 YeheskelServer gunicorn[2283854]: ^^^^^^^^^^^^^^^^^^^^^^^^^
May 17 03:47:19 YeheskelServer gunicorn[2283854]: File "/home/env-betim/lib/python3.12/site-packages/gunicorn/http/message.py", line 281, in parse
May 17 03:47:19 YeheskelServer gunicorn[2283854]: self.parse_request_line(line)
May 17 03:47:19 YeheskelServer gunicorn[2283854]: File "/home/env-betim/lib/python3.12/site-packages/gunicorn/http/message.py", line 445, in parse_request_line
May 17 03:47:19 YeheskelServer gunicorn[2283854]: raise InvalidHTTPVersion(self.version)
May 17 03:47:19 YeheskelServer gunicorn[2283854]: gunicorn.http.errors.InvalidHTTPVersion: <exception str() failed>
May 17 03:47:19 YeheskelServer gunicorn[2283854]: During handling of the above exception, another exception occurred:
May 17 03:47:19 YeheskelServer gunicorn[2283854]: Traceback (most recent call last):
May 17 03:47:19 YeheskelServer gunicorn[2283854]: File "/home/env-betim/lib/python3.12/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
May 17 03:47:19 YeheskelServer gunicorn[2283854]: worker.init_process()
May 17 03:47:19 YeheskelServer gunicorn[2283854]: File "/home/env-betim/lib/python3.12/site-packages/gunicorn/workers/base.py", line 142, in init_process
May 17 03:47:19 YeheskelServer gunicorn[2283854]: self.run()
May 17 03:47:19 YeheskelServer gunicorn[2283854]: File "/home/env-betim/lib/python3.12/site-packages/gunicorn/workers/sync.py", line 126, in run
May 17 03:47:19 YeheskelServer gunicorn[2283854]: self.run_for_one(timeout)
May 17 03:47:19 YeheskelServer gunicorn[2283854]: File "/home/env-betim/lib/python3.12/site-packages/gunicorn/workers/sync.py", line 70, in run_for_one
May 17 03:47:19 YeheskelServer gunicorn[2283854]: self.accept(listener)
May 17 03:47:19 YeheskelServer gunicorn[2283854]: File "/home/env-betim/lib/python3.12/site-packages/gunicorn/workers/sync.py", line 32, in accept
May 17 03:47:19 YeheskelServer gunicorn[2283854]: self.handle(listener, client, addr)
May 17 03:47:19 YeheskelServer gunicorn[2283854]: File "/home/env-betim/lib/python3.12/site-packages/gunicorn/workers/sync.py", line 158, in handle
May 17 03:47:19 YeheskelServer gunicorn[2283854]: self.handle_error(req, client, addr, e)
May 17 03:47:19 YeheskelServer gunicorn[2283854]: File "/home/env-betim/lib/python3.12/site-packages/gunicorn/workers/base.py", line 225, in handle_error
May 17 03:47:19 YeheskelServer gunicorn[2283854]: mesg = "Invalid HTTP Version '%s'" % str(exc)
May 17 03:47:19 YeheskelServer gunicorn[2283854]: ^^^^^^^^
May 17 03:47:19 YeheskelServer gunicorn[2283854]: File "/home/env-betim/lib/python3.12/site-packages/gunicorn/http/errors.py", line 56, in __str__
May 17 03:47:19 YeheskelServer gunicorn[2283854]: return "Invalid HTTP Version: %r" % self.version
May 17 03:47:19 YeheskelServer gunicorn[2283854]: ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
May 17 03:47:19 YeheskelServer gunicorn[2283854]: TypeError: not all arguments converted during string formatting
May 17 03:47:19 YeheskelServer gunicorn[2283854]: [2024-05-17 03:47:19 +0300] [2283854] [INFO] Worker exiting (pid: 2283854)
Is the solution you suggested should fix it from happening?
Edit-Yeah seems it's should sorry for spamming ;-D
from gunicorn.
Related Issues (20)
- 404 errors during --max-requests restarts HOT 2
- SCRIPT_NAME header is dropped/rejected by header map validation HOT 2
- Gunicorn-22.0.0 egg file not building properly. Missing directories. HOT 11
- Gunicorn exceeds the specified number of workers in actual processes. HOT 5
- Check that threads works well with Gunicorn and Python 3.13 (I think that It doesn't) HOT 2
- 使用Gunicorn的preload进行多进程全局变量共享,引发bug HOT 2
- Error handling request (no URI read) HOT 6
- Question: Measurement of `gunicorn.request.duration`
- "capture_output" fails when using "logconfig_dict" for logging configuration
- gunicorn/util.py set_owner_process Mangling gid on RHEL8 + Google Cloud Platform (very large int group id) HOT 1
- QdrantClient seems to crash Gunicorn HOT 1
- Multiple Vulnerability Reports and security email address issue HOT 8
- Spawning multiple workers and [ERROR] Worker (pid:699) was sent SIGILL! HOT 1
- Worker autorestarts cause worker-dependent duplicate logs HOT 3
- Workers that are not supposed to exist exit with code 255 HOT 2
- [Question] Passing server hooks as python objects to a custom BaseApplication HOT 1
- Bypass connection queue for load balancer health checks : Latest
- 模型部署问题
- gunicorn.http.body.Body doesn't implement io.BaseIO HOT 4
- Waiting socket reads block worker restart
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gunicorn.