web server: NGINX
application: NGINX Amplify
NGINX Amplify is a great tool for monitoring the status of your NGINX deployment. It’s a new thing they’ve been working on and perhaps even still in beta mode.
Recently I was upgrading my Ubuntu based server, and the NGINX Amplify agent wouldn’t upgrade, giving an error along the lines of:
sudo apt-get upgrade Setting up nginx-amplify-agent (0.40-1~trusty) ... dpkg: error processing package nginx-amplify-agent (--configure): subprocess installed post-installation script returned error exit status 1 Setting up libcurl3-gnutls:amd64 (7.35.0-1ubuntu2.10) ... Setting up libcurl3:amd64 (7.35.0-1ubuntu2.10) ... Setting up curl (7.35.0-1ubuntu2.10) ... Processing triggers for libc-bin (2.19-0ubuntu6.9) ... Errors were encountered while processing: nginx-amplify-agent E: Sub-process /usr/bin/dpkg returned an error code (1)
Bummer. I didn’t really think much of this until I got an email from a fellow over at NGINX, so I thought I’d tell him this was happening. He asked me to share with him some more information, and we worked our way through a few things that I’ll outline below.
We tried a few things, but essentially the only thing that worked was:
I suggest you add hostname to the agent configuration manually (/etc/amplify-agent/agent.conf): ---- [credentials] hostname = yourhostname ----
In this place, for yourhostname you may use any valid hostname, except local hostnames (‘localhost’,
‘localhost.localdomain’, ‘localhost6.localdomain6’, ‘ip6-localhost’).
After this, running:
sudo apt-get upgrade
worked, and everybody was happy again.
A note from support at NGINX Amplify:
Please note that current version of amplify-agent (0.40-1) contains a bug in the hostname detection logic, this is the reason why some users have problems with the upgrade. So, explicit assignment of hostname in the configuration is just a workaround.
Hope this helps!