-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Issue with basic example #1796
Comments
Just a follow up, the same test above works in the following environment
But not with latest releases of each of the packages |
We have nearly the same exception. I've provided stacktraces below. But they are not very useful as the code around line 612 in botocore/client.py was last changed a few years ago. The breaking release is botocore 1.11.0.
With fake credentials: /usr/local/lib/python3.6/site-packages/boto3/resources/factory.py:520: in do_action
response = action(self, *args, **kwargs)
/usr/local/lib/python3.6/site-packages/boto3/resources/action.py:83: in __call__
response = getattr(parent.meta.client, operation_name)(**params)
/usr/local/lib/python3.6/site-packages/botocore/client.py:314: in _api_call
return self._make_api_call(operation_name, kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <botocore.client.S3 object at 0x7f8279278240>, operation_name = 'PutObject', api_params = {'Body': <_io.BytesIO object at 0x7f825a53b518>, 'Bucket': 'TEST-bucket', 'Key': 'test_aggregator/base/0.json.gz'}
def _make_api_call(self, operation_name, api_params):
operation_model = self._service_model.operation_model(operation_name)
service_name = self._service_model.service_name
history_recorder.record('API_CALL', {
'service': service_name,
'operation': operation_name,
'params': api_params,
})
if operation_model.deprecated:
logger.debug('Warning: %s.%s() is deprecated',
service_name, operation_name)
request_context = {
'client_region': self.meta.region_name,
'client_config': self.meta.config,
'has_streaming_input': operation_model.has_streaming_input,
'auth_type': operation_model.auth_type,
}
request_dict = self._convert_to_request_dict(
api_params, operation_model, context=request_context)
handler, event_response = self.meta.events.emit_until_response(
'before-call.{endpoint_prefix}.{operation_name}'.format(
endpoint_prefix=self._service_model.endpoint_prefix,
operation_name=operation_name),
model=operation_model, params=request_dict,
request_signer=self._request_signer, context=request_context)
if event_response is not None:
http, parsed_response = event_response
else:
http, parsed_response = self._endpoint.make_request(
operation_model, request_dict)
self.meta.events.emit(
'after-call.{endpoint_prefix}.{operation_name}'.format(
endpoint_prefix=self._service_model.endpoint_prefix,
operation_name=operation_name),
http_response=http, parsed=parsed_response,
model=operation_model, context=request_context
)
if http.status_code >= 300:
error_code = parsed_response.get("Error", {}).get("Code")
error_class = self.exceptions.from_code(error_code)
> raise error_class(parsed_response, operation_name)
E botocore.exceptions.ClientError: An error occurred (InvalidAccessKeyId) when calling the PutObject operation: The AWS Access Key Id you provided does not exist in our records.
/usr/local/lib/python3.6/site-packages/botocore/client.py:612: ClientError With empty credentials (omitted part is identical to above): if http.status_code >= 300:
error_code = parsed_response.get("Error", {}).get("Code")
error_class = self.exceptions.from_code(error_code)
> raise error_class(parsed_response, operation_name)
E botocore.exceptions.ClientError: An error occurred (AuthorizationHeaderMalformed) when calling the PutObject operation: The authorization header is malformed; a non-empty Access Key (AKID) must be provided in the credential.
/usr/local/lib/python3.6/site-packages/botocore/client.py:612: ClientError |
I think that you're right, it is the latest version of botocore that breaking moto.
I will be using an earlier release for the time being. |
Same here:
and repro.py:
And no problems with
|
We are also seeing the same issue. Traceback (most recent call last): This was working with Boto3 1.7.x |
As boto3 was upgraded to 1.8.x we ran into the following issue: getmoto/moto#1796 (moto is used for unittests) As a fix, we decided to pin the version of boto3 to 1.7.84 which we knew to work. Signed-off-by: Balaji Sridharan <fnubalaj@amazon.com>
If #509 is merged will a new version be cut? |
And this issue seems to be a duplicate of #1793 |
As boto3 was upgraded to 1.8.x we ran into the following issue: getmoto/moto#1796 (moto is used for unittests) As a fix, we decided to pin the version of boto3 to 1.7.84 which we knew to work. Signed-off-by: Balaji Sridharan <fnubalaj@amazon.com>
Closing as a duplicate of #1793 |
As boto3 was upgraded to 1.8.x we ran into the following issue: getmoto/moto#1796 (moto is used for unittests) As a fix, we decided to pin the version of boto3 to 1.7.84 which we knew to work. Signed-off-by: Balaji Sridharan <fnubalaj@amazon.com>
Hello,
I am using a Boto3 in a project of mine, I was trying to do my testing using moto but then while trying to do the basic test presented in the documentation I am having the following error:
E botocore.exceptions.NoCredentialsError: Unable to locate credentials
.It seems like moto is not mocking anything
The example I used is the following
The text was updated successfully, but these errors were encountered: