【发布时间】:2021-10-20 13:45:47
【问题描述】:
尝试在 Debian 10 上安装 Google Logging Agent 时,我收到以下错误。
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.
我正在尝试将它安装在基于 python:3.6-buster 的 Docker 容器中。
我已经仔细检查了 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
知道这里有什么问题吗?
Google 明确声明日志代理 here 支持 Debian 10。
尝试 2
因此,我浏览了故障排除指南并验证了凭据已正确安装在 VM 上。具体来说,服务帐户文件存在于/etc/google/auth/application_default_credentials.json,虽然不是必需的,但通过GOOGLE_APPLICATION_CREDENTIALS 在环境中设置。
此外,我已检查服务帐户是否具有正确的权限:Logs Writer & Monitoring Metrics Writer。
尽管如此,当我运行命令时(在文档中指定以验证身份验证范围 (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
它什么也不返回。一个空的结果。不知道为什么?
当我尝试使用 --verbose 标志安装代理时,我收到以下错误:
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
尝试 3
运行以下命令:
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
输出:
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
【问题讨论】:
标签: docker debian fluentd google-cloud-logging