digitalocean / do-agent

Collects system metrics from DigitalOcean Droplets
Apache License 2.0
597 stars 99 forks source link

gpg: no valid OpenPGP data found. #286

Closed KamarajuKusumanchi closed 1 year ago

KamarajuKusumanchi commented 1 year ago

Describe the problem

I used the instructions in https://docs.digitalocean.com/products/monitoring/how-to/install-agent/ to install the DigitalOcean Metrics Agent. But the installation fails with the following error.

$ curl -sSL https://repos.insights.digitalocean.com/install.sh | sudo bash
Cleaning up old sources...OK
Verifying machine compatibility...OK
Verifying compatibility with script...OK
Installing apt repository...
Installing gpg key...Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
gpg: no valid OpenPGP data found.
$ echo $?
2

Expected behavior

Installation should succeed without any errors.

Additional information

FWIW, I was able to get it installed from https://repos-droplet.digitalocean.com/install.sh .

$ curl -sSL https://repos-droplet.digitalocean.com/install.sh | sudo bash
Verifying machine compatibility...
OK
Verifying compatibility with script...
OK
Checking architecture support...
OK
Installing Droplet Agent, 1 attempt
Setting up droplet-agent apt repository...
Checking dependencies for installing droplet-agent
Importing GPG public key
Installing droplet-agent
Selecting previously unselected package droplet-agent.
(Reading database ... 43363 files and directories currently installed.)
Preparing to unpack .../droplet-agent_1.2.4_amd64.deb ...
Unpacking droplet-agent (1.2.4) ...
Setting up droplet-agent (1.2.4) ...
enable systemd service
Created symlink /etc/systemd/system/multi-user.target.wants/droplet-agent.service → /etc/systemd/system/droplet-agent.service.
DigitalOcean Droplet Agent is successfully installed
raju@minion:~$ echo $?
0

System Information

Distribution and version:

raju@minion:~$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

do-agent information:

Paste the entire output

/opt/digitalocean/bin/do-agent --version:

$/opt/digitalocean/bin/do-agent --version
-bash: /opt/digitalocean/bin/do-agent: No such file or directory

$ls -al /opt/digitalocean/bin/droplet-agent 
-rwxr-xr-x 1 root root 5337088 Oct 25 18:19 /opt/digitalocean/bin/droplet-agent

$/opt/digitalocean/bin/droplet-agent --version
INFO:2022/12/11 23:39:19 main.go:23: Launching DigitalOcean Droplet Agent (code name: DOTTY)
flag provided but not defined: -version
Usage of /opt/digitalocean/bin/droplet-agent:
  -debug
        Turn on debug mode
  -sshd_config string
        The location of sshd_config
  -sshd_port int
        The port sshd is binding to
  -syslog
        Use syslog service for logging

Ubuntu, Debian

apt-cache policy do-agent:

$apt-cache policy do-agent
N: Unable to locate package do-agent

$apt-cache policy droplet-agent
droplet-agent:
  Installed: 1.2.4
  Candidate: 1.2.4
  Version table:
 *** 1.2.4 100
        100 https://repos-droplet.digitalocean.com/apt/droplet-agent main/main amd64 Packages
        100 /var/lib/dpkg/status
     1.2.3 100
        100 https://repos-droplet.digitalocean.com/apt/droplet-agent main/main amd64 Packages
     1.2.2 100
        100 https://repos-droplet.digitalocean.com/apt/droplet-agent main/main amd64 Packages
     1.2.1 100
        100 https://repos-droplet.digitalocean.com/apt/droplet-agent main/main amd64 Packages
     1.2.0 100
        100 https://repos-droplet.digitalocean.com/apt/droplet-agent main/main amd64 Packages
     1.1.1 100
        100 https://repos-droplet.digitalocean.com/apt/droplet-agent main/main amd64 Packages
     1.1.0 100
        100 https://repos-droplet.digitalocean.com/apt/droplet-agent main/main amd64 Packages
     1.0.0 100
        100 https://repos-droplet.digitalocean.com/apt/droplet-agent main/main amd64 Packages
     0.9.6 100
        100 https://repos-droplet.digitalocean.com/apt/droplet-agent main/main amd64 Packages
     0.9.5 100
        100 https://repos-droplet.digitalocean.com/apt/droplet-agent main/main amd64 Packages
     0.9.4 100
        100 https://repos-droplet.digitalocean.com/apt/droplet-agent main/main amd64 Packages

Conclusion

Please either fix the documentation with the correct link or fix the https://repos.insights.digitalocean.com/install.sh script?

LunarTwilight commented 1 year ago

FWIW, I was able to get it installed from https://repos-droplet.digitalocean.com/install.sh .

it looks like do-agent and droplet-agent are two different things (do-agent does metrics and droplet-agent is used to support additional features (such as the web console)), so I'm not sure you installed do-agent via the droplet-agent script?

LunarTwilight commented 1 year ago

Also weirdly I hit that same error as you, but a few minutes ago I tried running the install script again and it worked that time?

mdanzinger commented 1 year ago

Hey @KamarajuKusumanchi , thanks for reporting this! It looks like our script was trying to pull a gpg key that was recently rotated - this should now be resolved. Feel free to re-open if you're still experiencing issues installing the agent.

KamarajuKusumanchi commented 1 year ago

it looks like do-agent and droplet-agent are two different things (do-agent does metrics and droplet-agent is used to support additional features (such as the web console)), so I'm not sure you installed do-agent via the droplet-agent script?

Ok. I did not know that do-agent and droplet-agent are two different things. I was under the impression that they are same. Thanks for pointing it out.

KamarajuKusumanchi commented 1 year ago

Hey @KamarajuKusumanchi , thanks for reporting this! It looks like our script was trying to pull a gpg key that was recently rotated - this should now be resolved. Feel free to re-open if you're still experiencing issues installing the agent.

Confirm that it works now. I ran

$ curl -sSL https://repos.insights.digitalocean.com/install.sh | sudo bash

and it installed the do-agent.

$ dpkg -l do-agent | grep ^ii
ii  do-agent       3.15.2       amd64        DigitalOcean stats collector