简体   繁体   中英

`cdk deploy`: fails to publish asset in node v16.14.0

I'm trying to hunt down the cause of an obscure bug or issue which I couldn't figure out. I tried with node v16.14.0 and v14.18.1 , and surprisingly the latter one works without issue in the same scenario each time.

The error I'm getting from cdk deploy in node v16 is as follows:

[50%] fail: The XML you provided was not well-formed or did not validate against our published schema

I'm confounded because it's the same deploy process I'm using for both node versions. This is the CDK code I'm using to deploy in case anyone's curious: https://github.com/rnag/rust.aws-cdk-lambda/tree/main/cdk-examples/rust-standalone

I've attached terminal output of cdk deploy -vv from both node versions below. Hopefully someone has an idea of what's going wrong, though I'm thinking it's potentially some issue with how I've set up my environment. I did run npm -g install cdk in both cases. I'm using nvm to switch between node versions.


v14

✘  rust-standalone   0.4.0-support-compile-time-features-and-env-vars ±  which cdk
/Users/rnag/.nvm/versions/node/v14.18.1/bin/cdk
✘  rust-standalone   0.4.0-support-compile-time-features-and-env-vars ±  cdk deploy -vv
CDK toolkit version: 2.15.0 (build 151055e)
Command line arguments: {
  _: [ 'deploy' ],
  v: 2,
  verbose: 2,
  lookups: true,
  'ignore-errors': false,
  ignoreErrors: false,
  json: false,
  j: false,
  debug: false,
  ec2creds: undefined,
  i: undefined,
  'version-reporting': undefined,
  versionReporting: undefined,
  'path-metadata': true,
  pathMetadata: true,
  'asset-metadata': true,
  assetMetadata: true,
  'role-arn': undefined,
  r: undefined,
  roleArn: undefined,
  staging: true,
  'no-color': false,
  noColor: false,
  all: false,
  'build-exclude': [],
  E: [],
  buildExclude: [],
  ci: false,
  execute: true,
  force: false,
  f: false,
  parameters: [ {} ],
  'previous-parameters': true,
  previousParameters: true,
  logs: true,
  '$0': 'cdk'
}
cdk.json: {
  "app": "npx ts-node --prefer-ts-exts bin/rust-standalone.ts",
  "watch": {
    "include": [
      "**"
    ],
    "exclude": [
      "README.md",
      "cdk*.json",
      "**/*.d.ts",
      "**/*.js",
      "tsconfig.json",
      "package*.json",
      "yarn.lock",
      "node_modules",
      "test"
    ]
  },
  "context": {
    "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true,
    "@aws-cdk/core:stackRelativeExports": true,
    "@aws-cdk/aws-rds:lowercaseDbIdentifier": true,
    "@aws-cdk/aws-lambda:recognizeVersionProps": true,
    "@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": true,
    "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
    "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
    "@aws-cdk/core:target-partitions": [
      "aws",
      "aws-cn"
    ]
  }
}
merged settings: {
  versionReporting: true,
  pathMetadata: true,
  output: 'cdk.out',
  app: 'npx ts-node --prefer-ts-exts bin/rust-standalone.ts',
  watch: {
    include: [ '**' ],
    exclude: [
      'README.md',
      'cdk*.json',
      '**/*.d.ts',
      '**/*.js',
      'tsconfig.json',
      'package*.json',
      'yarn.lock',
      'node_modules',
      'test'
    ]
  },
  context: {
    '@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId': true,
    '@aws-cdk/core:stackRelativeExports': true,
    '@aws-cdk/aws-rds:lowercaseDbIdentifier': true,
    '@aws-cdk/aws-lambda:recognizeVersionProps': true,
    '@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021': true,
    '@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver': true,
    '@aws-cdk/aws-ec2:uniqueImdsv2TemplateName': true,
    '@aws-cdk/core:target-partitions': [ 'aws', 'aws-cn' ]
  },
  debug: false,
  assetMetadata: true,
  toolkitBucket: {},
  staging: true,
  bundlingStacks: [ '*' ],
  lookups: true
}
Using CA bundle path: /Users/rnag/.ssh/ZscalerRootCertificate-2048-SHA256.pem
Determining if we're on an EC2 instance.
Does not look like an EC2 instance.
Toolkit stack: CDKToolkit
Setting "CDK_DEFAULT_REGION" environment variable to us-east-1
Resolving default credentials
Retrieved account ID 1234567890 from disk cache
Setting "CDK_DEFAULT_ACCOUNT" environment variable to 1234567890
context: {
  '@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId': true,
  '@aws-cdk/core:stackRelativeExports': true,
  '@aws-cdk/aws-rds:lowercaseDbIdentifier': true,
  '@aws-cdk/aws-lambda:recognizeVersionProps': true,
  '@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021': true,
  '@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver': true,
  '@aws-cdk/aws-ec2:uniqueImdsv2TemplateName': true,
  '@aws-cdk/core:target-partitions': [ 'aws', 'aws-cn' ],
  'aws:cdk:enable-path-metadata': true,
  'aws:cdk:enable-asset-metadata': true,
  'aws:cdk:version-reporting': true,
  'aws:cdk:bundling-stacks': [ '*' ]
}
outdir: cdk.out
env: {
  CDK_DEFAULT_REGION: 'us-east-1',
  CDK_DEFAULT_ACCOUNT: '1234567890',
  CDK_CONTEXT_JSON: '{"@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId":true,"@aws-cdk/core:stackRelativeExports":true,"@aws-cdk/aws-rds:lowercaseDbIdentifier":true,"@aws-cdk/aws-lambda:recognizeVersionProps":true,"@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021":true,"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver":true,"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName":true,"@aws-cdk/core:target-partitions":["aws","aws-cn"],"aws:cdk:enable-path-metadata":true,"aws:cdk:enable-asset-metadata":true,"aws:cdk:version-reporting":true,"aws:cdk:bundling-stacks":["*"]}',
  CDK_OUTDIR: 'cdk.out',
  CDK_CLI_ASM_VERSION: '16.0.0',
  CDK_CLI_VERSION: '2.15.0'
}
✅  Run `cargo check`: 1.75s
🍺  Building Rust code...
🎯  Cross-compile `rust-standalone`: 9.70s

