Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

cdk v2.161.0 errors with validation errors detected: Value '' at 'stackName' failed to satisfy constraint #2080

Closed
dpilch opened this issue Oct 4, 2024 · 2 comments
Labels
bug Something isn't working dependency Issue related to upstream dependency

Comments

@dpilch
Copy link
Member

dpilch commented Oct 4, 2024

Environment information

System:
  OS: macOS 14.7
  CPU: (12) arm64 Apple M3 Pro
  Memory: 611.78 MB / 36.00 GB
  Shell: /bin/bash
Binaries:
  Node: 18.20.4 - ~/.nvm/versions/node/v18.20.4/bin/node
  Yarn: 1.22.22 - ~/.nvm/versions/node/v18.20.4/bin/yarn
  npm: 10.8.3 - ~/.nvm/versions/node/v18.20.4/bin/npm
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/auth-construct: 1.3.1
  @aws-amplify/backend: 1.3.1
  @aws-amplify/backend-auth: 1.2.0
  @aws-amplify/backend-cli: 1.2.9
  @aws-amplify/backend-data: 1.1.4
  @aws-amplify/backend-deployer: 1.1.4
  @aws-amplify/backend-function: 1.5.0
  @aws-amplify/backend-output-schemas: 1.2.1
  @aws-amplify/backend-output-storage: 1.1.2
  @aws-amplify/backend-secret: 1.1.3
  @aws-amplify/backend-storage: 1.2.1
  @aws-amplify/cli-core: 1.1.3
  @aws-amplify/client-config: 1.4.0
  @aws-amplify/deployed-backend-client: 1.4.1
  @aws-amplify/form-generator: 1.0.3
  @aws-amplify/model-generator: 1.0.8
  @aws-amplify/platform-core: 1.1.0
  @aws-amplify/plugin-types: 1.3.0
  @aws-amplify/sandbox: 1.2.2
  @aws-amplify/schema-generator: 1.2.4
  aws-amplify: 6.6.3
  aws-cdk: 2.161.0
  aws-cdk-lib: 2.161.0
  typescript: 5.6.2
AWS environment variables:
  AWS_STS_REGIONAL_ENDPOINTS = regional
  AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
  AWS_SDK_LOAD_CONFIG = 1
No CDK environment variables

Describe the bug

The deploy will intermittently encounter the following error. This is likely a regression with CDK v1.161.0. Pin your CDK version to v1.160.0 if you encounter this error. aws/aws-cdk#31654

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
}

Reproduction steps

mkdir cdkmonitoringbug
cd cdkmonitoringbug
npm create amplify@latest
npx ampx sandbox 
@dpilch dpilch added pending-triage Incoming issues that need categorization bug Something isn't working and removed pending-triage Incoming issues that need categorization labels Oct 4, 2024
@dpilch
Copy link
Member Author

dpilch commented Oct 4, 2024

For anyone encountering this error, pin your cdk version to 2.160.0 or lower.

package.json

"aws-cdk": "2.160.0",
"aws-cdk-lib": "2.160.0",

@dpilch dpilch added the dependency Issue related to upstream dependency label Oct 4, 2024
@josefaidt josefaidt changed the title validation errors detected: Value '' at 'stackName' failed to satisfy constraint cdk v2.161.0 errors with validation errors detected: Value '' at 'stackName' failed to satisfy constraint Oct 4, 2024
@josefaidt josefaidt pinned this issue Oct 4, 2024
@dpilch
Copy link
Member Author

dpilch commented Oct 5, 2024

CDK has released v2.161.1 that has patched the issue. https://github.com/aws/aws-cdk/releases/tag/v2.161.1. Please use 2.161.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependency Issue related to upstream dependency
Projects
None yet
Development

No branches or pull requests

1 participant