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 0.32.0 fails to deploy ECR repository: Parameters: [ ... CodeArtifactHash ...] must have values #2638

Closed
markusl opened this issue May 25, 2019 · 8 comments
Labels
bug This issue is a bug.

Comments

@markusl
Copy link
Contributor

markusl commented May 25, 2019

Describe the bug
After updating dependencies from 0.31.0 to 0.32.0 I got the following error ❌ AppName failed: Error [ValidationError]: Parameters: [AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cCodeArtifactHash8BCBAA49] must have values

New template code after dependency update:

Parameters:
  AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cCodeArtifactHash8BCBAA49:
    Type: String
    Description: Artifact hash for asset
      "AppName/AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62c/Code"

Possibly caused by #2334 ?

To Reproduce
Full code available at https://github.com/markusl/cdk-fargate-docker-starter

Expected behavior
Should probably work as in previous version.

Version:

  • OS: Macbook
  • Programming Language: Typescript
  • CDK Version: 0.32.0
@markusl markusl added the bug This issue is a bug. label May 25, 2019
@robertd
Copy link
Contributor

robertd commented May 26, 2019

I'm getting the same error when trying to upload custom Lambda Layer or run Lambda function.

  const testPythonLayer = new lambda.LayerVersion(this, "testPythonLayer", {
      name: "testPythonLayer",
      code: lambda.Code.asset("layer/test.zip"),
      compatibleRuntimes: [ lambda.Runtime.Python36, lambda.Runtime.Python37 ]
    });

Error in the output:

❌  TestPythonLambdaLayerExampleStack failed: Error [ValidationError]: Parameters: [testPythonLayerCodeArtifactHash793D5953] must have values
    at Request.extractError (/Users/rdjurasaj/.nvm/versions/node/v12.2.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/protocol/query.js:50:29)
    at Request.callListeners (/Users/rdjurasaj/.nvm/versions/node/v12.2.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/Users/rdjurasaj/.nvm/versions/node/v12.2.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/rdjurasaj/.nvm/versions/node/v12.2.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/rdjurasaj/.nvm/versions/node/v12.2.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/rdjurasaj/.nvm/versions/node/v12.2.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/rdjurasaj/.nvm/versions/node/v12.2.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/rdjurasaj/.nvm/versions/node/v12.2.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/rdjurasaj/.nvm/versions/node/v12.2.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/Users/rdjurasaj/.nvm/versions/node/v12.2.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:116:18) {
  message: 'Parameters: [testPythonLayerCodeArtifactHash793D5953] must have ' +
    'values',
  code: 'ValidationError',
  time: 2019-05-26T15:34:18.399Z,
  requestId: 'b98d3ba9-7fcb-11e9-8bee-ed35cd885e4a',
  statusCode: 400,
  retryable: false,
  retryDelay: 269.339135006735
}
Parameters: [testPythonLayerCodeArtifactHash793D5953] must have values

Most likely a regression bug.

@eladb
Copy link
Contributor

eladb commented May 26, 2019

Could you guys please ensure that your CLI version is also 0.32.0?

@robertd
Copy link
Contributor

robertd commented May 26, 2019

@eladb you’re probably right. Recently, I’ve started running cdk commands from ./node_modules/ directory because very often I forget to keep global cdk up to date :). I’ll check get I get home.

@robertd
Copy link
Contributor

robertd commented May 26, 2019

@eladb I did upgrade global CLI to 0.32.0, but I can't really test since my stack depends on imported IAM Role, and that's not working with 0.32.0 at the moment. I will open a new issue for it.

Screen Shot 2019-05-26 at 5 08 06 PM

EDIT: @eladb I take that back. I'm using nvm and most likely my global node_modules got out of whack. Everything is working for me on 0.32.0.

image

@eladb
Copy link
Contributor

eladb commented May 26, 2019

@robertd you will get this error if not all your CDK modules have the same version. Try to align your package.json file to the same version and nuke & rebuild your node_modules directory.

[This is caused by the fact that 0.31.0 and 0.32.0 are major versions]

@robertd
Copy link
Contributor

robertd commented May 26, 2019

@eladb 🤣 I was updating my reply above... Everything is working, it was my nvm acting up. I just nuked global node_modules and reinstalled cdk and it started working.

@eladb
Copy link
Contributor

eladb commented May 26, 2019

Glad to hear, and sorry for all the breaking changes.
@markusl, please reopen if this is still an issue

@eladb eladb closed this as completed May 26, 2019
@robertd
Copy link
Contributor

robertd commented May 27, 2019

No worries (it was more user error than cdk breaking change to be honest) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants