aws / aws/bedrock-agentcore-starter-toolkit
Permission denied Error with runtimes build by Agentcore SDK
- Dominant language
- Python
- Stars
- 508
- Forks
- 155
- Avg merge
- 8h 50m
- Merged PRs (30d)
- 4
Description
**Describe the bug**
The Docker file generated by running the agentcore configure command has the following -
RUN useradd -m -u 1000 bedrock_agentcore
USER bedrock_agentcore
EXPOSE 9000
EXPOSE 8000
EXPOSE 8080
COPY . .
However when the agent is called , it gives permission denied to run the agent.py file
To Reproduce
Steps to reproduce the behavior:
Execute the agentcore configure command with the required python file and requirement file.
Once the runtime is available , try to test the endpoint ,
4. See error
Cloudwatch logs :
2026-08-26T08:23:00.907Z | Traceback (most recent call last): -- | -- | 2026-08-26T08:23:00.907Z File "", line 189, in _run_module_as_main | File "", line 189, in _run_module_as_main | 2026-08-26T08:23:00.907Z File "", line 159, in _get_module_details | File "", line 159, in _get_module_details | 2026-08-26T08:23:00.907Z File "", line 1073, in get_code | File "", line 1073, in get_code | 2026-08-26T08:23:00.907Z File "", line 1130, in get_data | File "", line 1130, in get_data | 2026-08-26T08:23:00.907ZPermissionError: [Errno 13] Permission denied: '/app/stockanalysisagent.py'
Expected behavior
It should not give permission error
As a work around i have tried to edit the docker file as follows
RUN useradd -m -u 1000 bedrock_agentcore
COPY --chown=bedrock_agentcore:bedrock_agentcore . .
RUN chmod -R u=rwX,go=rX /app
USER bedrock_agentcore
EXPOSE 9000
EXPOSE 8000
EXPOSE 8080
Contributor guide
Research direction
Start with the Dockerfile generated by the `agentcore configure` command and reproduce the runtime using the reported `/app/stockanalysisagent.py` permission error. Compare the generated file with the documented workaround involving ownership and permissions; done means a configured runtime can execute the agent file without a PermissionError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- cli, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100