Unable to upgrade using non-sudo after using sudo during a prior upgrade
Symptoms
As an admin attempting to upgrade Confluence, you receive either of the following error messages:
An error occurred when parsing your installation directory. Unfortunately the installer will be unable to continue with the automated upgrade.
If you previously ran the installer as sudo while upgrading to 7.19.18, 8.5.5, 8.7.2 and wish to now run the upgrade without sudo, please refer to:
https://confluence.atlassian.com/confkb/unable-to-upgrade-using-non-sudo-after-using-sudo-during-a-prior-upgrade-1354203403.html
or
You do not have write permissions to the existing installation directory. You will need to log in as a user with administrative permissions to upgrade Confluence.
If you previously ran the installer as sudo while upgrading to 7.19.18, 8.5.5, 8.7.2 and wish to now run the upgrade without sudo, please refer to
https://confluence.atlassian.com/confkb/Unable+to+upgrade+using+non-sudo+once+upgraded+prior+using+sudo
Diagnosis
In the installation directory, certain files are owned by root
instead of non-sudo users; for example, in the below case, install.reg
is owned by root
, while everything else is owned by ubuntu
(non-sudo user):
$ ls -l /home/ubuntu/atlassian/confluence/
total 392
-r-xr-x--- 1 ubuntu root 20577 Jan 16 16:42 BUILDING.txt
-r-xr-x--- 1 ubuntu root 6375 Jan 16 16:42 CONTRIBUTING.md
-r-xr-x--- 1 ubuntu root 58153 Jan 16 16:42 LICENSE
-r-xr-x--- 1 ubuntu root 2401 Jan 16 16:42 NOTICE
-r-xr-x--- 1 ubuntu root 2291 Jan 16 16:42 README.html
-r-xr-x--- 1 ubuntu root 3479 Jan 16 16:42 README.md
-r-xr-x--- 1 ubuntu root 1202 Jan 16 16:42 README.txt
-r-xr-x--- 1 ubuntu root 7075 Jan 16 16:42 RELEASE-NOTES
-r-xr-x--- 1 ubuntu root 16982 Jan 16 16:42 RUNNING.txt
dr-xr-x--- 3 ubuntu root 4096 Feb 6 16:33 bin
dr-xr-x--- 3 ubuntu root 4096 Feb 6 16:33 conf
dr-xr-x--- 26 ubuntu root 4096 Feb 6 16:33 confluence
-rw-r--r-- 1 root root 119892 Feb 6 16:33 install.reg
dr-xr-x--- 6 ubuntu root 4096 Feb 6 16:33 jre
dr-xr-x--- 2 ubuntu root 4096 Feb 6 16:33 lib
dr-xr-x--- 2 ubuntu root 81920 Feb 6 16:33 licenses
drwx------ 2 ubuntu root 4096 Jan 16 16:42 logs
dr-xr-x--- 4 ubuntu root 4096 Feb 6 16:33 synchrony-proxy
drwx------ 2 ubuntu root 4096 Feb 6 16:33 temp
-rwx------ 1 ubuntu root 15518 Jan 16 16:42 uninstall
dr-xr-x--- 2 ubuntu root 4096 Jan 16 16:42 webapps
drwx------ 2 ubuntu root 4096 Jan 16 16:42 work
Cause
Confluence versions 7.19.18, 8.5.5, are 8.7.2 are impacted by following bug: - CONFSERVER-94104Getting issue details... STATUS
Resolution
If you ran the installer as sudo while upgrading to 7.19.18, 8.5.5, and 8.7.2 and wish to now run the upgrade to the next version without sudo, you will need to change some file permissions before proceeding to the upgrade steps with the Linux installer.
Please follow the below steps to revert to the non-root account again:
Execute the following commands before running the installer to make sure the permissions are correct before upgrading to a fixed version of this bug:
sudo chown -R "user" <install-dir> sudo chown -R "user" <home-dir> chmod -R u+w <install-dir> chmod -R u+w <home-dir>
Stop Confluence
You should now be able to run the installer (for 7.19.19, 8.5.6, 8.8.0, or later) without needing to use sudo.