[GH-ISSUE #1822] mkdir /.m2 permission denied #888

Closed
opened 2026-03-01 21:47:10 +03:00 by kerem · 2 comments
Owner

Originally created by @andre15silva on GitHub (May 25, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1822

Bug report info

act version:            0.2.45
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 128
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
	/var/run/docker.sock
Config files:
Build info:
	Go version:            go1.18.10
	Module path:           github.com/nektos/act
	Main version:          (devel)
	Main path:             github.com/nektos/act
	Main checksum:
	Build settings:
		-compiler:            gc
		-ldflags:             -s -w -X main.version=0.2.45 -X main.commit=f1df2ca5d6b315935cf9bb0d2a989175adf4e894 -X main.date=2023-05-01T02:18:49Z -X main.builtBy=goreleaser
		CGO_ENABLED:          0
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
		vcs:                  git
		vcs.revision:         f1df2ca5d6b315935cf9bb0d2a989175adf4e894
		vcs.time:             2023-05-01T02:18:34Z
		vcs.modified:         false
Docker Engine:
	Engine version:        20.10.21
	Engine runtime:        runc
	Cgroup version:        1
	Cgroup driver:         cgroupfs
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Ubuntu 20.04.6 LTS
	OS type:               linux
	OS version:            20.04
	OS arch:               x86_64
	OS kernel:             5.4.0-146-generic
	OS CPU:                128
	OS memory:             515580 MB
	Security options:
		name=apparmor
		name=seccomp,profile=default

Command used with act

act -P ubuntu-latest=catthehacker/ubuntu:full-latest --rm --bind --container-options '-u 1012:1013' -W .github/workflows/ci.yml

Describe issue

I am trying to run act on the latest commit of https://github.com/perwendel/spark.

Locally, in my machine, I am able to do so without any errors.
However, when I try to run it on a server, it fails due to lack of permission to create a new directory in the root directory of the docker container.

I have tried searching for similar issues, but no solution worked so far.

Thanks in advance :))

https://github.com/perwendel/spark

Workflow content

name: Spark Framework CI

on:
  push:
  pull_request:

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        java: [ '1.8', '1.9', '1.10', '1.11' ]
    name: Java Version ${{ matrix.java }}
    steps:
      - uses: actions/checkout@master
      - name: Setup java
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
          architecture: x64
      - run: ./mvnw test

Relevant log output

[Spark Framework CI/Java Version 1.10-3] [DEBUG] Working directory '/tmp/spark'
[Spark Framework CI/Java Version 1.9-2 ]   💬  ::debug::finished caching tool
[Spark Framework CI/Java Version 1.9-2 ]   ❓ add-matcher /run/act/actions/actions-setup-java@v1/.github/java.json
| creating settings.xml with server-id: github; environment variables: username=$GITHUB_ACTOR, password=$GITHUB_TOKEN, and gpg-passphrase=null
[Spark Framework CI/Java Version 1.9-2 ]   ❗  ::error::EACCES: permission denied, mkdir '/.m2'
[Spark Framework CI/Java Version 1.9-2 ]   ❌  Failure - Main Setup java
[Spark Framework CI/Java Version 1.9-2 ]   ⚙  ::set-env:: JAVA_HOME_9.0.7_x64=/opt/hostedtoolcache/jdk/9.0.7/x64
[Spark Framework CI/Java Version 1.9-2 ]   ⚙  ::set-env:: JAVA_HOME=/opt/hostedtoolcache/jdk/9.0.7/x64
[Spark Framework CI/Java Version 1.9-2 ]   ⚙  ::set-env:: JAVA_HOME_9_0_7_X64=/opt/hostedtoolcache/jdk/9.0.7/x64
[Spark Framework CI/Java Version 1.9-2 ]   ⚙  ::set-output:: path=/opt/hostedtoolcache/jdk/9.0.7/x64
[Spark Framework CI/Java Version 1.9-2 ]   ⚙  ::set-output:: version=9.0.7
[Spark Framework CI/Java Version 1.9-2 ]   ⚙  ::add-path:: /opt/hostedtoolcache/jdk/9.0.7/x64/bin
[Spark Framework CI/Java Version 1.9-2 ] exitcode '1': failure

Additional information

No response

