Landscape - update_security_db.sh: connection to the other side was refused
Question at landscape alert - script with issues : update_security_db.sh may seem similar however the issue is different, the error message here says connection was refused that issue says connection was lost.
Landscape's update_security_db.sh does not seem to be running correctly. The following is output on attempting to run the script manually;
<11>Oct 4 19:18:16 update-security-db: Traceback (most recent call last):
<11>Oct 4 19:18:16 update-security-db: File "./process-usns", line 7, in <module>
<11>Oct 4 19:18:16 update-security-db: canonical.landscape.scripts.usn.run()
<11>Oct 4 19:18:16 update-security-db: File "/opt/canonical/landscape/canonical/landscape/scripts/batch.py", line 64, in __call__
<11>Oct 4 19:18:16 update-security-db: self.setup()
<11>Oct 4 19:18:16 update-security-db: File "/opt/canonical/landscape/canonical/landscape/scripts/batch.py", line 105, in setup
<11>Oct 4 19:18:16 update-security-db: self._stop_amqp_client = run_amqp_client_in_thread(config)
<11>Oct 4 19:18:16 update-security-db: File "/opt/canonical/landscape/canonical/landscape/setup.py", line 336, in run_amqp_client_in_thread
<11>Oct 4 19:18:16 update-security-db: blockingCallFromThread(reactor, lambda: started)
<11>Oct 4 19:18:16 update-security-db: File "/usr/lib/python2.7/dist-packages/twisted/internet/threads.py", line 122, in blockingCallFromThread
<11>Oct 4 19:18:16 update-security-db: result.raiseException()
<11>Oct 4 19:18:16 update-security-db: File "<string>", line 2, in raiseException
<11>Oct 4 19:18:16 update-security-db: twisted.internet.error.ConnectionRefusedError: Connection was refused by other side: 111: Connection refused.The same error is displayed in Landscape's server logs. I'm really not sure what I causing this.
72 Answers
I had same situation. I used landscape-server on a server with a host name which contains upper-case letters, and I changed the upper-case letters to lower-case letters in host name. And then, I purged landscape-server-quickstart and reinstalled it. That solved the situation.
sudo apt purge landscape-server-quickstart
sudo apt purge rabbitmq-server # remove rabbitmq settings too.
sudo apt autoremove
sudo apt install landscape-server-quickstartlandscape alert - script with issues : update_security_db.sh
Check whether the rabbitmq is okay, because when it is down you get the 111 error as well when it attempts to process the downloaded file.
I had this same situation when rabbitmq was not running correctly and rabbitmqctl status was showing
Status of node rabbit@landscape
Error: unable to connect to node rabbit@landscape: nodedown
DIAGNOSTICS
===========
attempted to contact: [rabbit@landscape]
rabbit@landscape: * connected to epmd (port 4369) on landscape * epmd reports: node 'rabbit' not running at all other nodes on landscape: ['rabbitmq-cli-55'] * suggestion: start the nodeBut the command rabbitmqctl start_app was not starting it and giving an error:
Starting node rabbit@landscape
Error: unable to connect to node rabbit@landscape: nodedownI found a report in a forum where clearing rabbitmq logs worked. I tried the following:
sudo service rabbitmq-server stop
sudo rm -rf /var/log/rabbitmq/*
sudo service rabbitmq-server startAfter this I could rabbitmqctl start_app and the node came up.
Manually calling the update_security_db script with sudo -u landscape bash -x /opt/canonical/landscape/scripts/update_security_db.sh now worked