Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Monitoring agent installation failing

I tried installing monitoring agent multiple times using both Google Cloud console & Command Line. None of the approach worked.

My OS Version:

Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye

Installation Logs:

curl -sSO https://dl.google.com/cloudagents/add-monitoring-agent-repo.sh
sudo bash add-monitoring-agent-repo.sh --also-install
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://security.debian.org/debian-security bullseye-security InRelease
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Hit:4 http://packages.cloud.google.com/apt cloud-sdk-bullseye InRelease
Hit:5 http://deb.debian.org/debian bullseye-backports InRelease
Hit:6 http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-bullseye InRelease
Hit:7 http://packages.cloud.google.com/apt google-compute-engine-bullseye-stable InRelease
Ign:8 https://packages.cloud.google.com/apt google-cloud-monitoring-bullseye-all InRelease
Hit:9 https://packages.cloud.google.com/apt google-cloud-ops-agent-bullseye-all InRelease
Err:10 https://packages.cloud.google.com/apt google-cloud-monitoring-bullseye-all Release
404 Not Found [IP: 142.250.182.206 443]
Reading package lists... Done
E: The repository 'https://packages.cloud.google.com/apt google-cloud-monitoring-bullseye-all Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
[2022-06-25T11:55:24+0530] Could not refresh the google-cloud-monitoring apt repositories.
Please check your network connectivity and make sure you are running a supported
debian distribution. See https://cloud.google.com/monitoring/agent/#supported_operating_systems
for a list of supported platforms.

0 6 2,909
6 REPLIES 6

I did a search inside Google's internal knowledge base on your error and found a match.  It appears that the correct recipe is:

curl -sSO https://dl.google.com/cloudagents/add-google-cloud-ops-agent-repo.sh
sudo bash add-google-cloud-ops-agent-repo.sh --also-install

 This seems distinct from your recipe.

Thank you for your quick response. It does not seem to resolve the problem. I am getting the same error with your solution. Although your solution seems correct, the root cause is one of the package which is not accessible it seems.

Err:10 https://packages.cloud.google.com/apt google-cloud-monitoring-bullseye-all Release
404 Not Found [IP: 172.217.166.78 443]

Also the commands I had used were from the documentation:
https://cloud.google.com/monitoring/agent/monitoring/installation

Oh my ... ok ... some new news.   If we attempted to run the "old recipe" and it fails and then we try and run the "new" recipe, apparently that too will fail ... because there is "left over" stuff from the original old recipe failure.   In a post inside Google support, I found a recipe ... I have no proof that it is right or will help ... but here it is:

> ---- snip ----

The second real problem which I ran into, was once you figure out usually on your own you've installed the wrong thing. You find the correct ops agent script and you try to install the ops agent and it fails. The reason it fails is because its getting 404 from the legacy monitoring agent source list. If you don't do the below, the correct script will continue to fail due to the 404 of the previous install script sources.

d@instance-2:~$ ls /etc/apt/sources.list.d/
gce_sdk.list  google-cloud-monitoring.list  google-cloud-ops-agent.list  google-cloud.list

d@instance-2:~$ sudo rm /etc/apt/sources.list.d/google-cloud-monitoring.list 

 

Thanks for your help! Managed to install it with following commands:

curl -sSO https://dl.google.com/cloudagents/add-google-cloud-ops-agent-repo.sh
sudo rm /etc/apt/sources.list.d/google-cloud-monitoring.list
sudo bash add-google-cloud-ops-agent-repo.sh --also-install 

 

I have a similar issue. I get this error.

bigboy2002@instance-2:~$ sudo bash add-google-cloud-ops-agent-repo.sh --also-install 
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://deb.debian.org/debian bullseye-updates InRelease                                                 
Hit:3 http://deb.debian.org/debian bullseye-backports InRelease                                               
Hit:4 http://security.debian.org/debian-security bullseye-security InRelease                                  
Hit:5 http://packages.cloud.google.com/apt google-compute-engine-bullseye-stable InRelease                    
Hit:6 http://packages.cloud.google.com/apt cloud-sdk-bullseye InRelease                                       
Hit:7 https://packages.cloud.google.com/apt google-cloud-ops-agent-bullseye-all InRelease                     
Hit:9 https://dl.yarnpkg.com/debian stable InRelease                                                          
Get:8 https://ftp.nluug.nl/db/mariadb/mariadb-10.9.5/repo/debian bullseye InRelease [4,634 B]
Hit:10 https://d17k9fuiwb52nc.cloudfront.net bullseye InRelease
Err:8 https://ftp.nluug.nl/db/mariadb/mariadb-10.9.5/repo/debian bullseye InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F1656F24C74CD1D8
Reading package lists... Done
W: GPG error: https://ftp.nluug.nl/db/mariadb/mariadb-10.9.5/repo/debian bullseye InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F1656F24C74CD1D8
E: The repository 'http://mirror.mariadb.org/repo/10.9/debian bullseye InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
[2023-03-23T00:43:35+0000] Could not refresh the google-cloud-ops-agent apt repositories.
Please check your network connectivity and make sure you are running a supported
debian distribution. See https://cloud.google.com/stackdriver/docs/solutions/ops-agent/#supported_operating_systems
for a list of supported platforms.

 

If you encounter difficulties when upgrading Ops-agent, it is recommended to first uninstall the older version and then proceed with the reinstallation process.

curl -sSO https://dl.google.com/cloudagents/add-google-cloud-ops-agent-repo.sh
sudo rm /etc/apt/sources.list.d/google-cloud-ops-agent.list
sudo bash add-google-cloud-ops-agent-repo.sh --also-install