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

[BUG] In version 3.2 S3StorageClient expects PROTEUS__AWS_SECRET_ACCESS_KEY #470

Open
henrikfoss opened this issue Aug 22, 2024 · 1 comment
Labels
code/bug Something isn't working

Comments

@henrikfoss
Copy link
Contributor

henrikfoss commented Aug 22, 2024

Previously I could run:

storage_client = S3StorageClient.create(auth=auth)

with

s3_client = AwsClient(
    aws_credentials=ExplicitAwsCredentials(
        access_key=secrets["sa_secret_access_key"],
        access_key_id=secrets["sa_access_key"],
        region=region,
        endpoint=endpoint,
    )
)

But after upgrading to 3.2, it is giving me this error:

File "/home/hfj/.cache/pypoetry/virtualenvs/omni-channel-crystal-solver-BUzSMOZ0-py3.11/lib/python3.11/site-packages/IPython/core/interactiveshell.py", line 3553, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in <cell line: 0>
runfile('/home/hfj/PycharmProjects/omni-channel-crystal-solver/examples/main_local.py', wdir='/home/hfj/PycharmProjects/omni-channel-crystal-solver/examples')
File "/opt/pycharm-2023.1.2/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 198, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pycharm-2023.1.2/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/hfj/PycharmProjects/omni-channel-crystal-solver/examples/main_local.py", line 132, in
args = mock_arguments(file)
^^^^^^^^^^^^^^^^^^^^
File "/home/hfj/PycharmProjects/omni-channel-crystal-solver/examples/main_local.py", line 102, in mock_arguments
test_uri = _get_test_data_sas_uri(payload_data, auth=s3_client)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hfj/PycharmProjects/omni-channel-crystal-solver/examples/main_local.py", line 31, in _get_test_data_sas_uri
storage_client = S3StorageClient.create(auth=auth)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hfj/.cache/pypoetry/virtualenvs/omni-channel-crystal-solver-BUzSMOZ0-py3.11/lib/python3.11/site-packages/adapta/storage/blob/s3_storage_client.py", line 63, in create
auth.initialize_session(session_callable)
File "/home/hfj/.cache/pypoetry/virtualenvs/omni-channel-crystal-solver-BUzSMOZ0-py3.11/lib/python3.11/site-packages/adapta/security/clients/aws/_aws_client.py", line 106, in initialize_session
self._session = session_callable()
^^^^^^^^^^^^^^^^^^
File "/home/hfj/.cache/pypoetry/virtualenvs/omni-channel-crystal-solver-BUzSMOZ0-py3.11/lib/python3.11/site-packages/adapta/security/clients/aws/_aws_client.py", line 115, in _default_aws_session
self._credentials = EnvironmentAwsCredentials()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hfj/.cache/pypoetry/virtualenvs/omni-channel-crystal-solver-BUzSMOZ0-py3.11/lib/python3.11/site-packages/adapta/security/clients/aws/_aws_credentials.py", line 64, in init
raise ValueError("PROTEUS__AWS_SECRET_ACCESS_KEY must be set")
ValueError: PROTEUS__AWS_SECRET_ACCESS_KEY must be set

@henrikfoss henrikfoss added the code/bug Something isn't working label Aug 22, 2024
@jrbentzon
Copy link
Member

We updated the constructor argument from aws_credentials to credentials, can you try

s3_client = AwsClient(
    credentials=ExplicitAwsCredentials(
        access_key=secrets["sa_secret_access_key"],
        access_key_id=secrets["sa_access_key"],
        region=region,
        endpoint=endpoint,
    )
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants