Austin Weisgrau

02/13/2023, 9:23 PM
Getting an error from AWS when trying to apply deployment with S3 storage block.
from flows.helloworld.helloworld_flow import helloworld
from prefect.deployments import Deployment
from prefect_aws.ecs import ECSTask
from prefect_aws.s3 import S3Bucket

s3_storage = S3Bucket.load("prod")

ecs_task = ECSTask.load("prod")

helloworld_deployment = Deployment.build_from_flow(
    name="Hello World",

is giving me
$ python 
Traceback (most recent call last):
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/s3fs/", line 112, in _error_wrapper
    return await func(*args, **kwargs)
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/aiobotocore/", line 358, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (SignatureDoesNotMatch) when calling the PutObject operation: The request signature we calculated does not match the signature you provided. Check your key and signing method.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "~/code/wfp/wfp-prefect/", line 29, in <module>
    helloworld_deployment = WFPDeployment(
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/prefect/utilities/", line 230, in coroutine_wrapper
    return run_async_in_new_loop(async_fn, *args, **kwargs)
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/prefect/utilities/", line 181, in run_async_in_new_loop
    return, *args, **kwargs))
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/anyio/_core/", line 70, in run
    return, *args, **backend_options)
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/anyio/_backends/", line 292, in run
    return native_run(wrapper(), debug=debug)
  File "~/.pyenv/versions/3.10.9/lib/python3.10/asyncio/", line 44, in run
    return loop.run_until_complete(main)
  File "~/.pyenv/versions/3.10.9/lib/python3.10/asyncio/", line 649, in run_until_complete
    return future.result()
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/anyio/_backends/", line 287, in wrapper
    return await func(*args)
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/prefect/", line 755, in build_from_flow
    await deployment.upload_to_storage(ignore_file=ignore_file)
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/prefect/", line 600, in upload_to_storage
    file_count = await
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/prefect/", line 492, in put_directory
    return await self.filesystem.put_directory(
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/prefect/", line 368, in put_directory
    self.filesystem.put_file(f, fpath, overwrite=True)
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/fsspec/", line 114, in wrapper
    return sync(self.loop, func, *args, **kwargs)
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/fsspec/", line 99, in sync
    raise return_result
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/fsspec/", line 54, in _runner
    result[0] = await coro
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/s3fs/", line 1101, in _put_file
    await self._call_s3(
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/s3fs/", line 339, in _call_s3
    return await _error_wrapper(
  File "~/.pyenv/versions/prefect/lib/python3.10/site-packages/s3fs/", line 139, in _error_wrapper
    raise err
PermissionError: The request signature we calculated does not match the signature you provided. Check your key and signing method.

Ryan Peden

02/13/2023, 10:21 PM
Usually when I've run into this with S3, it's been because I accidentally copied and pasted a space before or after my key or secret - or accidentally cut off a character. Either way, re-entering and double-checking your credentials is a good first step just to get the simplest thing out of the way first.