ARTIFACTORY: How to Resolve "Failed to open dir bin: Not a directory" Error During Artifactory RPM Upgrade

ARTIFACTORY: How to Resolve "Failed to open dir bin: Not a directory" Error During Artifactory RPM Upgrade

AuthorFullName__c
Ino Choi
articleNumber
000006208
ft:sourceType
Salesforce
FirstPublishedDate
2024-10-21T11:52:13Z
lastModifiedDate
2024-10-21
VersionNumber
2
Introduction


When upgrading Artifactory from versions between 7.15.x and 7.17.x to a higher version (e.g., 7.77.11) using RPM installation, users may encounter the following error:
error: failed to open dir bin of /opt/jfrog/artifactory/app/frontend/bin/: Not a directory

Error unpacking rpm package jfrog-artifactory-pro-7.77.11-77711900.x86_64


This issue occurs due to a legacy symlink in the $JFROG_HOME/artifactory/app/frontend directory. In affected versions, the directory structure looks like this:
drwxrwxr-x.  3 artifactory artifactory  56 Oct  9 22:18 .
drwxr-xr-x. 13 artifactory artifactory 166 Oct  9 22:17 ..
lrwxrwxrwx.  1 artifactory artifactory  46 Oct  9 22:18 bin -> /opt/jfrog/artifactory/app/frontend/bin-1.17.6
drwxrwxr-x.  4 artifactory artifactory  53 Oct  9 22:17 bin-1.17.6
-rw-r--r--.  1 artifactory artifactory  58 Oct  9 22:17 versions.json


Note the symlink 'bin' pointing to '/opt/jfrog/artifactory/app/frontend/bin-1.17.6'. This symlink structure, present in versions 7.15.x to 7.17.x, causes the upgrade to higher versions on RPM installations to fail.


Resolution



To resolve this "Failed to open dir bin: Not a directory" error, you can use one of the following workarounds:

1.Remove the symlink before the upgrade:
rm $JFROG_HOME/artifactory/app/frontend/bin

When prompted, confirm the removal of the symbolic link.

2. After the first upgrade attempt fails, rerun the upgrade command:
yum install -y jfrog-artifactory-pro-7.77.11.rpm

The second attempt creates a new $JFROG_HOME/artifactory/app/frontend/bin directory.

After applying either of these workarounds, proceed with the upgrade process.


Conclusion



This "Failed to open dir bin: Not a directory" error affects Artifactory versions 7.15.x to 7.17.x when upgrading to higher versions using RPM installation. The issue is caused by a legacy symlink in the frontend directory structure. By either removing the symlink before the upgrade or rerunning the upgrade after a failed first attempt, you can successfully upgrade to the desired version.

Always ensure you have a backup of your Artifactory installation before attempting any upgrades, and consider testing the upgrade process in a non-production environment first.