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

AttributeError: 'Context' object has no attribute 'request' #11

Open
bill7102 opened this issue Jul 14, 2022 · 1 comment
Open

AttributeError: 'Context' object has no attribute 'request' #11

bill7102 opened this issue Jul 14, 2022 · 1 comment

Comments

@bill7102
Copy link

bill7102 commented Jul 14, 2022

Attempted installing via pip on different machines. I've set the ENGINE parameter to 'thumbor_video_engine.engines.video' but I get the error below on all machines. I've tested with webm files and images (jpg) with curl, but both give HTTP 500 errors. If I set the ENGINE parameter back to the default, I can get images to store.

Other change made to the thumbor.conf was: UPLOAD_ENABLED = True

Curl response for WEBM:

curl -i -XPOST http://localhost:8000/image --data-binary "@sample-webm-file.webm"
HTTP/1.1 100 (Continue)

HTTP/1.1 500 Internal Server Error
Server: TornadoServer/6.2
Content-Type: text/html; charset=UTF-8
Date: Thu, 14 Jul 2022 21:58:39 GMT
Content-Length: 93

Thumbor log for WEBM:

2022-07-14 17:58:26 root:DEBUG thumbor starting at 0.0.0.0:8000
2022-07-14 17:58:26 asyncio:DEBUG Using selector: EpollSelector
2022-07-14 17:58:39 thumbor:DEBUG METRICS: inc: response.count:1
2022-07-14 17:58:39 thumbor:ERROR ERROR: Traceback (most recent call last):
File "/home/bill7102/.local/lib/python3.10/site-packages/tornado/web.py", line 1713, in _execute
result = await result
File "/home/bill7102/.local/lib/python3.10/site-packages/thumbor/handlers/upload.py", line 40, in post
if self.validate(body):
File "/home/bill7102/.local/lib/python3.10/site-packages/thumbor/handlers/init.py", line 955, in validate
engine.load(body, None)
File "/home/bill7102/.local/lib/python3.10/site-packages/thumbor_video_engine/engines/video.py", line 89, in load
self.engine = self.get_engine(buffer, extension)
File "/home/bill7102/.local/lib/python3.10/site-packages/thumbor_video_engine/engines/video.py", line 59, in get_engine
accepts_video = getattr(self.context.request, "accepts_video", False)
AttributeError: 'Context' object has no attribute 'request'

2022-07-14 17:58:39 tornado.access:ERROR 500 POST /image (127.0.0.1) 3516.33ms
2022-07-14 17:58:39 thumbor:DEBUG METRICS: timing: response.time:4
2022-07-14 17:58:39 thumbor:DEBUG METRICS: timing: response.time.500:4
2022-07-14 17:58:39 thumbor:DEBUG METRICS: inc: response.status.500:1

CURL response for JPEG

curl -i -XPOST http://localhost:8000/image --data-binary "@0.jpg"
HTTP/1.1 500 Internal Server Error
Server: TornadoServer/6.2
Content-Type: text/html; charset=UTF-8
Date: Thu, 14 Jul 2022 22:00:42 GMT
Content-Length: 93

Thumbor log for JPEG:

2022-07-14 18:00:33 root:DEBUG thumbor starting at 0.0.0.0:8000
2022-07-14 18:00:33 asyncio:DEBUG Using selector: EpollSelector
2022-07-14 18:00:42 thumbor:DEBUG METRICS: inc: response.count:1
2022-07-14 18:00:42 thumbor:ERROR ERROR: Traceback (most recent call last):
File "/home/bill7102/.local/lib/python3.10/site-packages/tornado/web.py", line 1713, in _execute
result = await result
File "/home/bill7102/.local/lib/python3.10/site-packages/thumbor/handlers/upload.py", line 40, in post
if self.validate(body):
File "/home/bill7102/.local/lib/python3.10/site-packages/thumbor/handlers/init.py", line 955, in validate
engine.load(body, None)
File "/home/bill7102/.local/lib/python3.10/site-packages/thumbor_video_engine/engines/video.py", line 89, in load
self.engine = self.get_engine(buffer, extension)
File "/home/bill7102/.local/lib/python3.10/site-packages/thumbor_video_engine/engines/video.py", line 59, in get_engine
accepts_video = getattr(self.context.request, "accepts_video", False)
AttributeError: 'Context' object has no attribute 'request'

2022-07-14 18:00:42 tornado.access:ERROR 500 POST /image (127.0.0.1) 13.38ms
2022-07-14 18:00:42 thumbor:DEBUG METRICS: timing: response.time:4
2022-07-14 18:00:42 thumbor:DEBUG METRICS: timing: response.time.500:4
2022-07-14 18:00:42 thumbor:DEBUG METRICS: inc: response.status.500:1

@indigomelody
Copy link

I'm also having this issue. Did anyone find a fix?

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