Gitea in a Docker container, fails at actions/setup-python@v4

I installed Gitea today, enabled actions, and migrated my repo. When the action runs it always fails during actions/setup-python@v4 with this error:

::group::Installed versions
Version 3.9.2 was not found in the local cache
::error::The version ‘3.9.2’ with architecture ‘x64’ was not found for this operating system.%0AThe list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

I have python installed on the host machine, in the Gitea container and in the Gitea runner container. It probably doesn’t matter but I thought I should mention it.

I tried every single version of Python, nothing changed. Python does exists, I confirmed it by including:

steps:
  - run: python3 --version

at the beginning of the steps, it returns Python 3.9.2

Here’s the docker compose:

version: "3"

networks:
  gitea:
    external: false

services:
  server:
    image: gitea/gitea:1.20.5
    container_name: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - GITEA__database__DB_TYPE=postgres
      - GITEA__database__HOST=db:5432
      - GITEA__database__NAME=gitea
      - GITEA__database__USER=gitea
      - GITEA__database__PASSWD=gitea
    restart: always
    networks:
      - gitea
    volumes:
      - /home/pi/server/gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - "3012:3000"
      - "222:22"
    depends_on:
      - db

  db:
    image: postgres:14
    restart: always
    environment:
      - POSTGRES_USER=gitea
      - POSTGRES_PASSWORD=gitea
      - POSTGRES_DB=gitea
    networks:
      - gitea
    volumes:
      - ./postgres:/var/lib/postgresql/data

  runner:
    image: gitea/act_runner:latest
    container_name: gitea_runner3
    environment:
      - CONFIG_FILE=/config.yaml
      - GITEA_INSTANCE_URL=http://192.168.1.10:3012
      - GITEA_RUNNER_REGISTRATION_TOKEN=N5dYKpDbM3GWgHiqDuWjnqHjllE1nWWJVcJkiySn
      - GITEA_RUNNER_NAME 
      - GITEA_RUNNER_LABELS
      - USER_UID=1000
      - USER_GID=1000

    volumes:
      - /home/pi/server/gitea/runner/config.yaml:/config.yaml
      - /home/pi/server/gitea:/data
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - "8088:8088"

And here’s the beginning of the workflow main.yml:

name: Build

on: [push, workflow_dispatch]

jobs:
  build:
    runs-on: ubuntu-22.04

    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.9.2'

I followed the documentation as best as I could, I spent hours on this. Now I give up. I would really appreciate any help.
Why is this happening? How do I fix it?

Mind you, the same script works fine on Github.

So I fixed this by using another image like so:

jobs:
  build:
    runs-on: ubuntu-22.04
    container:
      image: catthehacker/ubuntu:act-22.04

However, I have a new problem. Later in the workflow main.yml I have:

run: set -e -o pipefail 

Which results in an error:

/var/run/act/workflow/10.sh: 2: set: Illegal option -o pipefail

I tried to fix permissions for a file called “build” which starts with this shebang:

#!/usr/bin/env python3
run: chmod -R +x build
run: chmod -R +x ./build

nothing changed.

I then tried to change permissions for the whole directory seen in the error message:

run: chmod -R +x /var/run/act/workflow/

Also didn’t help.

What do I do here? Thank you

I fixed the previous issue by running the following two commands:

echo "dash dash/sh boolean false" | debconf-set-selections
dpkg-reconfigure dash

Why doesn’t this happen on Github? I didn’t need to do this.

Github will create a virtual machine. But Gitea will create a container. They are different implementation.

1 Like