do-agent: Silent installation failure with defunct apt repos

Please only create a Github issue for bugs related to the code itself. If you are experiencing an issue with sending metrics, display graphs, errors from the agent, etc, please contact https://cloudsupport.digitalocean.com/s/ so we can provide support

Before opening an issue, make sure there is not a similar issue already open

Describe the problem

Installation silently fails when there are defunct entries in sources.list

Steps to reproduce

Uninstall do-agent. Add a defunct repo to sources.list and try to install. I ran into this with a packagecloud.io repo that no longer existed.

Expected behavior

Should still install or at least produce an error message to remove old entries from sources.

System Information

Distribution and version: Ubuntu 14.04

do-agent information:

None because it didn’t install.

I was able to resolve by manually removing the old entries from /etc/apt/sources.list and /etc/apt/sources.d/[offending repo].list

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (5 by maintainers)

Commits related to this issue

Most upvoted comments

You should be able to workaround this issue by using HTTP (do this at your own risk - since you do give up a bit by switching to HTTP) for the APT repo instead of HTTPS. Below are commands to update the sources file appropriately. There will most likely not be an official change to the agent to use http for APT for Ubuntu 14.04 since it has reached EOL.

sed -i 's/https/http/g' /etc/apt/sources.list.d/digitalocean-agent.list
sudo apt-get update
sudo apt-get install do-agent

Please let me know if this does not work for you (or if you are seeing this error on a distro other than Ubuntu 14.04)

Hi I found the same issue on Ubuntu 14.04 after trying to upgrade the Metrics Agent.

Problem:

$ curl -sSL https://insights.nyc3.cdn.digitaloceanspaces.com/install.sh | sudo bash
Cleaning up old sources...OK
Verifying machine compatability...OK
Verifying compatability with script...OK
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package do-agent
Installing apt repository...
Installing gpg key...OK
W: Failed to fetch https://repos.insights.digitalocean.com/apt/do-agent/dists/main/main/binary-amd64/Packages  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

W: Failed to fetch https://repos.insights.digitalocean.com/apt/do-agent/dists/main/main/binary-i386/Packages  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

E: Some index files failed to download. They have been ignored, or old ones used instead.

I inspected the install.sh script and i was able reproduce the problem sending the command at line 59:

apt-get -qq update -o Dir::Etc::sourcelist="sources.list.d/digitalocean-agent.list"

The response was:

W: Failed to fetch https://repos.insights.digitalocean.com/apt/do-agent/dists/main/main/binary-amd64/Packages  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

W: Failed to fetch https://repos.insights.digitalocean.com/apt/do-agent/dists/main/main/binary-i386/Packages  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

E: Some index files failed to download. They have been ignored, or old ones used instead.

Solution:

I fixed my problem, dowloading the .sh script and replacing the https with http on line 17 After launching another time the script, it worked for me. I think it could be a temporary cert problem on the repo.

Below all the commands:

curl -L -o ./install.sh https://insights.nyc3.cdn.digitaloceanspaces.com/install.sh
sed -i '17s/https/http/' install.sh
chmod 775 install.sh 
./install.sh

I hope it can help someone

Likewise:

Ign https://repos.insights.digitalocean.com main InRelease                     
Ign https://repos.insights.digitalocean.com main Release.gpg                   
Ign https://repos.insights.digitalocean.com main Release                       
Err https://repos.insights.digitalocean.com main/main i386 Packages            
  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
Ign https://repos.insights.digitalocean.com main/main Translation-en_US
Ign https://repos.insights.digitalocean.com main/main Translation-en
W: Failed to fetch https://repos.insights.digitalocean.com/apt/do-agent/dists/main/main/binary-    i386/Packages  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile:     none

E: Some index files failed to download. They have been ignored, or old ones used instead.

sudo apt update can’t complete.

@lucafas Works for me. Thanks.

Okay I was able to reproduce the problem and fix it. I’ll be pushing a fix shortly.