Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

❗ NOTICE : aws-cdk-lib : validation errors detected: Value '' at 'stackName' failed #31654

Closed
1 task done
dpilch opened this issue Oct 4, 2024 · 3 comments
Closed
1 task done
Assignees
Labels
@aws-cdk/aws-amplify Related to AWS Amplify bug This issue is a bug. p0 package/tools Related to AWS CDK Tools or CLI potential-regression Marking this issue as a potential regression to be checked by team member response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@dpilch
Copy link
Contributor

dpilch commented Oct 4, 2024

Please add your +1 πŸ‘ to let us know you have encountered this


Status: RESOLVED

Overview:

The latest CDK release (https://github.com/aws/aws-cdk/releases/tag/v2.161.0) appears to have reintroduced #27526.

Intermittently when deploying the following error is printed.

Complete Error Message:

Error occurred while monitoring stack: Error [ValidationError]: 2 validation errors detected: Value '' at 'stackName' failed to satisfy constraint: Member must have length greater than or equal to 1; Value '' at 'stackName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z][-a-zA-Z0-9]*|arn:[-a-zA-Z0-9:/._+]*
    at Request.extractError (/Users/dppilche/amplify/apps/canaryfailures/node_modules/aws-cdk/lib/index.js:439:46717)
    at Request.callListeners (/Users/dppilche/amplify/apps/canaryfailures/node_modules/aws-cdk/lib/index.js:439:91820)
    at Request.emit (/Users/dppilche/amplify/apps/canaryfailures/node_modules/aws-cdk/lib/index.js:439:91268)
    at Request.emit (/Users/dppilche/amplify/apps/canaryfailures/node_modules/aws-cdk/lib/index.js:439:200231)
    at Request.transition (/Users/dppilche/amplify/apps/canaryfailures/node_modules/aws-cdk/lib/index.js:439:193784)
    at AcceptorStateMachine.runTo (/Users/dppilche/amplify/apps/canaryfailures/node_modules/aws-cdk/lib/index.js:439:158656)
    at /Users/dppilche/amplify/apps/canaryfailures/node_modules/aws-cdk/lib/index.js:439:158986
    at Request.<anonymous> (/Users/dppilche/amplify/apps/canaryfailures/node_modules/aws-cdk/lib/index.js:439:194076)
    at Request.<anonymous> (/Users/dppilche/amplify/apps/canaryfailures/node_modules/aws-cdk/lib/index.js:439:200306)
    at Request.callListeners (/Users/dppilche/amplify/apps/canaryfailures/node_modules/aws-cdk/lib/index.js:439:91988) {
  code: 'ValidationError',
  time: 2024-10-04T17:03:05.124Z,
  requestId: '8690e75f-bc8f-4d58-a6cf-6b86c941a799',
  statusCode: 400,
  retryable: false,
  retryDelay: 292.29573100392116
}

The last time this issue was present was because the describeStackEvents was called with { stackName: '' }. #27526 (comment). This recent PR #31407 touched the area of code that caused the previous issue.

Workaround:

Pin CDK version to 2.160.0

Solution:

Related Issues:

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

v2.160.0

Expected Behavior

The monitoring behavior should not attempt to describe a stack without providing the stack name.

Current Behavior

See error message above. The issue is intermittent.

Reproduction Steps

I am reliable reproducing the error when using Amplify Gen 2 (which under the hood uses the Amplify GraphQL API construct).

mkdir cdkmonitoringbug
cd cdkmonitoringbug
npm create amplify@latest
npx ampx sandbox 

The error message should show after this. If does not, try npx ampx sandbox delete and then npx ampx sandbox.

I haven't tested this yet, but the following guide would probably lead to the error as well. https://aws.amazon.com/blogs/mobile/announcing-aws-amplifys-graphql-api-cdk-construct-deploy-real-time-graphql-api-and-data-stack-on-aws/

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.161.0 (build be5ad8b)

Framework Version

No response

Node.js Version

v18.20.4

OS

mac os 14.7

Language

TypeScript

Language Version

typescript@5.6.2

Other information

No response

@dpilch dpilch added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 4, 2024
@github-actions github-actions bot added @aws-cdk/aws-amplify Related to AWS Amplify potential-regression Marking this issue as a potential regression to be checked by team member labels Oct 4, 2024
@dpilch dpilch changed the title validation errors detected: Value '' at 'stackName' failed to validation errors detected: Value '' at 'stackName' failed Oct 4, 2024
@pahud
Copy link
Contributor

pahud commented Oct 4, 2024

internal tracking: P159593912

@pahud pahud assigned pahud and shikha372 and unassigned pahud Oct 4, 2024
@pahud pahud added p0 and removed needs-triage This issue or PR still needs to be triaged. labels Oct 4, 2024
mergify bot pushed a commit that referenced this issue Oct 5, 2024
### Issue # (if applicable)

Closes #[31654](#31654).

### Reason for this change

This reverts commit 0755561.

### Description of changes

Changes introduced regression in amplify app for nested stacks, reverting it.

### Description of how you validated changes

Validated with local build

### Checklist
- [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
shikha372 added a commit that referenced this issue Oct 5, 2024
### Issue # (if applicable)

Closes #[31654](#31654).

### Reason for this change

This reverts commit 0755561.

### Description of changes

Changes introduced regression in amplify app for nested stacks, reverting it.

### Description of how you validated changes

Validated with local build

### Checklist
- [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@shikha372 shikha372 pinned this issue Oct 7, 2024
@ashishdhingra
Copy link
Contributor

ashishdhingra commented Oct 7, 2024

@dpilch This is resolved per internal tracking in 2.161.1 (build 0a606c9) and aws-amplify/amplify-backend#2080. Closing this issue.

@ashishdhingra ashishdhingra added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 7, 2024
Copy link

github-actions bot commented Oct 7, 2024

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2024
@shikha372 shikha372 changed the title validation errors detected: Value '' at 'stackName' failed ❗ NOTICE : aws-cdk-lib : validation errors detected: Value '' at 'stackName' failed Oct 7, 2024
@aws aws unlocked this conversation Oct 25, 2024
@xazhao xazhao unpinned this issue Nov 4, 2024
@iliapolo iliapolo added the package/tools Related to AWS CDK Tools or CLI label Nov 5, 2024
xazhao pushed a commit to xazhao/aws-cdk-notices that referenced this issue Dec 18, 2024
rix0rrr pushed a commit to aws/aws-cdk-cli-testing that referenced this issue Dec 24, 2024
### Issue # (if applicable)

Closes #[31654](aws/aws-cdk#31654).

### Reason for this change

This reverts commit d6499d4.

### Description of changes

Changes introduced regression in amplify app for nested stacks, reverting it.

### Description of how you validated changes

Validated with local build

### Checklist
- [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
rix0rrr pushed a commit to aws/aws-cdk-cli-testing that referenced this issue Dec 24, 2024
### Issue # (if applicable)

Closes #[31654](aws/aws-cdk#31654).

### Reason for this change

This reverts commit d6499d4.

### Description of changes

Changes introduced regression in amplify app for nested stacks, reverting it.

### Description of how you validated changes

Validated with local build

### Checklist
- [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
@aws-cdk/aws-amplify Related to AWS Amplify bug This issue is a bug. p0 package/tools Related to AWS CDK Tools or CLI potential-regression Marking this issue as a potential regression to be checked by team member response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

5 participants