Behavior
When I run my pipeline I get an error which seems to stem from downloading the cache. The strange thing is that I ran the exact same pipeline with the same .gitlab-ci.yml
5 days ago and it worked.
Output
Running with gitlab-runner 16.3.0~beta.108.g2b6048b4 (2b6048b4)
on green-3.saas-linux-small-amd64.runners-manager.gitlab.com/default Jhc_Jxvh, system ID: s_0e6850b2bce1
feature flags: FF_USE_IMPROVED_URL_MASKING:true, FF_RESOLVE_FULL_TLS_CHAIN:false
Preparing the "docker+machine" executor
Using Docker executor with image python:latest ...
Pulling docker image python:latest ...
Using docker image sha256:b94d01b4929562a35cdcfe80ca0d5fca222c3fdedf224af9a079dc23157e1363 for python:latest with digest python@sha256:2e376990a11f1c1e03796d08db0e99c36eadb4bb6491372b227f1e53c3482914 ...
Preparing environment
Running on runner-jhcjxvh-project-48253555-concurrent-0 via runner-jhcjxvh-s-l-s-amd64-1695810143-7d606df9...
Getting source from Git repository 00:01
Fetching changes with git depth set to 20...
Initialized empty Git repository in /builds/dotblocks/Corrosion/.git/
Created fresh repository.
Checking out c37a3e2d as detached HEAD (ref is 4-correct-the-size-float-list-condition-in-dynamics-function)...
Skipping Git submodules setup
$ git remote set-url origin "${CI_REPOSITORY_URL}"
Restoring cache 00:02
Checking cache for default-non_protected...
Downloading cache from https://storage.googleapis.com/gitlab-com-runners-cache/project/48253555/default-non_protected
WARNING: venv/bin/python: chmod venv/bin/python: no such file or directory (suppressing repeats)
Successfully extracted cache
Executing "step_script" stage of the job script 00:02
Using docker image sha256:b94d01b4929562a35cdcfe80ca0d5fca222c3fdedf224af9a079dc23157e1363 for python:latest with digest python@sha256:2e376990a11f1c1e03796d08db0e99c36eadb4bb6491372b227f1e53c3482914 ...
$ python --version
Python 3.11.5
$ python -m venv venv
$ source venv/bin/activate
$ cd Code
$ pip install black
/usr/bin/bash: line 142: /builds/dotblocks/Corrosion/venv/bin/pip: cannot execute: required file not found
Cleaning up project directory and file based variables 00:01
ERROR: Job failed: exit code 1
Config
- Using GitLab.com
- Just took the
Python
CI example and simplified it to only runblack
on the code
.gitlab-ci.yml
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/python/tags/
image: python:latest
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/topics/caching/
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
cache:
paths:
- .cache/pip
- venv/
before_script: # Array of commands that should run before each job’s script commands, but after artifacts are restored
- python --version # For debugging
- python -m venv venv
- source venv/bin/activate
- cd Code
stages: # List of stages for jobs, and their order of execution
- test
black:
stage: test
script:
- pip install black
- black --check -- sikou examples benches
Additional steps
I looked at the url where the runner is trying to download the cache from and it yields an error.
Error
<Error>
<Code>AccessDenied</Code>
<Message>Access denied.</Message>
<Details>
Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object. Permission 'storage.objects.get' denied on resource (or it may not exist).
</Details>
</Error>
If anybody has any clue as to what is going on that would be awesome