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

The image aws-sam-cli-build-image is incompatible with BitBucket Pipelines #2160

Closed
eladb opened this issue Jul 30, 2020 · 1 comment
Closed

Comments

@eladb
Copy link

eladb commented Jul 30, 2020

Transferred from the AWS CDK: aws/aws-cdk#9351

Reported by: @SergKam

After upgrade to cdk 1.55.0 where it stats using amazon/aws-sam-cli-build-image-nodejs by default,
building NodejsFunction in BitBucket Pipelines fails with the error.
Container ID 1230228 cannot be mapped to a host ID
The BitBucket docs https://community.atlassian.com/t5/Bitbucket-articles/Changes-to-make-your-containers-more-secure-on-Bitbucket/ba-p/998464
says

UID/GIDs that are placed on files must be in the range 0-65535.
If you recieve this error, you will need to perform a fix on the image that has this invalid UID/GID.

Error Log

...
FAIL projects/stack/ZolarStack.test.ts (33.221s)
  ● ZolarStack › ECS Cluster Created
    [Status 1] stdout: 
    stderr: Sending build context to Docker daemon   2.56kB
    Step 1/8 : ARG IMAGE=amazon/aws-sam-cli-build-image-nodejs12.x
    Step 2/8 : FROM $IMAGE
    latest: Pulling from amazon/aws-sam-cli-build-image-nodejs12.x
    cb4a6ee8d388: Pulling fs layer
...
    34ee856b181e: Download complete
    latest: Pulling from amazon/aws-sam-cli-build-image-nodejs12.x
    cb4a6ee8d388: Pulling fs layer
....
    34ee856b181e: Download complete
    failed to register layer: Error processing tar file(exit status 1): Container ID 1230228 cannot be mapped to a host ID
      323 |     createFrontendDeployLambda() {
      324 |         //===== Deploy frontend lambda =====
    > 325 |         const feLambda = new NodejsFunction(this, this.ns("FECreateLambda"), {
          |                          ^
      326 |             entry: `${__dirname}/lambdas/deploy-fe-resource/index.ts`,
      327 |             runtime: Runtime.NODEJS_12_X,
      328 |             memorySize: 512,
      at dockerExec (node_modules/@aws-cdk/core/lib/bundling.ts:241:13)
      at Function.fromAsset (node_modules/@aws-cdk/core/lib/bundling.ts:86:20)
      at Function.parcel (node_modules/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts:113:43)
      at new NodejsFunction (node_modules/@aws-cdk/aws-lambda-nodejs/lib/function.ts:78:24)
      at ZolarStack.createFrontendDeployLambda (projects/stack/ZolarStack.ts:325:26)
      at new ZolarStack (projects/stack/ZolarStack.ts:54:14)
      at Object.<anonymous> (projects/stack/ZolarStack.test.ts:10:23)
Test Suites: 1 failed, 4 passed, 5 total
Tests:       1 failed, 8 passed, 9 total
Snapshots:   0 total
Time:        262.721s
Ran all test suites.
npm ERR! Test failed.  See above for more details.

Environment

  • CLI Version : 1.55.0
  • Framework Version: 1.55.0
  • Node.js Version: 12
  • OS : lambci/lambda:build-nodejs12.x
  • Language (Version): TypeScript (3.8.3)

This is 🐛 Bug Report

@jfuss jfuss transferred this issue from aws/serverless-application-model Aug 7, 2020
@jfuss
Copy link
Contributor

jfuss commented Aug 7, 2020

Duplicate of #2125

Closing

@jfuss jfuss closed this as completed Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants