TypeError: _convert_to_request_dict() takes exactly 3 arguments (4 given)
Closed this issue · 9 comments
I dont know exactly what is the issue but thumbor suddenly stopped working for me.
I get the following error when i try to use thumbor:
2018-02-20 10:04:33 thumbor:ERROR ERROR: Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/thumbor/handlers/init.py", line 144, in get_image
self.context.request.image_url
File "/usr/local/lib/python2.7/site-packages/tornado/gen.py", line 1055, in run
value = future.result()
File "/usr/local/lib/python2.7/site-packages/tornado/concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "/usr/local/lib/python2.7/site-packages/tornado/gen.py", line 1069, in run
yielded = self.gen.send(value)
File "/usr/local/lib/python2.7/site-packages/thumbor/handlers/init.py", line 578, in _fetch
loader_result = yield self.context.modules.loader.load(self.context, url)
File "/usr/local/lib/python2.7/site-packages/tornado/concurrent.py", line 483, in wrapper
future.result()
File "/usr/local/lib/python2.7/site-packages/tornado/concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "/usr/local/lib/python2.7/site-packages/tornado/concurrent.py", line 471, in wrapper
result = f(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/tc_aws/loaders/s3_loader.py", line 49, in load
bucket_loader.get(key, callback=handle_data)
File "/usr/local/lib/python2.7/site-packages/tornado/concurrent.py", line 483, in wrapper
future.result()
File "/usr/local/lib/python2.7/site-packages/tornado/concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "/usr/local/lib/python2.7/site-packages/tornado/concurrent.py", line 471, in wrapper
result = f(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/tc_aws/aws/bucket.py", line 48, in get
Key=self._clean_key(path),
File "/usr/local/lib/python2.7/site-packages/tornado_botocore/base.py", line 157, in call
callback=callback
File "/usr/local/lib/python2.7/site-packages/tornado_botocore/base.py", line 109, in _make_api_call
request_dict = self.client._convert_to_request_dict(api_params, operation_model, {})
TypeError: _convert_to_request_dict() takes exactly 3 arguments (4 given)
Somehow, "tc_aws.loaders.s3_loader" is messed up and not working, when i changed it to tc_aws.loaders.presigning_loader, everythng started working again. I think this is something you guys can look into.
@Utsav2307 hello and thanks for reporting the issue. Can you add some details to help us?
- tc_aws and thumbor versions
- Requested URL
- Thumbor configuration
Thanks.
This is happening for me too. When setting
RESULT_STORAGE='tc_aws.result_storages.s3_storage'
I get:
2018-03-05 19:50:59 thumbor:ERROR [BaseHander.execute_image_operations] _convert_to_request_dict() takes exactly 3 arguments (4 given)
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python2.7/site-packages/thumbor/handlers/init.py", line 106, in execute_image_operations
result = yield gen.maybe_future(self.context.modules.result_storage.get())
File "/home/ubuntu/.local/lib/python2.7/site-packages/tornado/concurrent.py", line 483, in wrapper
future.result()
Changing the loader to tc_aws.loaders.presigning_loader
does not help, as my loader is already set to presigning_loader
tc_aws version: 6.2.1
thumbor version: 6.4.1
Requested URL: not how helpful this can be, I am signing URLs with base64_hmac_sha1
An example is: 2b7ec2889196464fcd1a425bed044ef7a516d713/M96WjTxYMcQwLjECXHngg8QgG5E=/fit-in/450x493/165.jpg
This is my thumbor.conf
MAX_AGE = 15552000
MAX_AGE_TEMP_IMAGE = 60
URL_SIGNER = 'libthumbor.url_signers.base64_hmac_sha1'
SECURITY_KEY = '__SECURITY_KEY__'
ALLOW_UNSAFE_URL = False
ALLOW_OLD_URLS = False
DETECTORS = [
'thumbor.detectors.face_detector',
'thumbor.detectors.feature_detector',
]
STORAGE = 'thumbor.storages.no_storage'
LOADER = 'tc_aws.loaders.presigning_loader'
TC_AWS_LOADER_BUCKET='thumbor-imagebucket-1fs3939sf0f5c'
TC_AWS_LOADER_ROOT_PATH=''
TC_AWS_ENABLE_HTTP_LOADER=False
TC_AWS_ALLOWED_BUCKETS=False
TC_AWS_REGION='us-east-1'
### IF I COMMENT THIS SECTION EVERYTHING WORKS AS EXPECTED
RESULT_STORAGE='tc_aws.result_storages.s3_storage'
TC_AWS_RESULT_STORAGE_ROOT_PATH= ''
TC_AWS_RESULT_STORAGE_BUCKET='thumbor-result-bucket'
TC_AWS_MAX_RETRY=0
TC_AWS_STORE_METADATA=False
TC_AWS_RANDOMIZE_KEYS=True
Please let me know if you need any more information on this and thank you for your help
Thanks for the details @syntonyze ; could you also give me the botocore and tornado-botocore versions installed on your system?
yep, thanks for getting back to me @Bladrak.
Name: tornado-botocore Version: 1.3.1
Name: botocore Version: 1.3.7
Please let me know if I can do anything else,
thanks
Had the same issue when going from Thumbor 6.3 to Thumbor 6.4 in tc_aws.storages.s3_storage
Upgrading to latest botocore (1.9.7) seems to have fixed it, but still need to do some testing.
Didn't manage to reproduce the issue with the same versions than you @syntonyze but could you check the fix suggested by @eerootsus ? If it does work, I'll update the requirements.
Yes @Bladrak I can confirm everything is working with botocore (1.9.7).
I did not try previous versions to bisect when this actually broke, but 1.9.7 definitely fixes it.
Thanks for finding this @eerootsus!
Closing this then, feel free to re-open if you encounter the same issue after updating to the latest versions :)
@Bladrak @antoniob-dp @eerootsus
and for all people that comes here searching for a botocore/tornado_botocore error: TypeError: _convert_to_request_dict() takes exactly 3 arguments (4 given)
In our case, we had botocore dependency frozen at 1.3.7 (to solve this: #62), but by other external cause (maybe another dependency not frozen), it started appearing this error when we did a fresh installation of our thumbor infrastructure.
Updating botocore dependency to 1.9.7 solved this problem.
I hope this will fullfill the "pending user feedback" label.