Hipchat Server upgrade fails with the error ImportError No module named datetime
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
This version of Hipchat Server is no longer supported
This article applies to a version of Hipchat Server which is beyond the Atlassian End of Life policy, and is no longer supported.
You should upgrade to a more recent version of Hipchat Server as soon as you can to take advantage of new features, and security and bug fixes. If possible, you should also consider deploying Hipchat Data Center instead.
Problem
When attempting to upgrade Hipchat to version 1.4.1 or later, the upgrade fails to complete. Some of the following symptoms may be observed as a result:
- Hipchat services refuse to start.
- Users can no longer log in to the instance.
- Attempts to re-run an upgrade with hipchat upgrade --force-upgrade will fail with the following output to the terminal/command-line interface and/or the /var/log/chef.log file:
Traceback (most recent call last):
File "/opt/cumulus/virtualenv/bin/aws", line 19, in <module>
import awscli.clidriver
File "/opt/cumulus/virtualenv/local/lib/python2.7/site-packages/awscli/clidriver.py", line 17, in <module>
import botocore.session
File "/opt/cumulus/virtualenv/local/lib/python2.7/site-packages/botocore/session.py", line 25, in <module>
import botocore.config
File "/opt/cumulus/virtualenv/local/lib/python2.7/site-packages/botocore/config.py", line 18, in <module>
from botocore.compat import six
File "/opt/cumulus/virtualenv/local/lib/python2.7/site-packages/botocore/compat.py", line 15, in <module>
import datetime
ImportError: No module named datetime
Diagnosis
Environment
Upgrade performed from Hipchat Server 1.3.9 or earlier
Cause
Something may have blocked the upgrade (a package upgrade failure, a specific config that is corrupted, etc.) or intermittently failed during the upgrade.
Workaround
Run the following commands:
sudo dont-blame-hipchat
uname -a
dpkg -l | grep linux-image
dpkg -l | grep hc-
dpkg --configure -a
apt-get install --reinstall hc-cumulus
service monit stop
hipchat upgrade --force-upgrade
tail -n50 /var/log/chef.log /var/log/hipchat/update.log