On attempting to install the Google Logging Agent on Debian 10, I receive the following error.
root@10e0e5d1d15d:/opt/app# sudo bash add-logging-agent-repo.sh --also-install
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Hit:4 https://packages.cloud.google.com/apt google-cloud-logging-buster-all InRelease
Hit:5 https://deb.nodesource.com/node_16.x buster InRelease
Hit:6 https://packages.cloud.google.com/apt google-cloud-ops-agent-buster-all InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package google-fluentd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'google-fluentd' has no installation candidate
[2021-10-20T13:41:30+0000] google-fluentd google-fluentd-catch-all-config installation failed.
I am attempting to install this inside a Docker container based on python:3.6-buster.
I've double checked the version of Debian:
root@10e0e5d1d15d:/opt/app# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
Any idea what's wrong here?
Google clearly states that Debian 10 is supported by the logging agent here.
Attempt 2
So I ran through the troubleshooting guide and verified that the credentials have been installed correctly on the VM. Specifically, that the service account file exists at /etc/google/auth/application_default_credentials.json and although not necessary, set in the environment via GOOGLE_APPLICATION_CREDENTIALS.
Additionally, I have checked that the service account has the correct permissions: Logs Writer & Monitoring Metrics Writer.
Despite this, when I run the command (as specified in the docs to verify auth scopes (https://cloud.google.com/logging/docs/agent/logging/authorization):
curl --silent --connect-timeout 1 -f -H "Metadata-Flavor: Google" http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/scopes
It returns nothing. An empty result. Not sure why?
When I attempt to install the agent with the --verbose flag, I get the following error:
Hit:2 http://deb.debian.org/debian bullseye InRelease
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Ign:4 https://packages.cloud.google.com/apt google-cloud-logging-bullseye-all InRelease
Err:5 https://packages.cloud.google.com/apt google-cloud-logging-bullseye-all Release
404 Not Found [IP: 142.250.179.238 443]
Reading package lists... Done
E: The repository 'https://packages.cloud.google.com/apt google-cloud-logging-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.
+ refresh_failed apt debian
+ local REPO_TYPE=apt
+ local OS_FAMILY=debian
+ fail 'Could not refresh the google-cloud-logging apt repositories.
Please check your network connectivity and make sure you are running a supported
debian distribution. See https://cloud.google.com/logging/docs/agent/#agent-os-list
for a list of supported platforms.'
++ date +%Y-%m-%dT%H:%M:%S%z
+ echo '[2021-10-22T11:29:28+0000] Could not refresh the google-cloud-logging apt repositories.
Please check your network connectivity and make sure you are running a supported
debian distribution. See https://cloud.google.com/logging/docs/agent/#agent-os-list
for a list of supported platforms.'
[2021-10-22T11:29:28+0000] Could not refresh the google-cloud-logging apt repositories.
Please check your network connectivity and make sure you are running a supported
debian distribution. See https://cloud.google.com/logging/docs/agent/#agent-os-list
for a list of supported platforms.
+ exit 1
Attempt 3
Ran the following commands:
docker run -ti python:3.6-buster bash
curl -sSO https://dl.google.com/cloudagents/add-logging-agent-repo.sh && bash add-logging-agent-repo.sh --also-install --verbose
The output:
root@9b078fd9d2a7:/# curl -sSO https://dl.google.com/cloudagents/add-logging-agent-repo.sh && bash add-logging-agent-repo.sh --also-install --verbose
Enable verbose logging.
+ REPO_HOST=packages.cloud.google.com
+ AGENT_DOCS_URL=https://cloud.google.com/logging/docs/agent
+ AGENT_SUPPORTED_URL=https://cloud.google.com/logging/docs/agent/#agent-os-list
+ AGENT_PACKAGE=google-fluentd
+ [[ -z '' ]]
+ [[ '' == *true* ]]
+ ADDITIONAL_PACKAGES=('google-fluentd-catch-all-config')
+ declare -a ADDITIONAL_PACKAGES
+ [[ -f /etc/os-release ]]
+ . /etc/os-release
++ PRETTY_NAME='Debian GNU/Linux 10 (buster)'
++ NAME='Debian GNU/Linux'
++ VERSION_ID=10
++ VERSION='10 (buster)'
++ VERSION_CODENAME=buster
++ ID=debian
++ HOME_URL=https://www.debian.org/
++ SUPPORT_URL=https://www.debian.org/support
++ BUG_REPORT_URL=https://bugs.debian.org/
+ main --also-install --verbose
+ case "${ID:-}" in
+ handle_debian
+ EXTRA_OPTS=()
+ declare -a EXTRA_OPTS
+ [[ true == \t\r\u\e ]]
+ EXTRA_OPTS+=(-oDebug::pkgAcquire::Worker=1)
+ [[ add-repo also-install == *add-repo* ]]
+ resolve_version
+ [[ latest == \l\a\t\e\s\t ]]
+ AGENT_VERSION=
+ add_repo
+ [[ -n '' ]]
+ lsb_release -v
+ apt-get update
Get:1 http://deb.debian.org/debian buster InRelease [122 kB]
Get:2 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Get:4 http://security.debian.org/debian-security buster/updates/main arm64 Packages [303 kB]
Get:5 http://deb.debian.org/debian buster/main arm64 Packages [7735 kB]
Get:6 http://deb.debian.org/debian buster-updates/main arm64 Packages [14.5 kB]
Fetched 8291 kB in 3s (3264 kB/s)
Reading package lists... Done
+ apt-get -y install lsb-release
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
distro-info-data
Suggested packages:
lsb
The following NEW packages will be installed:
distro-info-data lsb-release
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 34.4 kB of archives.
After this operation, 80.9 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main arm64 distro-info-data all 0.41+deb10u4 [6880 B]
Get:2 http://deb.debian.org/debian buster/main arm64 lsb-release all 10.2019051400 [27.5 kB]
Fetched 34.4 kB in 0s (739 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package distro-info-data.
(Reading database ... 24586 files and directories currently installed.)
Preparing to unpack .../distro-info-data_0.41+deb10u4_all.deb ...
Unpacking distro-info-data (0.41+deb10u4) ...
Selecting previously unselected package lsb-release.
Preparing to unpack .../lsb-release_10.2019051400_all.deb ...
Unpacking lsb-release (10.2019051400) ...
Setting up distro-info-data (0.41+deb10u4) ...
Setting up lsb-release (10.2019051400) ...
+ CHANGED=1
++ grep -o '^[a-z][a-z]'
++ dpkg -l apt-transport-https
+ [[ un == \i\i ]]
+ apt-get update
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Reading package lists... Done
+ apt-get -y install apt-transport-https
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
apt-transport-https
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 149 kB of archives.
After this operation, 156 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main arm64 apt-transport-https all 1.8.2.3 [149 kB]
Fetched 149 kB in 0s (3157 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package apt-transport-https.
(Reading database ... 24604 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_1.8.2.3_all.deb ...
Unpacking apt-transport-https (1.8.2.3) ...
Setting up apt-transport-https (1.8.2.3) ...
+ CHANGED=1
++ dpkg -l ca-certificates
++ grep -o '^[a-z][a-z]'
+ [[ ii == \i\i ]]
++ lsb_release -sc
+ local CODENAME=buster
+ local REPO_NAME=google-cloud-logging-buster-all
+ local 'REPO_DATA=deb https://packages.cloud.google.com/apt google-cloud-logging-buster-all main'
+ cmp -s - /etc/apt/sources.list.d/google-cloud-logging.list
+ echo 'Adding agent repository for debian.'
Adding agent repository for debian.
+ tee /etc/apt/sources.list.d/google-cloud-logging.list
deb https://packages.cloud.google.com/apt google-cloud-logging-buster-all main
+ apt-key add -
+ curl --connect-timeout 5 -s -f https://packages.cloud.google.com/apt/doc/apt-key.gpg
OK
+ CHANGED=1
+ [[ add-repo also-install == *also-install* ]]
+ install_agent
+ apt-get update
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Get:4 https://packages.cloud.google.com/apt google-cloud-logging-buster-all InRelease [5494 B]
Ign:5 https://packages.cloud.google.com/apt google-cloud-logging-buster-all/main arm64 Packages
Get:5 https://packages.cloud.google.com/apt google-cloud-logging-buster-all/main arm64 Packages [615 B]
Fetched 6109 B in 2s (2561 B/s)
Reading package lists... Done
+ expected_version_installed
++ dpkg -l google-fluentd google-fluentd-catch-all-config
++ grep -o '^[a-z][a-z]'
++ sort -u
+ [[ dp == \i\i ]]
+ return
+ [[ -n '' ]]
+ apt-get -y --allow-downgrades install google-fluentd google-fluentd-catch-all-config
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package google-fluentd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'google-fluentd' has no installation candidate
+ fail 'google-fluentd google-fluentd-catch-all-config installation failed.'
++ date +%Y-%m-%dT%H:%M:%S%z
+ echo '[2021-10-22T13:15:51+0000] google-fluentd google-fluentd-catch-all-config installation failed.'
[2021-10-22T13:15:51+0000] google-fluentd google-fluentd-catch-all-config installation failed.
+ exit 1
