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

v2 fail inside container - Error: ENOENT: no such file or directory, mkdir #771

Closed
retzero opened this issue Apr 19, 2022 · 4 comments
Closed

Comments

@retzero
Copy link

retzero commented Apr 19, 2022

Hello.

Latest v2 tag failed with below reason when using the container w/ different user as host's.
Could you please guide me how to resolve this?

Error: ENOENT: no such file or directory, mkdir
  • v2 : Fail

  • v2.4.0: Success

  • options: --user root : Success

  • Workflows

      build
        container:
          image: cimg/go:1.16
          #options: --user root
        runs-on: "self-hosted"
        steps:
          - name: Prepare Permissions
            run: |
              sudo chown circleci:circleci -R $PWD
              sudo chown circleci:circleci -R /github/home
          - uses: actions/checkout@v2
          #- uses: actions/checkout@v2.4.0
  • Full debug prints

##[debug]Evaluating condition for step: 'Run actions/checkout@v2'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Run actions/checkout@v2
##[debug]Register post job cleanup for action: actions/checkout@v2
##[debug]Loading inputs
##[debug]Evaluating: github.repository
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'repository'
##[debug]=> 'TestUser/actions-playground'
##[debug]Result: 'TestUser/actions-playground'
##[debug]Evaluating: github.token
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run actions/checkout@v2
/usr/bin/docker exec  46f2eb79330a929feab7784f34738fa069469621037d9dff7b29c819e2e7ed11 sh -c "cat /etc/*release | grep ^ID"
##[debug]ID=ubuntu
##[debug]ID_LIKE=debian
##[debug]Running JavaScript Action with default external tool: node12
::save-state name=isPost::true
##[debug]Save intra-action state isPost = true
##[debug]GITHUB_WORKSPACE = '/__w/actions-playground/actions-playground'
##[debug]qualified repository = 'TestUser/actions-playground'
##[debug]ref = 'refs/heads/master'
##[debug]commit = '36251678f2fb04ca2cd3c316c7650c63665272f8'
##[debug]clean = true
##[debug]fetch depth = 1
##[debug]lfs = false
##[debug]submodules = false
##[debug]recursive submodules = false
::add-matcher::/__w/_actions/actions/checkout/v2/dist/problem-matcher.json
##[debug]Added matchers: 'checkout-git'. Problem matchers scan action output for known warning or error strings and report these inline.
Syncing repository: TestUser/actions-playground
::group::Getting Git version info
Getting Git version info
::add-mask::***
##[debug]Unsetting HOME override
::remove-matcher owner=checkout-git::
##[debug]Removed matchers: 'checkout-git'
##[debug]Enhanced Annotations not enabled on the server. The 'title', 'end_line', and 'end_column' fields are unsupported.
Error: ENOENT: no such file or directory, mkdir
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Run actions/checkout@v2
@retzero retzero changed the title v2 fail inside container - Error: ENOENT: no such file or directory, mkdir v2 fail inside container - Error: ENOENT: no such file or directory, mkdir Apr 19, 2022
@TingluoHuang
Copy link
Member

the checkout actions v2.4.1 is trying to create a temp global gitconfig at $RUNNER_TEMP, but looks like the container image you are using has some folder ownership mismatch which causes the checkout actions can't write the the $RUNNER_TEMP directory.

drwxr-xr-x 3 1001 121 4096 Apr 20 03:12 _actions
drwxr-xr-x 3 1001 121 4096 Apr 20 03:12 _PipelineMapping
drwxr-xr-x 5 1001 121 4096 Apr 20 03:13 _temp

Error: EACCES: permission denied, mkdir '/__w/_temp/b021b966-392f-42d4-8fd9-f85e29b91dc0'

@retzero
Copy link
Author

retzero commented Apr 20, 2022

the checkout actions v2.4.1 is trying to create a temp global gitconfig at $RUNNER_TEMP, but looks like the container image you are using has some folder ownership mismatch which causes the checkout actions can't write the the $RUNNER_TEMP directory.

Thank you for the feedback. So what to do next on my side?

@TingluoHuang
Copy link
Member

@retzero we are working on adding a new input to allow you to turn off the behavior in #770

You can try it out by

- use: actions/checkout@users/tihuang/setsafedirinput
  with:
    set-safe-directory: false 

@retzero
Copy link
Author

retzero commented Apr 25, 2022

Thanks. Latest v2 works with set-safe-directory: false option.

@retzero retzero closed this as completed Apr 25, 2022
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