bug: agentcore dev fails on mismatched regions
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- aws, typescript
调研方向
从 src/cli/operations/dev/load-dev-env.ts 开始,检查 aws-targets.json 如何向本地代理环境提供部署区域。在不同区域的资源上复现 dev,并验证子进程接收到匹配的 AWS_REGION 值。当本地代理的内存查找使用配置的目标区域而不是回退区域时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Problem
Invoking local agent is failing with memory not found:
Web UI: [MyAgent1] {"timestamp": "2026-06-03T17:24:11.698Z", "level": "ERROR", "message": "Error in sync streaming", "logger": "bedrock_agentcore.app", "requestId": "********-****-****-****-************",
"sessionId": "********-****-****-****-************", "errorType": "ResourceNotFoundException", "errorMessage": "An error occurred (ResourceNotFoundException) when calling the ListEvents operation: Memory not
found: ************************************", "stackTrace": ["Traceback (most recent call last):\n", " File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/bedrock_agentcore/runtime/app.py\", line 886,
in _sync_stream_with_error_handling\n for value in generator:\n", " File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/bedrock_agentcore/runtime/app.py\", line 747, in _async_gen_to_sync_gen\n
raise value\n", " File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/bedrock_agentcore/runtime/app.py\", line 736, in _produce\n async for chunk in async_gen:\n", " File
\"/****/app/MyAgent1/main.py\", line 60, in invoke\n agent = get_or_create_agent(session_id, user_id)\n", " File \"/****/app/MyAgent1/main.py\", line 45, in get_or_create_agent\n
session_manager=get_memory_session_manager(session_id, user_id),\n", " File \"/****/app/MyAgent1/memory/session.py\", line 20, in get_memory_session_manager\n return AgentCoreMemorySessionManager(\n", "
File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/bedrock_agentcore/memory/integrations/strands/session_manager.py\", line 202, in __init__\n super().__init__(session_id=self.config.session_id,
session_repository=self)\n", " File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/strands/session/repository_session_manager.py\", line 51, in __init__\n session =
session_repository.read_session(session_id)\n", " File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/bedrock_agentcore/memory/integrations/strands/session_manager.py\", line 318, in read_session\n
events = self.memory_client.list_events(\n", " File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/bedrock_agentcore/memory/client.py\", line 887, in list_events\n response =
self.gmdp_client.list_events(**params)\n", " File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/botocore/client.py\", line 606, in _api_call\n return self._make_api_call(operation_name, kwargs)\n",
" File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/opentelemetry/instrumentation/botocore/__init__.py\", line 334, in _patched_api_call\n result = original_func(*args, **kwargs)\n", " File
\"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/botocore/context.py\", line 123, in wrapper\n return func(*args, **kwargs)\n", " File
\"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/botocore/client.py\", line 1094, in _make_api_call\n raise error_class(parsed_response, operation_name)\n",
"botocore.errorfactory.ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the ListEvents operation: Memory not found: ************************************\n"], "location":
"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/bedrock_agentcore/runtime/app.py:_sync_stream_with_error_handling:889"}
The issue appears to be that the CLI does not inject the AWS_REGION env var into the local agent subprocess. This causes boto3 to try to fallback to a default that may not match the region that resoruces are deployed in. (source: https://docs.aws.amazon.com/boto3/latest/guide/configuration.html).
For example, my memory was in us-east-1, but its searching us-west-2.
Potential Fix
Looks like we may need to add the region from the aws-targets.json to the dev env here: https://github.com/aws/agentcore-cli/blob/main/src/cli/operations/dev/load-dev-env.ts#L16.
- 主要语言
- TypeScript
- 星标
- 291
- 派生
- 96
- 平均合并
- 17 小时 29 分钟
- 30 天内合并 PR
- 193
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aws/agentcore-cli 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
aws/agentcore-cli#2395 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
aws/agentcore-cli#2392 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
aws/agentcore-cli#2267 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
aws/agentcore-cli#2258 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
aws/agentcore-cli#2176 ·
维护者通常 1 天内回复
查看 aws/agentcore-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/vscode-livepreview#876 ·
维护者通常 1 天内回复
-
needs-triage
难度 1/5 1 小时以内 新手友好度 90/100
JustJarethB/invoicer#54 ·
-
ICP 1.2.0 shows a scheduled task's interval in milliseconds under the label "Interval (In seconds)"未关闭Needs Triage Type/Bug
难度 2/5 1-3 小时 新手友好度 68/100
wso2/product-integrator#2585 ·
维护者通常 1 天内回复
-
check:passed streams:add
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
design
难度 2/5 1-3 小时 新手友好度 72/100
MTES-MCT/monitor-field#119 ·
维护者通常 1 天内回复