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

Ubuntu:full-20.04 - mkdir: Permission denied, cannot create directory _actions. #9

Closed
airvzxf opened this issue May 17, 2021 · 6 comments · Fixed by nektos/act#701
Closed

Comments

@airvzxf
Copy link

airvzxf commented May 17, 2021

I am executing this image with act.

When I use the version catthehacker/ubuntu:full-20.04 it is failing at the start because it is running as the use runner and not as a root.

Note: Interesting the original GitHub action is executing as a runner that means this copy is very similar to the original (https://github.com/airvzxf/bose-connect-app-linux/runs/2596465956).

Ubuntu full-20.04:

$ act -s GITHUB_TOKEN="${GITHUB_TOKEN}" -P ubuntu-latest=catthehacker/ubuntu:full-20.04
[CMake/build] 🚀  Start image=catthehacker/ubuntu:full-20.04
[CMake/build]   🐳  docker run image=catthehacker/ubuntu:full-20.04 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[CMake/build] ⭐  Run whoami
| runner
[CMake/build]   ✅  Success - whoami
[CMake/build] ⭐  Run actions/checkout@v2
[CMake/build]   ☁  git clone 'https://github.com/actions/checkout' # ref=v2
[CMake/build]   🐳  docker cp src=/home/wolf/.cache/act/actions-checkout@v2/ dst=/home/wolf/workspace/projects/bose-connect-app-linux/_actions/actions-checkout@v2/
| mkdir: cannot create directory '/home/wolf/workspace/projects/bose-connect-app-linux/_actions': Permission denied
[CMake/build]   ❌  Failure - actions/checkout@v2
Error: exit with `FAILURE`: 1

Ubuntu act-latest:

$ act -s GITHUB_TOKEN="${GITHUB_TOKEN}" -P ubuntu-latest=catthehacker/ubuntu:act-latest
[CMake/build] 🚀  Start image=catthehacker/ubuntu:act-latest                                                                           
[CMake/build]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]     
[CMake/build] ⭐  Run whoami                                                                                                           
| root                                                                                                                                 
[CMake/build]   ✅  Success - whoami                                                                                                   
[CMake/build] ⭐  Run actions/checkout@v2                                                                                              
[CMake/build]   ☁  git clone 'https://github.com/actions/checkout' # ref=v2                                                            
[CMake/build]   🐳  docker cp src=/home/wolf/.cache/act/actions-checkout@v2/ dst=/home/wolf/workspace/projects/bose-connect-app-linux/_
actions/actions-checkout@v2/                                                                                                           
[CMake/build]   ❓  ::save-state name=isPost,::true                                                                                    
[CMake/build]   💬  ::debug::GITHUB_WORKSPACE = '/home/wolf/workspace/projects/bose-connect-app-linux'                                 
[CMake/build]   💬  ::debug::qualified repository = 'airvzxf/bose-connect-app-linux'
[CMake/build]   💬  ::debug::ref = 'refs/heads/main'
[CMake/build]   💬  ::debug::commit = 'e6b3b1aa5657834e41c022710a33ecc60c5d44b9'
[CMake/build]   💬  ::debug::clean = true
[CMake/build]   💬  ::debug::fetch depth = 1
[CMake/build]   💬  ::debug::lfs = false
[CMake/build]   💬  ::debug::submodules = false
[CMake/build]   💬  ::debug::recursive submodules = false
[CMake/build]   ❓  ::add-matcher::/home/wolf/workspace/projects/bose-connect-app-linux/_actions/actions-checkout@v2/dist/problem-match

YAML file

name: CMake

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  workflow_dispatch:

env:
  BUILD_TYPE: Release

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - run: whoami
    - uses: actions/checkout@v2
    # More steps added but not showed in this representation.

Display current directory

$ ls -lha
total 68K
drwxr-xr-x  5 wolf users 4.0K May 16 18:57 .
drwxr-xr-x 27 wolf users 4.0K May 14 19:37 ..
-rw-r--r--  1 wolf users 2.4K May 15 23:40 DETAILS.md
drwxr-xr-x  8 wolf users 4.0K May 16 19:06 .git
drwxr-xr-x  3 wolf users 4.0K May 16 16:49 .github
-rw-r--r--  1 wolf users  35K May 14 16:14 LICENSE
-rw-r--r--  1 wolf users 3.2K May 16 16:48 README.md
drwxr-xr-x 10 wolf users 4.0K May 16 18:40 src
-rw-r--r--  1 wolf users 1.3K May 16 15:53 TODO.md
@catthehacker
Copy link
Owner

That's because act does not supports running actions as non-root account.

@airvzxf
Copy link
Author

airvzxf commented May 17, 2021

Do you know how to use your image to test my GitHub work flow?
I really was very disappointed to the null solutions to test locally the workflows. I used GitLab, it has basically the same problem but at least I can get the official setup and images.

@catthehacker
Copy link
Owner

It can probably work if you change default user via docker build

FROM catthehacker/ubuntu:full-20.04
USER root

or older versions of act should work since those used static path for project

@catthehacker
Copy link
Owner

Should be fixed in act soon

@catthehacker
Copy link
Owner

Fixed in nektos/act@d794e2f

@airvzxf
Copy link
Author

airvzxf commented May 25, 2021

Thank you, Hacker Cat!

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

Successfully merging a pull request may close this issue.

2 participants