[GH-ISSUE #759] problem with secret file and docker socket #479

Closed
opened 2026-03-01 21:43:46 +03:00 by kerem · 9 comments
Owner

Originally created by @orcutt989 on GitHub (Jul 20, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/759

image catthehacker/ubuntu:full-20.04
act version 0.2.23

If I put --secret-file ~/path/to/.env in the ~/.actrc and do a act pull_request, act doesn't seem to be able to parse it. However if I do a act --secret-file .env it parses the secrets fine.

When I attempt to do an npm install I get a

[Pulumi/Preview] ⭐  Run npm install
[Pulumi/Preview]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/username/src/currentdirectory/workflow/3] user=
| npm WARN checkPermissions Missing write access to /Users/username/src/currentdirectory
| npm WARN currentdirectory@ No repository field.
| npm WARN currentdirectory@ No license field.
|
| npm ERR! code EACCES
| npm ERR! syscall access
| npm ERR! path /Users/username/src/currentdirectory
| npm ERR! errno -13
| npm ERR! Error: EACCES: permission denied, access '/Users/username/src/currentdirectory'
| npm ERR!  [Error: EACCES: permission denied, access '/Users/username/src/currentdirectory'] {
| npm ERR!   errno: -13,
| npm ERR!   code: 'EACCES',
| npm ERR!   syscall: 'access',
| npm ERR!   path: '/Users/username/src/currentdirectory'
| npm ERR! }
| npm ERR!
| npm ERR! The operation was rejected by your operating system.
| npm ERR! It is likely you do not have the permissions to access this file as the current user
| npm ERR!
| npm ERR! If you believe this might be a permissions issue, please double-check the
| npm ERR! permissions of the file and its containing directories, or try running
| npm ERR! the command again as root/Administrator.
|
| npm ERR! A complete log of this run can be found in:
| npm ERR!     /home/runner/.npm/_logs/2021-07-20T21_14_10_144Z-debug.log
[Pulumi/Preview]   ❌  Failure - npm install
Error: exit with `FAILURE`: 243

I'm hoping to not have to sudo npm install as this is not something that needs to be done in GitHub actions.

If I do a act -b --secret-file .env pull_request it gets further, but then I get a docker socket problem when I run Pulumi. I've already confirmed with @catthehacker that it is not an image problem.

error: time="2021-07-20T18:25:01Z" level=error msg="failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: 

Thanks!

Originally created by @orcutt989 on GitHub (Jul 20, 2021). Original GitHub issue: https://github.com/nektos/act/issues/759 `image` catthehacker/ubuntu:full-20.04 `act version` 0.2.23 If I put `--secret-file ~/path/to/.env` in the `~/.actrc` and do a `act pull_request`, act doesn't seem to be able to parse it. However if I do a `act --secret-file .env` it parses the secrets fine. When I attempt to do an `npm install` I get a ```bash [Pulumi/Preview] ⭐ Run npm install [Pulumi/Preview] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/username/src/currentdirectory/workflow/3] user= | npm WARN checkPermissions Missing write access to /Users/username/src/currentdirectory | npm WARN currentdirectory@ No repository field. | npm WARN currentdirectory@ No license field. | | npm ERR! code EACCES | npm ERR! syscall access | npm ERR! path /Users/username/src/currentdirectory | npm ERR! errno -13 | npm ERR! Error: EACCES: permission denied, access '/Users/username/src/currentdirectory' | npm ERR! [Error: EACCES: permission denied, access '/Users/username/src/currentdirectory'] { | npm ERR! errno: -13, | npm ERR! code: 'EACCES', | npm ERR! syscall: 'access', | npm ERR! path: '/Users/username/src/currentdirectory' | npm ERR! } | npm ERR! | npm ERR! The operation was rejected by your operating system. | npm ERR! It is likely you do not have the permissions to access this file as the current user | npm ERR! | npm ERR! If you believe this might be a permissions issue, please double-check the | npm ERR! permissions of the file and its containing directories, or try running | npm ERR! the command again as root/Administrator. | | npm ERR! A complete log of this run can be found in: | npm ERR! /home/runner/.npm/_logs/2021-07-20T21_14_10_144Z-debug.log [Pulumi/Preview] ❌ Failure - npm install Error: exit with `FAILURE`: 243 ``` I'm hoping to not have to `sudo npm install` as this is not something that needs to be done in GitHub actions. If I do a `act -b --secret-file .env pull_request` it gets further, but then I get a docker socket problem when I run Pulumi. I've already confirmed with @catthehacker that it is not an image problem. ``` error: time="2021-07-20T18:25:01Z" level=error msg="failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: ``` Thanks!
kerem 2026-03-01 21:43:46 +03:00
Author
Owner

@catthehacker commented on GitHub (Jul 20, 2021):

act doesn't handle non-root users well yet, and since full image is using runner user just like GitHub Actions it breaks in many places, it's tracked in #398

<!-- gh-comment-id:883720023 --> @catthehacker commented on GitHub (Jul 20, 2021): `act` doesn't handle non-root users well *yet*, and since full image is using `runner` user just like GitHub Actions it breaks in many places, it's tracked in #398
Author
Owner

@orcutt989 commented on GitHub (Jul 20, 2021):

Gotcha! What are some possible workarounds that don't involve me changing the current workflow files from what GitHub Actions uses.

I see something in that post about using a script to crate users and such, but maybe there's a simpler way.

<!-- gh-comment-id:883727795 --> @orcutt989 commented on GitHub (Jul 20, 2021): Gotcha! What are some possible workarounds that don't involve me changing the current workflow files from what GitHub Actions uses. I see something in that post about using a script to crate users and such, but maybe there's a simpler way.
Author
Owner

@catthehacker commented on GitHub (Jul 20, 2021):

as for the bind -b, it doesn't work because macOS uses a VM and operates it via TCP instead of UNIX socket and DOCKER_* envvars are not forwarded to container.
Currently there is no workaround for any of those issues

<!-- gh-comment-id:883731140 --> @catthehacker commented on GitHub (Jul 20, 2021): as for the bind `-b`, it doesn't work because macOS uses a VM and operates it via TCP instead of UNIX socket and `DOCKER_*` envvars are not forwarded to container. Currently there is no workaround for any of those issues
Author
Owner

@orcutt989 commented on GitHub (Jul 20, 2021):

Ok so temporarily I could just throw in a run su - into my local ci files?

<!-- gh-comment-id:883738290 --> @orcutt989 commented on GitHub (Jul 20, 2021): Ok so temporarily I could just throw in a run su - into my local ci files?
Author
Owner

@catthehacker commented on GitHub (Jul 20, 2021):

that should work

<!-- gh-comment-id:883740732 --> @catthehacker commented on GitHub (Jul 20, 2021): that should work
Author
Owner

@orcutt989 commented on GitHub (Jul 20, 2021):

Argh didnt work. Act just hangs at

[Pulumi/Preview]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/username/src/currentdirectory/workflow/0] user=
<!-- gh-comment-id:883759249 --> @orcutt989 commented on GitHub (Jul 20, 2021): Argh didnt work. Act just hangs at ``` [Pulumi/Preview] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/username/src/currentdirectory/workflow/0] user= ```
Author
Owner

@orcutt989 commented on GitHub (Jul 21, 2021):

su - is waiting for password. sudo su should switch runner to root, but act also hangs on this as well if i add a run: sudo su

<!-- gh-comment-id:883834091 --> @orcutt989 commented on GitHub (Jul 21, 2021): `su -` is waiting for password. `sudo su` should switch `runner` to `root`, but act also hangs on this as well if i add a `run: sudo su`
Author
Owner

@orcutt989 commented on GitHub (Jul 21, 2021):

I switched to the medium image catthehacker/ubuntu:act-latest and that seems to user the root user, but now it doesnt seem like my npm install is working.

<!-- gh-comment-id:883837172 --> @orcutt989 commented on GitHub (Jul 21, 2021): I switched to the medium image `catthehacker/ubuntu:act-latest` and that seems to user the root user, but now it doesnt seem like my `npm install` is working.
Author
Owner

@orcutt989 commented on GitHub (Jul 21, 2021):

Nevermind it was because aws wasn't installed in the medium image.

<!-- gh-comment-id:883846205 --> @orcutt989 commented on GitHub (Jul 21, 2021): Nevermind it was because `aws` wasn't installed in the medium image.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#479
No description provided.