<@ULVA73B9P> I have a running work-pool worker in ...
# ask-marvin
m
@Marvin I have a running work-pool worker in a docker container. My Prefect Cloud UI is showing the work pool is ready, and when I run a deployment the flow run fails in the pull step:
Copy code
File "/root/.cache/pypoetry/virtualenvs/templisher-J4djokMo-py3.11/lib/python3.11/site-packages/botocore/signers.py", line 198, in sign
    auth.add_auth(request)
  File "/root/.cache/pypoetry/virtualenvs/templisher-J4djokMo-py3.11/lib/python3.11/site-packages/botocore/auth.py", line 423, in add_auth
    raise NoCredentialsError()
botocore.exceptions.NoCredentialsError: Unable to locate credentials

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

  File "/root/.cache/pypoetry/virtualenvs/templisher-J4djokMo-py3.11/lib/python3.11/site-packages/prefect/flows.py", line 2036, in load_flow_from_flow_run
    output = await run_steps(deployment.pull_steps)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/templisher-J4djokMo-py3.11/lib/python3.11/site-packages/prefect/deployments/steps/core.py", line 191, in run_steps
    raise StepExecutionError(f"Encountered error while running {fqn}") from exc
prefect.deployments.steps.core.StepExecutionError: Encountered error while running prefect_aws.deployments.steps.pull_from_s3
12:12:41 PM
Error
Process 29 exited with status code: 1
12:12:43 PM
Error
I am able to retrieve the S3-Bucket block from the container and access the AWS Credentials that are attached to the block. So I'm not sure why the pull step is failing.
m
Your message was too long by 119 tokens...
n
sorry i can probably relax this limit a bit, one min
1
whoops, ill have to do this later. what version is your worker running? we just recently added a change to make the trace more informative here
m
Im on Prefect 3.1.12. It works in local, but I have AWS credentials configured on a local worker. I'm thinking the S3-Bucket block which holds credentials would automatically supply them, but maybe I'm missing a field in the pull step definition?
Copy code
pull:
- prefect_aws.deployments.steps.pull_from_s3:
    id: pull_code
    requires: prefect-aws>=0.3.4
    bucket: "{{ prefect.blocks.s3-bucket.flowcode.bucket_name }}"
    folder: "{{ prefect.blocks.s3-bucket.flowcode.bucket_folder }}"
@Nate I'll try adding this:
credentials: "{{ prefect.blocks.aws-credentials.app-templisher }}"
which is the name of the stored AWS credentials block.
n
that makes sense to me!
m
@Nate It seems the pull step isn't looking for the config profile within the AWS Credentials block. I got this error:
Copy code
File "/templisher/.venv/lib/python3.11/site-packages/botocore/session.py", line 422, in get_scoped_config
    raise ProfileNotFound(profile=profile_name)
botocore.exceptions.ProfileNotFound: The config profile (app-templisher) could not be found

File "/templisher/.venv/lib/python3.11/site-packages/prefect/deployments/steps/core.py", line 191, in run_steps
    raise StepExecutionError(f"Encountered error while running {fqn}") from exc
prefect.deployments.steps.core.StepExecutionError: Encountered error while running prefect_aws.deployments.steps.pull_from_s3
Currently my AWS Credentials block definition has a
Profile Name: app-templisher
defined. But I noticed the block has additional option
Botocore Config
which currently contains
{ "config": null, "verify": true, "use_ssl": true, "api_version": "", "endpoint_url": "", "verify_cert_path": "" }
Maybe I need to remove the profile name, or add something to the
config
field?
@Nate YUP! Removed Profile Name from the AWS Credentials block, it authenticates properly. That field is more trouble that its worth...
n
sounds like you got things going though?
That field is more trouble that its worth...
feel free to open an issue if you think we should improve the DX here!
m
Yes removing the entry in the Profile Name field from the AWS Credentials block cleared the problem.
catjam 1