Originally created by @andre15silva on GitHub (May 25, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1822 ### Bug report info ```plain text act version: 0.2.45 GOOS: linux GOARCH: amd64 NumCPU: 128 Docker host: DOCKER_HOST environment variable is not set Sockets found: /var/run/docker.sock Config files: Build info: Go version: go1.18.10 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -compiler: gc -ldflags: -s -w -X main.version=0.2.45 -X main.commit=f1df2ca5d6b315935cf9bb0d2a989175adf4e894 -X main.date=2023-05-01T02:18:49Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: f1df2ca5d6b315935cf9bb0d2a989175adf4e894 vcs.time: 2023-05-01T02:18:34Z vcs.modified: false Docker Engine: Engine version: 20.10.21 Engine runtime: runc Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Ubuntu 20.04.6 LTS OS type: linux OS version: 20.04 OS arch: x86_64 OS kernel: 5.4.0-146-generic OS CPU: 128 OS memory: 515580 MB Security options: name=apparmor name=seccomp,profile=default ``` ### Command used with act ```sh act -P ubuntu-latest=catthehacker/ubuntu:full-latest --rm --bind --container-options '-u 1012:1013' -W .github/workflows/ci.yml ``` ### Describe issue I am trying to run act on the latest commit of https://github.com/perwendel/spark. Locally, in my machine, I am able to do so without any errors. However, when I try to run it on a server, it fails due to lack of permission to create a new directory in the root directory of the docker container. I have tried searching for similar issues, but no solution worked so far. Thanks in advance :)) ### Link to GitHub repository https://github.com/perwendel/spark ### Workflow content ```yml name: Spark Framework CI on: push: pull_request: jobs: build: runs-on: ubuntu-latest strategy: fail-fast: false matrix: java: [ '1.8', '1.9', '1.10', '1.11' ] name: Java Version ${{ matrix.java }} steps: - uses: actions/checkout@master - name: Setup java uses: actions/setup-java@v1 with: java-version: ${{ matrix.java }} architecture: x64 - run: ./mvnw test ``` ### Relevant log output ```sh [Spark Framework CI/Java Version 1.10-3] [DEBUG] Working directory '/tmp/spark' [Spark Framework CI/Java Version 1.9-2 ] 💬 ::debug::finished caching tool [Spark Framework CI/Java Version 1.9-2 ] ❓ add-matcher /run/act/actions/actions-setup-java@v1/.github/java.json | creating settings.xml with server-id: github; environment variables: username=$GITHUB_ACTOR, password=$GITHUB_TOKEN, and gpg-passphrase=null [Spark Framework CI/Java Version 1.9-2 ] ❗ ::error::EACCES: permission denied, mkdir '/.m2' [Spark Framework CI/Java Version 1.9-2 ] ❌ Failure - Main Setup java [Spark Framework CI/Java Version 1.9-2 ] ⚙ ::set-env:: JAVA_HOME_9.0.7_x64=/opt/hostedtoolcache/jdk/9.0.7/x64 [Spark Framework CI/Java Version 1.9-2 ] ⚙ ::set-env:: JAVA_HOME=/opt/hostedtoolcache/jdk/9.0.7/x64 [Spark Framework CI/Java Version 1.9-2 ] ⚙ ::set-env:: JAVA_HOME_9_0_7_X64=/opt/hostedtoolcache/jdk/9.0.7/x64 [Spark Framework CI/Java Version 1.9-2 ] ⚙ ::set-output:: path=/opt/hostedtoolcache/jdk/9.0.7/x64 [Spark Framework CI/Java Version 1.9-2 ] ⚙ ::set-output:: version=9.0.7 [Spark Framework CI/Java Version 1.9-2 ] ⚙ ::add-path:: /opt/hostedtoolcache/jdk/9.0.7/x64/bin [Spark Framework CI/Java Version 1.9-2 ] exitcode '1': failure ``` ### Additional information _No response_
kerem 2026-03-01 21:47:10 +03:00
Author
Owner

@andre15silva commented on GitHub (May 25, 2023):

We (cc @Nfsaavedra) have narrowed down this issue to the Linux user identifiers.

In our local machines, since we are the only and first users of the machine, our users have a uid of 1000.
This is the same uid of user runneradmin inside the catthehacker/ubuntu:full-latest containers.

When we execute the same command on remote servers (where our uids are different from 1000), we observe this error.
Even when we set it to run on -u 1000:1000, it still reports other errors that we suspect are related with permissions too (since we are trying to execute with a uid different from our own).

We are patching this issue locally by adding a layer on top of the original image, but this is sub-optimal.
Would you have a proper solution alternative to patch this bug in act?

<!-- gh-comment-id:1563162374 --> @andre15silva commented on GitHub (May 25, 2023): We (cc @Nfsaavedra) have narrowed down this issue to the Linux user identifiers. In our local machines, since we are the only and first users of the machine, our users have a uid of 1000. This is the same uid of user `runneradmin` inside the `catthehacker/ubuntu:full-latest` containers. When we execute the same command on remote servers (where our uids are different from 1000), we observe this error. Even when we set it to run on `-u 1000:1000`, it still reports other errors that we suspect are related with permissions too (since we are trying to execute with a uid different from our own). We are patching this issue locally by adding a layer on top of the original image, but this is sub-optimal. Would you have a proper solution alternative to patch this bug in act?
Author
Owner

@github-actions[bot] commented on GitHub (Nov 22, 2023):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:1821889554 --> @github-actions[bot] commented on GitHub (Nov 22, 2023): Issue is stale and will be closed in 14 days unless there is new activity
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#888
No description provided.