Hello,
My build is failing on every execution on the “sudo apt-get update” command.
Here is the full output of the failing step:
#!/bin/bash --login
sudo apt-get update
Get:1 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB]
Ign:2 http://deb.debian.org/debian stretch InRelease
Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
Get:4 http://deb.debian.org/debian stretch-backports InRelease [91.8 kB]
Get:5 http://deb.debian.org/debian stretch Release [118 kB]
Get:6 http://deb.debian.org/debian stretch Release.gpg [2410 B]
Get:7 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [613 kB]
Get:8 http://deb.debian.org/debian stretch-updates/main amd64 Packages.diff/Index [14.9 kB]
Get:9 http://deb.debian.org/debian stretch-updates/main amd64 Packages [2596 B]
Get:10 http://deb.debian.org/debian stretch-backports/main amd64 Packages.diff/Index [28.5 kB]
Get:10 http://deb.debian.org/debian stretch-backports/main amd64 Packages.diff/Index [28.5 kB]
Get:11 http://deb.debian.org/debian stretch-backports/main amd64 Packages [612 kB]
Get:12 http://deb.debian.org/debian stretch/main amd64 Packages [7080 kB]
Reading package lists… Done
E: Could not open file /var/lib/apt/lists/deb.debian.org_debian_dists_stretch-backports_main_binary-amd64_Packages.diff_Index - open (2: No such file or directory)
Exited with code exit status 100
CircleCI received exit code 100
I looked around and found this workaround but I’m confused on what this is supposed to do. Can someone explain to me why this works to solve the issue?
opened 07:38PM - 26 Feb 19 UTC
closed 09:13PM - 26 Feb 19 UTC
### Orb version
v1.0.1
### What happened
when I run the steps
```ya… ml
steps:
- gcp-cli/install
- gcp-cli/initialize
```
I get the error: `error gcloud: command not found`
#### step: Install
the install step seems to have completed without any issue
#### step: initialize
I get the error: `error gcloud: command not found`
output:
```bash
#!/bin/bash -eo pipefail
# Set sudo to work whether logged in as root user or non-root user
if [[ $EUID == 0 ]]; then export SUDO=""; else export SUDO="sudo"; fi
# Store service account
echo $GCLOUD_SERVICE_KEY > ${HOME}/gcloud-service-key.json
# Initialize gcloud CLI
$SUDO gcloud auth activate-service-account --key-file=${HOME}/gcloud-service-key.json
$SUDO gcloud --quiet config set project $GCLOUD_PROJECT_ID
$SUDO gcloud --quiet config set compute/zone $GCLOUD_PROJECT_REGION
sudo: gcloud: command not found
Exited with code 1
```
### Expected behavior
```bash
Activated service account credentials for: [ ---CREDENTIAL--- ]
Updated property [core/project].
Updated property [compute/zone].
```
Notes:
----
In my account the error started today Feb 26th 2019
Thank you!!
1 Like
[SOLUTION] The fix is explained here : https://github.com/CircleCI-Public/gcp-cli-orb/issues/5
It seems that the first time apt-get udpate
is run, it does fail. So you should run it a second time (don’t ask me why)
To fix your config file, you should find and replace apt-get update
by ( sudo apt-get update || sudo apt-get update )
In my config file, I had
- run:
name: Install GEOS
command: |
sudo apt-get update
sudo apt-get install libgeos++
I changed it to
- run:
name: Install GEOS
command: |
( sudo apt-get update || sudo apt-get update )
sudo apt-get install libgeos++
It worked for me, hope that helps
Cheers
Thanks for reporting. We’ve created a response here .