✨  Synthesis time: 17.17s

Reading existing template for stack RustStandaloneStack.
Retrieved account ID 1234567890 from disk cache
Assuming role 'arn:aws:iam::1234567890:role/cdk-hnb659fds-lookup-role-1234567890-us-east-1'.
[AWS ssm 200 0.483s 0 retries] getParameter({ Name: '/cdk-bootstrap/hnb659fds/version' })
[AWS cloudformation 200 0.3s 0 retries] describeStacks({ StackName: 'RustStandaloneStack' })
[AWS ssm 200 1.098s 1 retries] getParameter({ Name: '/cdk-bootstrap/hnb659fds/version' })
[AWS cloudformation 200 0.45s 0 retries] getTemplate({ StackName: 'RustStandaloneStack', TemplateStage: 'Original' })
RustStandaloneStack: deploying...
Retrieved account ID 1234567890 from disk cache
Assuming role 'arn:aws:iam::1234567890:role/cdk-hnb659fds-deploy-role-1234567890-us-east-1'.
Waiting for stack CDKToolkit to finish creating or updating...
[AWS cloudformation 200 0.487s 0 retries] describeStacks({ StackName: 'CDKToolkit' })
[AWS cloudformation 200 1.307s 1 retries] getTemplate({ StackName: 'RustStandaloneStack', TemplateStage: 'Original' })
[AWS ssm 200 0.215s 0 retries] getParameter({ Name: '/cdk-bootstrap/hnb659fds/version' })
[0%] start: Publishing ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac:current_account-current_region
Retrieved account ID 1234567890 from disk cache
Assuming role 'arn:aws:iam::1234567890:role/cdk-hnb659fds-file-publishing-role-1234567890-us-east-1'.
[0%] check: Check s3://cdk-hnb659fds-assets-1234567890-us-east-1/ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip
[AWS s3 200 0.424s 0 retries] getBucketLocation({ Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1' })
[AWS s3 200 0.17s 0 retries] listObjectsV2({
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Prefix: 'ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip',
  MaxKeys: 1
})
[AWS s3 200 0.447s 0 retries] getBucketEncryption({ Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1' })
[0%] cached: From cache /Users/rnag/CLionProjects/rust-aws-cdk-lambda/cdk-examples/rust-standalone/cdk.out/.cache/ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip
[0%] upload: Upload s3://cdk-hnb659fds-assets-1234567890-us-east-1/ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip
[AWS s3 200 1.049s 0 retries] createMultipartUpload({
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Key: 'ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip',
  ContentType: 'application/zip',
  ServerSideEncryption: 'aws:kms',
  SSEKMSKeyId: undefined
})
[AWS s3 200 0.639s 0 retries] uploadPart({
  Body: <Buffer 45 2f ef 50 27 7f 1b c6 af 77 fc 6c bd ba ce 19 65 66 e3 b3 5a 6f eb ce 6c be 63 8d cf 6c 3e ab 7f 8b eb b4 02 be 07 57 c3 35 f0 23 f8 09 dc 08 ad df ... 1087932 more bytes>,
  ContentLength: 1087982,
  PartNumber: 2,
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Key: 'ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip',
  UploadId: 'zkn5fIhcgZXUOfSrM1i3Z8mbIM_qpySk8xj6r28RWBhCucHWc4P8Ij_P5H8u1rnGRcy23vIBk2QbfjPsjtIenhZ.89ezKxiGhIcQpVHpuUOQjNNUWGRJWFkLhMCqXh3Pv4kkP7atb8Tf648Fl7tVpg--'
})
[AWS s3 200 1.276s 0 retries] uploadPart({
  Body: <Buffer 50 4b 03 04 14 00 08 00 08 00 00 00 21 00 00 00 00 00 00 00 00 00 00 00 00 00 09 00 00 00 62 6f 6f 74 73 74 72 61 70 ec 7d 0b 78 14 d5 dd f7 2c c9 c2 ... 5242830 more bytes>,
  ContentLength: 5242880,
  PartNumber: 1,
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Key: 'ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip',
  UploadId: 'zkn5fIhcgZXUOfSrM1i3Z8mbIM_qpySk8xj6r28RWBhCucHWc4P8Ij_P5H8u1rnGRcy23vIBk2QbfjPsjtIenhZ.89ezKxiGhIcQpVHpuUOQjNNUWGRJWFkLhMCqXh3Pv4kkP7atb8Tf648Fl7tVpg--'
})
[AWS s3 200 0.822s 0 retries] completeMultipartUpload({
  MultipartUpload: {
    Parts: [
      { ETag: '"72e38889eb268ce42fafe61b7a94ab02"', PartNumber: 1 },
      { ETag: '"aa13b0f627ce8e471a9b94de094ca30a"', PartNumber: 2 },
      [length]: 2
    ]
  },
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Key: 'ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip',
  UploadId: 'zkn5fIhcgZXUOfSrM1i3Z8mbIM_qpySk8xj6r28RWBhCucHWc4P8Ij_P5H8u1rnGRcy23vIBk2QbfjPsjtIenhZ.89ezKxiGhIcQpVHpuUOQjNNUWGRJWFkLhMCqXh3Pv4kkP7atb8Tf648Fl7tVpg--'
})
[50%] success: Published ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac:current_account-current_region
[50%] start: Publishing ac7372a44556a42380bfb39940b5b5b68914a6a9f356c4ca28cb7e49d01db87e:current_account-current_region
Retrieved account ID 1234567890 from disk cache
[50%] check: Check s3://cdk-hnb659fds-assets-1234567890-us-east-1/ac7372a44556a42380bfb39940b5b5b68914a6a9f356c4ca28cb7e49d01db87e.json
[AWS s3 200 0.229s 0 retries] listObjectsV2({
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Prefix: 'ac7372a44556a42380bfb39940b5b5b68914a6a9f356c4ca28cb7e49d01db87e.json',
  MaxKeys: 1
})
[50%] upload: Upload s3://cdk-hnb659fds-assets-1234567890-us-east-1/ac7372a44556a42380bfb39940b5b5b68914a6a9f356c4ca28cb7e49d01db87e.json
[AWS s3 200 0.299s 0 retries] putObject({
  Body: <Buffer 7b 0a 20 20 22 52 65 73 6f 75 72 63 65 73 22 3a 20 7b 0a 20 20 20 20 22 52 75 73 74 53 74 61 6e 64 61 6c 6f 6e 65 42 75 63 6b 65 74 45 32 46 44 44 39 ... 9884 more bytes>,
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Key: 'ac7372a44556a42380bfb39940b5b5b68914a6a9f356c4ca28cb7e49d01db87e.json',
  ContentType: 'application/json',
  ServerSideEncryption: 'aws:kms',
  SSEKMSKeyId: undefined
})
[100%] success: Published ac7372a44556a42380bfb39940b5b5b68914a6a9f356c4ca28cb7e49d01db87e:current_account-current_region
[AWS cloudformation 200 0.224s 0 retries] describeStacks({ StackName: 'RustStandaloneStack' })
RustStandaloneStack: checking if we can skip deploy
[AWS cloudformation 200 0.457s 0 retries] getTemplate({ StackName: 'RustStandaloneStack', TemplateStage: 'Original' })
RustStandaloneStack: template has changed
RustStandaloneStack: deploying...
Removing existing change set with name cdk-deploy-change-set if it exists
[AWS cloudformation 200 0.203s 0 retries] deleteChangeSet({
  StackName: 'RustStandaloneStack',
  ChangeSetName: 'cdk-deploy-change-set'
})
Attempting to create ChangeSet with name cdk-deploy-change-set to update stack RustStandaloneStack
RustStandaloneStack: creating CloudFormation changeset...
[AWS cloudformation 200 0.99s 1 retries] getTemplate({ StackName: 'RustStandaloneStack', TemplateStage: 'Original' })
[AWS cloudformation 200 0.671s 0 retries] createChangeSet({
  StackName: 'RustStandaloneStack',
  ChangeSetName: 'cdk-deploy-change-set',
  ChangeSetType: 'UPDATE',
  Description: 'CDK Changeset for execution eb61d4cb-559f-442d-a13b-27c440c11c69',
  TemplateBody: undefined,
  TemplateURL: 'https://s3.us-east-1.amazonaws.com/cdk-hnb659fds-assets-1234567890-us-east-1/ac7372a44556a42380bfb39940b5b5b68914a6a9f356c4ca28cb7e49d01db87e.json',
  Parameters: [
    { ParameterKey: 'BootstrapVersion', UsePreviousValue: true },
    [length]: 1
  ],
  RoleARN: 'arn:aws:iam::1234567890:role/cdk-hnb659fds-cfn-exec-role-1234567890-us-east-1',
  NotificationARNs: undefined,
  Capabilities: [
    'CAPABILITY_IAM',
    'CAPABILITY_NAMED_IAM',
    'CAPABILITY_AUTO_EXPAND',
    [length]: 3
  ],
  Tags: [ [length]: 0 ]
})
Initiated creation of changeset: arn:aws:cloudformation:us-east-1:1234567890:changeSet/cdk-deploy-change-set/62f53585-1758-4700-b74d-e07462b8a6e1; waiting for it to finish creating...
Waiting for changeset cdk-deploy-change-set on stack RustStandaloneStack to finish creating...
[AWS cloudformation 200 0.25s 0 retries] describeChangeSet({
  StackName: 'RustStandaloneStack',
  ChangeSetName: 'cdk-deploy-change-set'
})
Changeset cdk-deploy-change-set on stack RustStandaloneStack is still creating
[AWS cloudformation 200 0.212s 0 retries] describeChangeSet({
  StackName: 'RustStandaloneStack',
  ChangeSetName: 'cdk-deploy-change-set'
})
Changeset cdk-deploy-change-set on stack RustStandaloneStack is still creating
[AWS cloudformation 200 0.402s 0 retries] describeChangeSet({
  StackName: 'RustStandaloneStack',
  ChangeSetName: 'cdk-deploy-change-set'
})
Initiating execution of changeset arn:aws:cloudformation:us-east-1:1234567890:changeSet/cdk-deploy-change-set/62f53585-1758-4700-b74d-e07462b8a6e1 on stack RustStandaloneStack
[AWS cloudformation 200 0.226s 0 retries] executeChangeSet({
  StackName: 'RustStandaloneStack',
  ChangeSetName: 'cdk-deploy-change-set'
})
Execution of changeset arn:aws:cloudformation:us-east-1:1234567890:changeSet/cdk-deploy-change-set/62f53585-1758-4700-b74d-e07462b8a6e1 on stack RustStandaloneStack has started; waiting for the update to complete...
Waiting for stack RustStandaloneStack to finish creating or updating...
[...]
Stack RustStandaloneStack has completed updating

 ✅  RustStandaloneStack

✨  Deployment time: 42.16s

Stack ARN:
arn:aws:cloudformation:us-east-1:1234567890:stack/RustStandaloneStack/9e2dee40-90ea-11ec-8957-0ecc4aab847f

✨  Total time: 59.32s

v16

✘  rust-standalone   0.4.0-support-compile-time-features-and-env-vars ±  which cdk
/Users/rnag/.nvm/versions/node/v16.14.0/bin/cdk
✘  rust-standalone   0.4.0-support-compile-time-features-and-env-vars ±  cdk deploy -vv
CDK toolkit version: 2.15.0 (build 151055e)
Command line arguments: {
  _: [ 'deploy' ],
  v: 2,
  verbose: 2,
  lookups: true,
  'ignore-errors': false,
  ignoreErrors: false,
  json: false,
  j: false,
  debug: false,
  ec2creds: undefined,
  i: undefined,
  'version-reporting': undefined,
  versionReporting: undefined,
  'path-metadata': true,
  pathMetadata: true,
  'asset-metadata': true,
  assetMetadata: true,
  'role-arn': undefined,
  r: undefined,
  roleArn: undefined,
  staging: true,
  'no-color': false,
  noColor: false,
  all: false,
  'build-exclude': [],
  E: [],
  buildExclude: [],
  ci: false,
  execute: true,
  force: false,
  f: false,
  parameters: [ {} ],
  'previous-parameters': true,
  previousParameters: true,
  logs: true,
  '$0': 'cdk'
}
cdk.json: {
  "app": "npx ts-node --prefer-ts-exts bin/rust-standalone.ts",
  "watch": {
    "include": [
      "**"
    ],
    "exclude": [
      "README.md",
      "cdk*.json",
      "**/*.d.ts",
      "**/*.js",
      "tsconfig.json",
      "package*.json",
      "yarn.lock",
      "node_modules",
      "test"
    ]
  },
  "context": {
    "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true,
    "@aws-cdk/core:stackRelativeExports": true,
    "@aws-cdk/aws-rds:lowercaseDbIdentifier": true,
    "@aws-cdk/aws-lambda:recognizeVersionProps": true,
    "@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": true,
    "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
    "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
    "@aws-cdk/core:target-partitions": [
      "aws",
      "aws-cn"
    ]
  }
}
merged settings: {
  versionReporting: true,
  pathMetadata: true,
  output: 'cdk.out',
  app: 'npx ts-node --prefer-ts-exts bin/rust-standalone.ts',
  watch: {
    include: [ '**' ],
    exclude: [
      'README.md',
      'cdk*.json',
      '**/*.d.ts',
      '**/*.js',
      'tsconfig.json',
      'package*.json',
      'yarn.lock',
      'node_modules',
      'test'
    ]
  },
  context: {
    '@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId': true,
    '@aws-cdk/core:stackRelativeExports': true,
    '@aws-cdk/aws-rds:lowercaseDbIdentifier': true,
    '@aws-cdk/aws-lambda:recognizeVersionProps': true,
    '@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021': true,
    '@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver': true,
    '@aws-cdk/aws-ec2:uniqueImdsv2TemplateName': true,
    '@aws-cdk/core:target-partitions': [ 'aws', 'aws-cn' ]
  },
  debug: false,
  assetMetadata: true,
  toolkitBucket: {},
  staging: true,
  bundlingStacks: [ '*' ],
  lookups: true
}
Using CA bundle path: /Users/rnag/.ssh/ZscalerRootCertificate-2048-SHA256.pem
Determining if we're on an EC2 instance.
Does not look like an EC2 instance.
Toolkit stack: CDKToolkit
Setting "CDK_DEFAULT_REGION" environment variable to us-east-1
Resolving default credentials
Retrieved account ID 1234567890 from disk cache
Setting "CDK_DEFAULT_ACCOUNT" environment variable to 1234567890
context: {
  '@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId': true,
  '@aws-cdk/core:stackRelativeExports': true,
  '@aws-cdk/aws-rds:lowercaseDbIdentifier': true,
  '@aws-cdk/aws-lambda:recognizeVersionProps': true,
  '@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021': true,
  '@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver': true,
  '@aws-cdk/aws-ec2:uniqueImdsv2TemplateName': true,
  '@aws-cdk/core:target-partitions': [ 'aws', 'aws-cn' ],
  'aws:cdk:enable-path-metadata': true,
  'aws:cdk:enable-asset-metadata': true,
  'aws:cdk:version-reporting': true,
  'aws:cdk:bundling-stacks': [ '*' ]
}
outdir: cdk.out
env: {
  CDK_DEFAULT_REGION: 'us-east-1',
  CDK_DEFAULT_ACCOUNT: '1234567890',
  CDK_CONTEXT_JSON: '{"@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId":true,"@aws-cdk/core:stackRelativeExports":true,"@aws-cdk/aws-rds:lowercaseDbIdentifier":true,"@aws-cdk/aws-lambda:recognizeVersionProps":true,"@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021":true,"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver":true,"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName":true,"@aws-cdk/core:target-partitions":["aws","aws-cn"],"aws:cdk:enable-path-metadata":true,"aws:cdk:enable-asset-metadata":true,"aws:cdk:version-reporting":true,"aws:cdk:bundling-stacks":["*"]}',
  CDK_OUTDIR: 'cdk.out',
  CDK_CLI_ASM_VERSION: '16.0.0',
  CDK_CLI_VERSION: '2.15.0'
}
✅  Run `cargo check`: 1.86s
🍺  Building Rust code...
🎯  Cross-compile `rust-standalone`: 10.26s

✨  Synthesis time: 17.23s

Reading existing template for stack RustStandaloneStack.
Retrieved account ID 1234567890 from disk cache
Assuming role 'arn:aws:iam::1234567890:role/cdk-hnb659fds-lookup-role-1234567890-us-east-1'.
[AWS ssm 200 0.734s 0 retries] getParameter({ Name: '/cdk-bootstrap/hnb659fds/version' })
[AWS cloudformation 200 0.247s 0 retries] describeStacks({ StackName: 'RustStandaloneStack' })
[AWS cloudformation 200 0.994s 0 retries] getTemplate({ StackName: 'RustStandaloneStack', TemplateStage: 'Original' })
RustStandaloneStack: deploying...
Retrieved account ID 1234567890 from disk cache
Assuming role 'arn:aws:iam::1234567890:role/cdk-hnb659fds-deploy-role-1234567890-us-east-1'.
Waiting for stack CDKToolkit to finish creating or updating...
[AWS cloudformation 200 0.457s 0 retries] describeStacks({ StackName: 'CDKToolkit' })
[AWS cloudformation 200 2.084s 1 retries] getTemplate({ StackName: 'RustStandaloneStack', TemplateStage: 'Original' })
[AWS ssm 200 0.21s 0 retries] getParameter({ Name: '/cdk-bootstrap/hnb659fds/version' })
[0%] start: Publishing ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac:current_account-current_region
Retrieved account ID 1234567890 from disk cache
Assuming role 'arn:aws:iam::1234567890:role/cdk-hnb659fds-file-publishing-role-1234567890-us-east-1'.
[AWS cloudformation 200 1.015s 1 retries] describeStacks({ StackName: 'CDKToolkit' })
[0%] check: Check s3://cdk-hnb659fds-assets-1234567890-us-east-1/ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip
[AWS s3 200 0.2s 0 retries] getBucketLocation({ Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1' })
[AWS s3 200 0.176s 0 retries] listObjectsV2({
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Prefix: 'ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip',
  MaxKeys: 1
})
[AWS s3 200 0.162s 0 retries] getBucketEncryption({ Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1' })
[0%] cached: From cache /Users/rnag/CLionProjects/rust-aws-cdk-lambda/cdk-examples/rust-standalone/cdk.out/.cache/ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip
[0%] upload: Upload s3://cdk-hnb659fds-assets-1234567890-us-east-1/ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip
[AWS s3 200 0.203s 0 retries] createMultipartUpload({
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Key: 'ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip',
  ContentType: 'application/zip',
  ServerSideEncryption: 'aws:kms',
  SSEKMSKeyId: undefined
})
[AWS s3 200 0.785s 1 retries] createMultipartUpload({
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Key: 'ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip',
  ContentType: 'application/zip',
  ServerSideEncryption: 'aws:kms',
  SSEKMSKeyId: undefined
})
[AWS s3 200 0.841s 0 retries] uploadPart({
  Body: <Buffer 45 2f ef 50 27 7f 1b c6 af 77 fc 6c bd ba ce 19 65 66 e3 b3 5a 6f eb ce 6c be 63 8d cf 6c 3e ab 7f 8b eb b4 02 be 07 57 c3 35 f0 23 f8 09 dc 08 ad df ... 1087932 more bytes>,
  ContentLength: 1087982,
  PartNumber: 2,
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Key: 'ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip',
  UploadId: '7asd959UN7TCrugqfia_T2yrgYLVE5DyhAPjgIjbmjMuAef33BD_CW_erOr0eDb2XJAq92fetzye.DoRkWj2nj3D9Yhy5N3aTP_B6ZbQAh7VWjRPTl5lCd8iSMjdccvgwqR7O.5H07QqQ1AYo0QNVw--'
})
[AWS s3 200 0.755s 0 retries] uploadPart({
  Body: <Buffer 45 2f ef 50 27 7f 1b c6 af 77 fc 6c bd ba ce 19 65 66 e3 b3 5a 6f eb ce 6c be 63 8d cf 6c 3e ab 7f 8b eb b4 02 be 07 57 c3 35 f0 23 f8 09 dc 08 ad df ... 1087932 more bytes>,
  ContentLength: 1087982,
  PartNumber: 2,
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Key: 'ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip',
  UploadId: '9ebmuStsJJEWfFRw2NXuEELkeaq5pu1.2HHcUy6XQcL_WODrog_6HzrsI_uqzN3UkKXu.tJLtVaqQW.qVT3p1h8mW4u9iSc6XzlJHp_9QzhjcwF7QlHgs560pLEvMU54eZjnXFOTekhgXHZWESJfDg--'
})
[AWS s3 200 1.383s 0 retries] uploadPart({
  Body: <Buffer 50 4b 03 04 14 00 08 00 08 00 00 00 21 00 00 00 00 00 00 00 00 00 00 00 00 00 09 00 00 00 62 6f 6f 74 73 74 72 61 70 ec 7d 0b 78 14 d5 dd f7 2c c9 c2 ... 5242830 more bytes>,
  ContentLength: 5242880,
  PartNumber: 1,
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Key: 'ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip',
  UploadId: '7asd959UN7TCrugqfia_T2yrgYLVE5DyhAPjgIjbmjMuAef33BD_CW_erOr0eDb2XJAq92fetzye.DoRkWj2nj3D9Yhy5N3aTP_B6ZbQAh7VWjRPTl5lCd8iSMjdccvgwqR7O.5H07QqQ1AYo0QNVw--'
})
[AWS s3 400 0.195s 0 retries] completeMultipartUpload({
  MultipartUpload: {
    Parts: [
      { ETag: null, PartNumber: 1 },
      { ETag: '"7ec273b6eeff48c007f37b4f43953657"', PartNumber: 2 },
      [length]: 2
    ]
  },
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Key: 'ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip',
  UploadId: '9ebmuStsJJEWfFRw2NXuEELkeaq5pu1.2HHcUy6XQcL_WODrog_6HzrsI_uqzN3UkKXu.tJLtVaqQW.qVT3p1h8mW4u9iSc6XzlJHp_9QzhjcwF7QlHgs560pLEvMU54eZjnXFOTekhgXHZWESJfDg--'
})
[50%] fail: The XML you provided was not well-formed or did not validate against our published schema
[50%] start: Publishing 4deda35e5537c9624f414071740afcedfde6d03a99970eed4f8620c2bf3d8ef9:current_account-current_region
Retrieved account ID 1234567890 from disk cache
[50%] check: Check s3://cdk-hnb659fds-assets-1234567890-us-east-1/4deda35e5537c9624f414071740afcedfde6d03a99970eed4f8620c2bf3d8ef9.json
[AWS s3 204 0.186s 0 retries] abortMultipartUpload({
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Key: 'ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip',
  UploadId: '9ebmuStsJJEWfFRw2NXuEELkeaq5pu1.2HHcUy6XQcL_WODrog_6HzrsI_uqzN3UkKXu.tJLtVaqQW.qVT3p1h8mW4u9iSc6XzlJHp_9QzhjcwF7QlHgs560pLEvMU54eZjnXFOTekhgXHZWESJfDg--'
})
[AWS s3 200 0.183s 0 retries] listObjectsV2({
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Prefix: '4deda35e5537c9624f414071740afcedfde6d03a99970eed4f8620c2bf3d8ef9.json',
  MaxKeys: 1
})
[50%] found: Found s3://cdk-hnb659fds-assets-1234567890-us-east-1/4deda35e5537c9624f414071740afcedfde6d03a99970eed4f8620c2bf3d8ef9.json
[100%] success: Published 4deda35e5537c9624f414071740afcedfde6d03a99970eed4f8620c2bf3d8ef9:current_account-current_region

 ❌  RustStandaloneStack failed: Error: Failed to publish one or more assets. See the error messages above for more information.
    at publishAssets (/Users/rnag/.nvm/versions/node/v16.14.0/lib/node_modules/aws-cdk/lib/util/asset-publishing.ts:27:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at CloudFormationDeployments.publishStackAssets (/Users/rnag/.nvm/versions/node/v16.14.0/lib/node_modules/aws-cdk/lib/api/cloudformation-deployments.ts:418:7)
    at CloudFormationDeployments.deployStack (/Users/rnag/.nvm/versions/node/v16.14.0/lib/node_modules/aws-cdk/lib/api/cloudformation-deployments.ts:299:5)
    at CdkToolkit.deploy (/Users/rnag/.nvm/versions/node/v16.14.0/lib/node_modules/aws-cdk/lib/cdk-toolkit.ts:208:24)
    at initCommandLine (/Users/rnag/.nvm/versions/node/v16.14.0/lib/node_modules/aws-cdk/lib/cli.ts:310:12)

Failed to publish one or more assets. See the error messages above for more information.
Error: Failed to publish one or more assets. See the error messages above for more information.
    at publishAssets (/Users/rnag/.nvm/versions/node/v16.14.0/lib/node_modules/aws-cdk/lib/util/asset-publishing.ts:27:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at CloudFormationDeployments.publishStackAssets (/Users/rnag/.nvm/versions/node/v16.14.0/lib/node_modules/aws-cdk/lib/api/cloudformation-deployments.ts:418:7)
    at CloudFormationDeployments.deployStack (/Users/rnag/.nvm/versions/node/v16.14.0/lib/node_modules/aws-cdk/lib/api/cloudformation-deployments.ts:299:5)
    at CdkToolkit.deploy (/Users/rnag/.nvm/versions/node/v16.14.0/lib/node_modules/aws-cdk/lib/cdk-toolkit.ts:208:24)
    at initCommandLine (/Users/rnag/.nvm/versions/node/v16.14.0/lib/node_modules/aws-cdk/lib/cli.ts:310:12)
[AWS s3 404 1.431s 0 retries] uploadPart({
  Body: <Buffer 50 4b 03 04 14 00 08 00 08 00 00 00 21 00 00 00 00 00 00 00 00 00 00 00 00 00 09 00 00 00 62 6f 6f 74 73 74 72 61 70 ec 7d 0b 78 14 d5 dd f7 2c c9 c2 ... 5242830 more bytes>,
  ContentLength: 5242880,
  PartNumber: 1,
  Bucket: 'cdk-hnb659fds-assets-1234567890-us-east-1',
  Key: 'ac3d55bd904cf4bc92553e6549bf6e7e181c18ad7ddba14bf7017ec16962e1ac.zip',
  UploadId: '9ebmuStsJJEWfFRw2NXuEELkeaq5pu1.2HHcUy6XQcL_WODrog_6HzrsI_uqzN3UkKXu.tJLtVaqQW.qVT3p1h8mW4u9iSc6XzlJHp_9QzhjcwF7QlHgs560pLEvMU54eZjnXFOTekhgXHZWESJfDg--'
})

You've probably solved this by now, but am posting for other visitors. I found this other page which seems to be related. It resolved it for me at least: https://github.com/aws/aws-cdk/issues/19287

From what I saw in both yours and my CDK verbose logs was this key block:

MultipartUpload: {
    Parts: [
      { ETag: null, PartNumber: 1 },
      { ETag: '"7ec273b6eeff48c007f37b4f43953657"', PartNumber: 2 },
      [length]: 2
    ]
},

From what I read in the comments on that page and elsewhere is that to use the node.js createMultipartUpload() command from the AWS SDK, each part must have a specified ETag value. However, for some reason node.js v16.14.0 appears to leave anything but the last part's ETag as 'null'. (My CDK upload file that triggered this issue had three parts, only the last part had an ETag value specified.)

By rolling back my node.js version to v16.3.0 as suggested on that page, my CDK deploy functioned normally by inserting ETag values correctly.

It's possible this has something to do with local configuration, but changing the node.js version does appear to consistently resolve the issue. If someone finds a fix that supports all node.js versions, please update here for others to find.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM