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

Exception when trying to use AWS S3 #545

Open
Zvirovyi opened this issue Nov 5, 2024 · 1 comment
Open

Exception when trying to use AWS S3 #545

Zvirovyi opened this issue Nov 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Zvirovyi
Copy link

Zvirovyi commented Nov 5, 2024

Steps to reproduce

  1. juju deploy mysql --channel 8.0/edge
  2. juju deploy s3-integrator (and configure it)
  3. juju integrate s3-integrator mysql
  4. juju run mysql/0 create-backup

Expected behavior

All the S3-related actions should work with the AWS.

Actual behavior

Action id 4 failed: Failed to upload metadata to provided S3

Creating backup, listing backups and restoring backup actions are failing when trying to connect to the AWS S3.

Versions

Operating system: Ubuntu 24.04.1 LTS

Juju CLI: 3.5.4-genericlinux-amd64

Juju agent: 3.5.4

Charm revision: 303

LXD: 6.1

Log output

Juju debug log: tmp.log

unit-mysql-0: 12:22:43 DEBUG unit.mysql/0.juju-log Exception raised.
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-mysql-0/charm/venv/s3transfer/tasks.py", line 139, in __call__
    return self._execute_main(kwargs)
  File "/var/lib/juju/agents/unit-mysql-0/charm/venv/s3transfer/tasks.py", line 162, in _execute_main
    return_value = self._main(**kwargs)
  File "/var/lib/juju/agents/unit-mysql-0/charm/venv/s3transfer/upload.py", line 764, in _main
    client.put_object(Bucket=bucket, Key=key, Body=body, **extra_args)
  File "/var/lib/juju/agents/unit-mysql-0/charm/venv/botocore/client.py", line 553, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/var/lib/juju/agents/unit-mysql-0/charm/venv/botocore/client.py", line 1009, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (PermanentRedirect) when calling the PutObject operation: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

Additional context

With endpoint=https://s3.<region-name>.amazonaws.com it works, but either this requirement in the documentation should be added (currently it states For older buckets, the endpoint s3.amazonaws.com can be used.) or automatic resolving should be ported from postgresql-operator (https://github.com/canonical/postgresql-operator/blob/c5c916d41d00849da5ae657cba4c97c46cb3caad/src/backups.py#L229).

@Zvirovyi Zvirovyi added the bug Something isn't working label Nov 5, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/DPE-5908.

This message was autogenerated

@Zvirovyi Zvirovyi changed the title botocore.exceptions.ClientError when connected to the AWS S3 Exception when trying to use AWS S3 Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant