Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Gitea actions mkdir /toolcache permission denied in second job (container) #32410

Open
stuzer05 opened this issue Nov 3, 2024 · 0 comments
Open
Labels
topic/gitea-actions related to the actions of Gitea type/bug

Comments

@stuzer05
Copy link

stuzer05 commented Nov 3, 2024

Description

I have 1 workflow with 2 jobs

name: test

on:
    - push

jobs:
    frontend:
        runs-on: ubuntu-latest
        container:
            image: node:18
            env:
                RUNNER_TOOL_CACHE: /toolcache
        steps:
            - uses: actions/checkout@v3

            - uses: actions/setup-go@v3
              with:
                  go-version: '1.23'

            - uses: seepine/hash-files@v1
              id: get-hash
              with:
                patterns: package-lock.json

            - uses: actions/cache@v4
              with:
                  path: node_modules
                  key: ${{ runner.os }}-npm-${{ steps.get-hash.outputs.hash }}
            - run: npm install
            - run: npm run gulp-prod

    backend:
        runs-on: ubuntu-latest
        container:
            image: cimg/php:8.3-node
            env:
                RUNNER_TOOL_CACHE: /toolcache
                DB_CONNECTION: mysql
                DB_DATABASE: laravel
                DB_USERNAME: root
                DB_PASSWORD: root

        services:
            mysql:
                image: mysql:latest
                ports:
                    - 3306/tcp
                env:
                    MYSQL_DATABASE: laravel
                    MYSQL_ROOT_PASSWORD: root
                options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

        steps:
            - uses: actions/checkout@v3
              with:
                  submodules: "true"
                  token: ${{ secrets.GIT_TOKEN }}

            - run: cp .env.ci .env

            - uses: actions/setup-go@v3
              with:
                  go-version: '1.23'

            - uses: seepine/hash-files@v1
              id: get-hash
              with:
                patterns: composer.lock

            - uses: actions/cache@v4
              with:
                  path: vendor
                  key: ${{ runner.os }}-composer-${{ steps.get-hash.outputs.hash }}

            - run: composer install --no-progress --prefer-dist --optimize-autoloader
            - run: php artisan key:generate
            - run: php artisan migrate --seed
            - run: php artisan test

frontend job uses gitea's ubuntu-latest label and actions/setup-go@v3 works fine

but actions/setup-go@v3 crashes on backend job, which uses container image image: cimg/php:8.3-node

Setup go version spec 1.23
Attempting to download 1.[2](https://gitea.stuzer.link/Euroline/b2b.euroline.ltd/actions/runs/181/jobs/1#jobstep-3-2)3...
matching 1.23...
Acquiring 1.2[3](https://gitea.stuzer.link/Euroline/b2b.euroline.ltd/actions/runs/181/jobs/1#jobstep-3-3).2 from https://github.com/actions/go-versions/releases/download/1.23.2-111[4](https://gitea.stuzer.link/Euroline/b2b.euroline.ltd/actions/runs/181/jobs/1#jobstep-3-4)5922912/go-1.23.2-linux-x64.tar.gz
Extracting Go...
[command]/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /tmp/18e3f49f-00b0-42bf-8fe7-9f8fc30b90aa -f /tmp/0a30f9[5](https://gitea.stuzer.link/Euroline/b2b.euroline.ltd/actions/runs/181/jobs/1#jobstep-3-5)1-e425-41aa-958e-2dc0ed5baf1b
Successfully extracted go to /tmp/18e3f49f-00b0-42bf-8fe7-9f8fc30b90aa
Adding to the cache ...
EACCES: permission denied, mkdir '/toolcache'
Falling back to download directly from Go
Install from dist
Acquiring go1.23.2 from https://storage.googleapis.com/golang/go1.23.2.linux-amd[6](https://gitea.stuzer.link/Euroline/b2b.euroline.ltd/actions/runs/181/jobs/1#jobstep-3-6)4.tar.gz
Extracting Go...
[command]/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /tmp/428596c0-73f9-495e-81c1-29a41c33ff27 -f /tmp/8dfbaf06-8258-4c14-b6d3-132f[7](https://gitea.stuzer.link/Euroline/b2b.euroline.ltd/actions/runs/181/jobs/1#jobstep-3-7)db466c7
Successfully extracted go to /tmp/428596c0-73f9-495e-81c1-29a41c33ff27
Adding to the cache ...
::error::Failed to download version 1.23: Error: EACCES: permission denied, mkdir '/toolcache'

mkdir error not happening if i comment RUNNER_TOOL_CACHE: /toolcache. But at the same time cache becomes unavailable

what could be the problem?

Gitea Version

1.23.0+dev-613-g259811617b

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker

Database

PostgreSQL

@Zettat123 Zettat123 added the topic/gitea-actions related to the actions of Gitea label Nov 4, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
topic/gitea-actions related to the actions of Gitea type/bug
Projects
None yet
Development

No branches or pull requests

2 participants