Hipchat Server upgrade hit into lock errors
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
When executing Hipchat Server upgrade through the server's terminal/command-line, it hit into the following errors:
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
Updating system configuration, this may take a few minutes...
There was an unexpected error: Command '['sudo', '/opt/atlassian/hipchat/sbin/cs']' returned non-zero exit status 1
Cause
Another upgrade process is already running or stuck in the background so new attempt to run an upgrade command would generate the lock errors.
Resolution
Run the following commands to remove the locks:
sudo dont-blame-hipchat ls -ahl /var/lib/apt/lists/ rm /var/lib/apt/lists/lock ls -ahl /var/lib/dpkg/ rm /var/lib/dpkg/lock dpkg --configure -a
Re-attempt the upgrade:
hipchat upgrade --force-upgrade