0

directory permisions

Earlier I ran apt update and upgrade as a root user and since then this issue is persisting

Running with gitlab-runner 12.3.0 (a8a019e0)
on test runner XXXXXXXX
Using Shell executor...

Running on IP-XX-XXX-XXX-XXX…

Fetching changes with git depth set to 50...
Initialized empty Git repository in /home/gitlab-runner/builds/XXXXXXXX/0/XXXXXXXX/XXXX-XXXX/.git/
Created fresh repository.
From http://XX-XXX-XXX-XXX/XXX/XXXX
 * [new branch]        master     -> origin/master
Checking out 2dca3aec as master...
Skipping Git submodules setup

Checking the cache for default...
Runtime platform

arch=amd64 os=linux pid=6537 revision=a8a019e0 version=12.3.0

No URL provided, the cache will not be downloaded from the shared cache server. Instead, a local version of the cache will be extracted. 
Successfully extracted cache

    $ apt-get update -yqq

E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
ERROR: Job failed: exit status 1
Eliah Kagan
  • 117,780
  • 2
    That doesn't look like root. If you want to know what is happening, why are you hiding helpful output by using -yqq? – user535733 Sep 28 '19 at 18:28
  • This really doesn't belong here, it should probably be on the docker Stack. Privileges aren't the problem in this case since the gitlab-runner docker executor is running as root on the container. I haven't been able to determine if it's an issue with the container spinning up or with something happening in another container, because if you re run the pipeline it works as expected most of the time, granted it might have to be reran multiple times. – Mark Carpenter Jr Sep 15 '20 at 19:45

1 Answers1

1

Run the apt-get command with sudo:

sudo apt-get update

If the error persists, do the following:

sudo rm -rf /var/lib/apt/lists/lock

and then run the apt-get command with sudo as described above.