Skip to content
This repository has been archived by the owner on Apr 30, 2023. It is now read-only.

Error: EACCES: permission denied, mkdir '/github/workspace/cdk.out/... #36

Closed
Zerquix18 opened this issue Jun 17, 2021 · 4 comments · Fixed by #37
Closed

Error: EACCES: permission denied, mkdir '/github/workspace/cdk.out/... #36

Zerquix18 opened this issue Jun 17, 2021 · 4 comments · Fixed by #37

Comments

@Zerquix18
Copy link

After the issue #34 and its fix, my cdk deploy is failing. This is the log:

/usr/bin/docker run --name a33c19dbca94ca3ab4e7c98455b8a12129b63_e22f5a --label 8a33c1 --workdir /github/workspace --rm -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION -e INPUT_CDK_SUBCOMMAND -e INPUT_CDK_STACK -e INPUT_CDK_ARGS -e INPUT_ACTIONS_COMMENT -e INPUT_CDK_VERSION -e INPUT_WORKING_DIR -e INPUT_DEBUG_LOG -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/artemis-backend-cdk/artemis-backend-cdk":"/github/workspace" 8a33c1:9dbca94ca3ab4e7c98455b8a12129b63

added 1 package, changed 1 package, and audited 918 packages in 4s

5 vulnerabilities (3 moderate, 2 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
Install aws-cdk latest
Successful install aws-cdk latest
Run cdk deploy --require-approval never "master"
Error: EACCES: permission denied, mkdir '/github/workspace/cdk.out/asset.130affe0e7fc73d165ddf7c340794cc0e67641ecb839650a3cc8cfc207b898e4'
    at Object.mkdirSync (fs.js:1009:3)
    at AssetStaging.stageAsset (/github/workspace/node_modules/@aws-cdk/core/lib/asset-staging.ts:327:10)
    at AssetStaging.stageByCopying (/github/workspace/node_modules/@aws-cdk/core/lib/asset-staging.ts:251:10)
    at stageThisAsset (/github/workspace/node_modules/@aws-cdk/core/lib/asset-staging.ts:168:35)
    at Cache.obtain (/github/workspace/node_modules/@aws-cdk/core/lib/private/cache.ts:24:13)
    at new AssetStaging (/github/workspace/node_modules/@aws-cdk/core/lib/asset-staging.ts:191:44)
    at new Asset (/github/workspace/node_modules/@aws-cdk/aws-s3-assets/lib/asset.ts:128:21)
    at AssetCode.bind (/github/workspace/node_modules/@aws-cdk/aws-lambda/lib/code.ts:251:20)
    at new Function (/github/workspace/node_modules/@aws-cdk/aws-lambda/lib/function.ts:572:29)
    at new ApiLambdaResolver (/github/workspace/lib/ApiLambdaResolver/index.ts:43:28)
Subprocess exited with error 1
CDK subcommand deploy for stack master has failed. See above console output for more details.

There's an action before that one, using actions/checkout@v2. Not sure if that's interfering. I tried to add permissions with chmod but I'm not sure what's going on.

@FDR123
Copy link
Contributor

FDR123 commented Jun 17, 2021

We also ran into that issue with some of our workflows. Unfortunately we did not have enough time to really do a deep dive, so the short workaround solution was another fork and manually downgrading the alpine version to 3.13 and than using that fork in our workflows. I guess #35 should work in most cases, but it seems that there are some cases in which the access rights of the files are clashing

Fork:
https://github.com/UpperCampus/aws-cdk-github-actions

The change that "fixes" it
UpperCampus@458af1f

@FDR123
Copy link
Contributor

FDR123 commented Jun 18, 2021

@youyo it seems that it's not working reliable with alpine 3.14, do you think it might make sense to merge this fork onto master. With 3.13 it is working reliable for me?

@youyo
Copy link
Owner

youyo commented Jun 21, 2021

@FDR123
Sorry for the late reply.
I've decided to use 3.13 to prioritize getting it working.
I released v2.0.2

birtles added a commit to birchill/aws-cdk-github-actions that referenced this issue Jun 21, 2021
@FDR123
Copy link
Contributor

FDR123 commented Jun 21, 2021

@youyo Thanks for taking care of it!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants