[aws-lambda-nodejs] .parcel-cache permission denied in BitBucket Pipelines
See original GitHub issueBitbucket Pipeline failed to create NodejsFunction in docker. When I attempt to create a lambda using that construct and synthesize, I get an error [Error: EACCES: permission denied, mkdir ‘/asset-input/.parcel-cache’]
Reproduction Steps
import * as cdk from '@aws-cdk/core';
import * as nodejs from '@aws-cdk/aws-lambda-nodejs';
export class BugStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
new nodejs.NodejsFunction(this, 'handler');
}
}
The handler a bit complex to show here, but it is irrelevant.
Error Log
> zolar-cdk@1.0.0 deploy /opt/atlassian/pipelines/agent/build/.cdk
> cdk --trace deploy "-a" "projects/sfbridge/create.js"
Bundling asset dev-serg-test-sfbridge/dev-serg-test-sfbridge-sf-zpc-bridge/Code/Stage...
[Error: EACCES: permission denied, mkdir '/asset-input/.parcel-cache'] {
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/asset-input/.parcel-cache'
}
/opt/atlassian/pipelines/agent/build/.cdk/node_modules/@aws-cdk/core/lib/asset-staging.js:123
throw new Error(`Failed to run bundling Docker image for asset ${this.node.path}: ${err}`);
^
Error: Failed to run bundling Docker image for asset dev-serg-test-sfbridge/dev-serg-test-sfbridge-sf-zpc-bridge/Code/Stage: Error: docker exited with status 1
at AssetStaging.bundle (/opt/atlassian/pipelines/agent/build/.cdk/node_modules/@aws-cdk/core/lib/asset-staging.js:123:19)
at new AssetStaging (/opt/atlassian/pipelines/agent/build/.cdk/node_modules/@aws-cdk/core/lib/asset-staging.js:38:35)
at new Asset (/opt/atlassian/pipelines/agent/build/.cdk/node_modules/@aws-cdk/aws-s3-assets/lib/asset.js:21:25)
at AssetCode.bind (/opt/atlassian/pipelines/agent/build/.cdk/node_modules/@aws-cdk/aws-lambda/lib/code.js:137:26)
at new Function (/opt/atlassian/pipelines/agent/build/.cdk/node_modules/@aws-cdk/aws-lambda/lib/function.js:80:33)
at new NodejsFunction (/opt/atlassian/pipelines/agent/build/.cdk/node_modules/@aws-cdk/aws-lambda-nodejs/lib/function.js:30:13)
at ZolarSFBridge.scheduleLambda (/opt/atlassian/pipelines/agent/build/.cdk/projects/sfbridge/ZolarSFBridge.js:34:24)
at new ZolarSFBridge (/opt/atlassian/pipelines/agent/build/.cdk/projects/sfbridge/ZolarSFBridge.js:29:14)
at Object.<anonymous> (/opt/atlassian/pipelines/agent/build/.cdk/projects/sfbridge/create.js:7:19)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
Subprocess exited with error 1
Environment
- CLI Version : 1.53.0
- Framework Version: 1.53.0
- Node.js Version: 12
- OS : lambci/lambda:build-nodejs12.x
- Language (Version): TypeScript (3.8.3)
Other
looks related to #8757
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:18 (8 by maintainers)
Top Results From Across the Web
SOLVED Pipeline Build Node JS fails with "permission denied ...
Solved: Doing a pipeline build with Node ( image : node:10.15.3) . First script command is to install a global dependency. That fails...
Read more >Permission denied from Bitbucket pipeline - Stack Overflow
The issue is that the file was not given the correct execution permissions before it was checked into BitBucket.
Read more >Cloning another Bitbucket repository in Bitbucket Pipelines
Our main repository now has read-only permissions to clone my-submodules from within its Pipelines. After the above configuration, executing a ...
Read more >Deploying using Bitbucket Pipelines - AWS Documentation
Configure your Bitbucket Pipeline to deploy AWS SAM applications. ... your bitbucket-pipelines.yml file must contain lines that do the following:.
Read more >Bitbucket Pipelines - Cypress Documentation
What you'll learn How to run Cypress tests with Bitbucket Pipelines as part of CI/CD ... Visibility into test failures via quick access...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jogold — I was using
docker executor
, I change it tomachine executor
, and now is working! 🎉 🍻Working Code
Not Working Code
Thank you for the help!
So, not sure if it helps anyone else, but I found I was having this similar issue. I had a direct “dependency” in my package.json to parcel and parcel-bundler. Removing those (and a
rm -rf node_modules && npm i
) resolved the issue for me.Hope that helps someone else.