CDK deploy fails: duplicate CloudWatch log group (/aws/lambda/websearch-lambda already exists)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
Research direction
Start with README.md and reproduce the failure using cdk deploy. Compare the CloudFormation resources WebSearchLogGroupD9C96826 and WebSearchLogGroup40A38A8A, tracing why both resolve to /aws/lambda/websearch-lambda. Done means the deployment creates distinct intended log groups without the duplicate-resource failure.
Written by the indexing model from the issue text.
Description
Dear contributors (@philikai, @rollwagen, @amazon-auto),
I tried deploying the WebSearch Agent (v2) following the steps described in the README.md.
After completing all prerequisites, I checked in AWS CloudWatch console that no Log group is defined. Then I ran:
cdk deploy
Environment:
- OS: Windows 11
- Python: 3.12.7
- AWS CLI: 2.31.11
- CDK: 2.1031.0
The deployment fails during the creation of the CloudWatch log groups, as shown in the log below.
- The log group WebSearchLogGroup is successfully created with logical ID
WebSearchLogGroupD9C96826. - In the AWS CloudWatch console, its corresponding name is:
/aws/lambda/websearch-lambda. - Later in the deployment, another log group named WebSearch/LogGroup (logical ID
WebSearchLogGroup40A38A8A) is attempted. - The deployment then fails with the following error:
/aws/lambda/websearch-lambdaalready exists, indicating both log groups map to the same CloudWatch name.
I spent quite some time debugging this but couldn’t resolve the issue. Could you please advise what might be wrong or if this is a known configuration conflict?
Thank you for your help.
Best regards.
WebSearchAgentStack-v2: creating CloudFormation changeset...
WebSearchAgentStack-v2 | 0/20 | 4:47:31 PM | REVIEW_IN_PROGRESS | AWS::CloudFormation::Stack | WebSearchAgentStack-v2 User Initiated
WebSearchAgentStack-v2 | 0/20 | 4:47:37 PM | CREATE_IN_PROGRESS | AWS::CloudFormation::Stack | WebSearchAgentStack-v2 User Initiated
WebSearchAgentStack-v2 | 0/20 | 4:47:40 PM | CREATE_IN_PROGRESS | AWS::CDK::Metadata | CDKMetadata/Default (CDKMetadata)
WebSearchAgentStack-v2 | 0/20 | 4:47:40 PM | CREATE_IN_PROGRESS | AWS::IAM::Role | WebSearchLambdaRole (WebSearchLambdaRoleBB6EC993)
WebSearchAgentStack-v2 | 0/20 | 4:47:40 PM | CREATE_IN_PROGRESS | AWS::Logs::LogGroup | AdvancedWebSearchLogGroup (AdvancedWebSearchLogGroup9033C588)
WebSearchAgentStack-v2 | 0/20 | 4:47:40 PM | CREATE_IN_PROGRESS | AWS::IAM::Role | AdvancedWebSearchLambdaRole (AdvancedWebSearchLambdaRoleBEF4C281)
WebSearchAgentStack-v2 | 0/20 | 4:47:40 PM | CREATE_IN_PROGRESS | AWS::Logs::LogGroup | WebSearchLogGroup (WebSearchLogGroupD9C96826) 👈
WebSearchAgentStack-v2 | 0/20 | 4:47:40 PM | CREATE_IN_PROGRESS | AWS::IAM::Role | AmazonBedrockExecutionRoleForAgents (AmazonBedrockExecutionRoleForAgents8FB4CD47)
WebSearchAgentStack-v2 | 0/20 | 4:47:40 PM | CREATE_IN_PROGRESS | AWS::Lambda::LayerVersion | WebSearchLambdaLayers/WebSearchAgentStack-v2-project-dependencies-layer (WebSearchLambdaLayersWebSearchAgentStackv2projectdependencieslayer87E63393)
WebSearchAgentStack-v2 | 0/20 | 4:47:41 PM | CREATE_IN_PROGRESS | AWS::Logs::LogGroup | WebSearchLogGroup (WebSearchLogGroupD9C96826) Resource creation Initiated
WebSearchAgentStack-v2 | 0/20 | 4:47:41 PM | CREATE_IN_PROGRESS | AWS::Logs::LogGroup | AdvancedWebSearchLogGroup (AdvancedWebSearchLogGroup9033C588) Resource creation Initiated
WebSearchAgentStack-v2 | 0/20 | 4:47:41 PM | CREATE_IN_PROGRESS | AWS::CDK::Metadata | CDKMetadata/Default (CDKMetadata) Resource creation Initiated
WebSearchAgentStack-v2 | 1/20 | 4:47:41 PM | CREATE_COMPLETE | AWS::CDK::Metadata | CDKMetadata/Default (CDKMetadata)
WebSearchAgentStack-v2 | 1/20 | 4:47:41 PM | CREATE_IN_PROGRESS | AWS::IAM::Role | AmazonBedrockExecutionRoleForAgents (AmazonBedrockExecutionRoleForAgents8FB4CD47) Resource creation Initiated
WebSearchAgentStack-v2 | 1/20 | 4:47:41 PM | CREATE_IN_PROGRESS | AWS::IAM::Role | WebSearchLambdaRole (WebSearchLambdaRoleBB6EC993) Resource creation Initiated
WebSearchAgentStack-v2 | 1/20 | 4:47:41 PM | CREATE_IN_PROGRESS | AWS::IAM::Role | AdvancedWebSearchLambdaRole (AdvancedWebSearchLambdaRoleBEF4C281) Resource creation Initiated
WebSearchAgentStack-v2 | 1/20 | 4:47:50 PM | CREATE_IN_PROGRESS | AWS::Logs::LogGroup | AdvancedWebSearchLogGroup (AdvancedWebSearchLogGroup9033C588) Eventual consistency check initiated
WebSearchAgentStack-v2 | 1/20 | 4:47:50 PM | CREATE_IN_PROGRESS | AWS::Logs::LogGroup | WebSearchLogGroup (WebSearchLogGroupD9C96826) Eventual consistency check initiated
WebSearchAgentStack-v2 | 2/20 | 4:47:50 PM | CREATE_COMPLETE | AWS::Logs::LogGroup | AdvancedWebSearchLogGroup (AdvancedWebSearchLogGroup9033C588)
WebSearchAgentStack-v2 | 3/20 | 4:47:50 PM | CREATE_COMPLETE | AWS::Logs::LogGroup | WebSearchLogGroup (WebSearchLogGroupD9C96826) ✅
WebSearchAgentStack-v2 | 3/20 | 4:47:54 PM | CREATE_IN_PROGRESS | AWS::Lambda::LayerVersion | WebSearchLambdaLayers/WebSearchAgentStack-v2-project-dependencies-layer (WebSearchLambdaLayersWebSearchAgentStackv2projectdependencieslayer87E63393) Resource creation Initiated
WebSearchAgentStack-v2 | 4/20 | 4:47:55 PM | CREATE_COMPLETE | AWS::Lambda::LayerVersion | WebSearchLambdaLayers/WebSearchAgentStack-v2-project-dependencies-layer (WebSearchLambdaLayersWebSearchAgentStackv2projectdependencieslayer87E63393)
WebSearchAgentStack-v2 | 5/20 | 4:47:59 PM | CREATE_COMPLETE | AWS::IAM::Role | AmazonBedrockExecutionRoleForAgents (AmazonBedrockExecutionRoleForAgents8FB4CD47)
WebSearchAgentStack-v2 | 6/20 | 4:48:00 PM | CREATE_COMPLETE | AWS::IAM::Role | WebSearchLambdaRole (WebSearchLambdaRoleBB6EC993)
WebSearchAgentStack-v2 | 7/20 | 4:48:00 PM | CREATE_COMPLETE | AWS::IAM::Role | AdvancedWebSearchLambdaRole (AdvancedWebSearchLambdaRoleBEF4C281)
WebSearchAgentStack-v2 | 7/20 | 4:48:00 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | AgentPolicy (AgentPolicyEF976063)
WebSearchAgentStack-v2 | 7/20 | 4:48:00 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | WebSearchLambdaRole/DefaultPolicy (WebSearchLambdaRoleDefaultPolicyF4844A89)
WebSearchAgentStack-v2 | 7/20 | 4:48:00 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | AdvancedWebSearchLambdaRole/DefaultPolicy (AdvancedWebSearchLambdaRoleDefaultPolicy922CE897)
WebSearchAgentStack-v2 | 7/20 | 4:48:01 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | LambdaPolicy (LambdaPolicy7FF67BE6)
WebSearchAgentStack-v2 | 7/20 | 4:48:02 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | WebSearchLambdaRole/DefaultPolicy (WebSearchLambdaRoleDefaultPolicyF4844A89) Resource creation Initiated
WebSearchAgentStack-v2 | 7/20 | 4:48:02 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | AgentPolicy (AgentPolicyEF976063) Resource creation Initiated
WebSearchAgentStack-v2 | 7/20 | 4:48:02 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | AdvancedWebSearchLambdaRole/DefaultPolicy (AdvancedWebSearchLambdaRoleDefaultPolicy922CE897) Resource creation Initiated
WebSearchAgentStack-v2 | 7/20 | 4:48:03 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | LambdaPolicy (LambdaPolicy7FF67BE6) Resource creation Initiated
WebSearchAgentStack-v2 | 8/20 | 4:48:17 PM | CREATE_COMPLETE | AWS::IAM::Policy | WebSearchLambdaRole/DefaultPolicy (WebSearchLambdaRoleDefaultPolicyF4844A89)
WebSearchAgentStack-v2 | 9/20 | 4:48:17 PM | CREATE_COMPLETE | AWS::IAM::Policy | AgentPolicy (AgentPolicyEF976063)
WebSearchAgentStack-v2 | 10/20 | 4:48:18 PM | CREATE_COMPLETE | AWS::IAM::Policy | AdvancedWebSearchLambdaRole/DefaultPolicy (AdvancedWebSearchLambdaRoleDefaultPolicy922CE897)
WebSearchAgentStack-v2 | 11/20 | 4:48:19 PM | CREATE_COMPLETE | AWS::IAM::Policy | LambdaPolicy (LambdaPolicy7FF67BE6)
WebSearchAgentStack-v2 | 11/20 | 4:48:19 PM | CREATE_IN_PROGRESS | AWS::Lambda::Function | WebSearch (WebSearchAD7A9428)
WebSearchAgentStack-v2 | 11/20 | 4:48:19 PM | CREATE_IN_PROGRESS | AWS::Lambda::Function | AdvancedWebSearch (AdvancedWebSearchCB05C1A2)
WebSearchAgentStack-v2 | 11/20 | 4:48:20 PM | CREATE_IN_PROGRESS | AWS::Lambda::Function | WebSearch (WebSearchAD7A9428) Resource creation Initiated
WebSearchAgentStack-v2 | 11/20 | 4:48:21 PM | CREATE_IN_PROGRESS | AWS::Lambda::Function | AdvancedWebSearch (AdvancedWebSearchCB05C1A2) Resource creation Initiated
WebSearchAgentStack-v2 | 12/20 | 4:48:28 PM | CREATE_COMPLETE | AWS::Lambda::Function | WebSearch (WebSearchAD7A9428)
WebSearchAgentStack-v2 | 13/20 | 4:48:29 PM | CREATE_COMPLETE | AWS::Lambda::Function | AdvancedWebSearch (AdvancedWebSearchCB05C1A2)
WebSearchAgentStack-v2 | 13/20 | 4:48:29 PM | CREATE_IN_PROGRESS | AWS::Logs::LogGroup | WebSearch/LogGroup (WebSearchLogGroup40A38A8A) 👈
WebSearchAgentStack-v2 | 13/20 | 4:48:29 PM | CREATE_IN_PROGRESS | AWS::Lambda::Permission | WebSearch/WebSearchLambdaResourcePolicyAgentsInvokeFunction (WebSearchWebSearchLambdaResourcePolicyAgentsInvokeFunctionE4068E49)
WebSearchAgentStack-v2 | 13/20 | 4:48:29 PM | CREATE_FAILED | AWS::Logs::LogGroup | WebSearch/LogGroup (WebSearchLogGroup40A38A8A) /aws/lambda/websearch-lambda already exists in stack arn:aws:cloudformation: ... ❌
WebSearchAgentStack-v2 | 13/20 | 4:48:29 PM | CREATE_FAILED | AWS::Lambda::Permission | WebSearch/WebSearchLambdaResourcePolicyAgentsInvokeFunction (WebSearchWebSearchLambdaResourcePolicyAgentsInvokeFunctionE4068E49) Resource creation cancelled
WebSearchAgentStack-v2 | 13/20 | 4:48:30 PM | ROLLBACK_IN_PROGRESS | AWS::CloudFormation::Stack | WebSearchAgentStack-v2 The following resource(s) failed to create: [WebSearchLogGroup40A38A8A, WebSearchWebSearchLambdaResourcePolicyAgentsInvokeFunctionE4068E49]. Rollback requested by user.
- Dominant language
- Python
- Stars
- 22
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
pydot/pydot#601 · 4 comments ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
letsencrypt/cp-cps#361 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
CI: startup_failure because callers grant fewer permissions than ledger-app-workflows@v1 declaresPossibly taken @maykonmichel claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
LedgerHQ/app-boilerplate-rust#227 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
linuxmint/mintupdate#1107 ·