JFrog-Cloud-Installers icon indicating copy to clipboard operation
JFrog-Cloud-Installers copied to clipboard

artifactory.product.version.properties is not existing in older builds so upgrades fail.

Open darthVikes opened this issue 6 months ago • 5 comments

[root@server jfrog]# pwd /opt/jfrog [root@server jfrog]# ll total 2043884 drwxr-xr-x. 4 artifactory artifactory 157 Feb 2 16:50 artifactory drwxr-xr-x 4 artifactory artifactory 28 May 21 2021 artifactory-pro-7.19.4 drwxr-xr-x 4 artifactory artifactory 28 Jan 23 15:44 artifactory-pro-7.77.3 -rw-r--r-- 1 artifactory artifactory 497144409 Feb 1 15:31 jfrog-artifactory-pro-7.19.4-linux.tar.gz -rw-r--r-- 1 artifactory artifactory 1595786359 Feb 6 13:45 jfrog-artifactory-pro-7.77.3-linux.tar.gz

  • name: Copy untar directory to artifactory home become: true ansible.builtin.copy: src: "{{ artifactory_untar_home }}/" dest: "{{ artifactory_home }}" owner: "{{ artifactory_user }}" group: "{{ artifactory_group }}" mode: 0755 remote_src: true when: not app_dir_check.stat.exists

and there are folders/files in there:

cd /opt/jfrog/artifactory/app [root@server app]# ll total 4 drwxr-xr-x 3 artifactory artifactory 20 May 21 2021 artifactory drwxr-xr-x 3 artifactory artifactory 4096 Feb 2 16:37 bin drwxr-xr-x 2 artifactory artifactory 225 Feb 1 15:32 doc drwxr-xr-x 3 artifactory artifactory 17 May 21 2021 event drwxr-xr-x 3 artifactory artifactory 17 Feb 2 21:46 frontend drwxr-xr-x 3 artifactory artifactory 17 May 21 2021 metadata drwxr-xr-x 6 artifactory artifactory 95 Feb 1 15:31 misc drwxr-xr-x 4 artifactory artifactory 28 May 21 2021 replicator drwxr-xr-x 3 artifactory artifactory 17 May 21 2021 router drwxr-xr-x 2 artifactory artifactory 6 Feb 6 13:46 run drwxr-xr-x 8 artifactory artifactory 88 May 21 2021 third-party

This file was not copied; artifactory.product.version.properties

Present in newer builds:

/opt/jfrog/artifactory-pro-7.77.3/app [root@server app]# ll total 12 drwxr-xr-x 3 artifactory artifactory 20 Jan 23 15:44 artifactory -rwxr-xr-x 1 artifactory artifactory 174 Jan 23 15:18 artifactory.product.version.properties drwxr-xr-x 3 artifactory artifactory 4096 Feb 6 13:46 bin drwxr-xr-x 2 artifactory artifactory 4096 Feb 6 13:46 doc drwxr-xr-x 3 artifactory artifactory 17 Jan 23 15:44 event drwxr-xr-x 3 artifactory artifactory 17 Jan 23 15:44 frontend drwxr-xr-x 3 artifactory artifactory 17 Jan 23 15:21 jfconnect drwxr-xr-x 3 artifactory artifactory 17 Jan 23 15:44 metadata drwxr-xr-x 6 artifactory artifactory 95 Feb 6 13:46 misc drwxr-xr-x 3 artifactory artifactory 17 Jan 23 15:44 observability drwxr-xr-x 3 artifactory artifactory 17 Jan 23 15:21 replicator drwxr-xr-x 3 artifactory artifactory 17 Jan 23 15:44 router drwxr-xr-x 4 artifactory artifactory 28 Jan 23 15:44 rtfs drwxr-xr-x 8 artifactory artifactory 88 Jan 23 15:44 third-party

artifactory.product.version.properties not present in older builds.

[root@server app]# pwd /opt/jfrog/artifactory-pro-7.19.4/app [root@server app]# ls -al total 4 drwxr-xr-x 12 artifactory artifactory 155 Feb 1 15:32 . drwxr-xr-x 4 artifactory artifactory 28 May 21 2021 .. drwxr-xr-x 3 artifactory artifactory 20 May 21 2021 artifactory drwxr-xr-x 3 artifactory artifactory 4096 Feb 1 15:31 bin drwxr-xr-x 2 artifactory artifactory 225 Feb 1 15:32 doc drwxr-xr-x 3 artifactory artifactory 17 May 21 2021 event drwxr-xr-x 3 artifactory artifactory 17 May 21 2021 frontend drwxr-xr-x 3 artifactory artifactory 17 May 21 2021 metadata drwxr-xr-x 6 artifactory artifactory 95 Feb 1 15:31 misc drwxr-xr-x 4 artifactory artifactory 28 May 21 2021 replicator drwxr-xr-x 3 artifactory artifactory 17 May 21 2021 router drwxr-xr-x 8 artifactory artifactory 88 May 21 2021 third-party

Originally posted by @darthVikes in https://github.com/jfrog/JFrog-Cloud-Installers/issues/365#issuecomment-1931184577

darthVikes avatar Feb 07 '24 15:02 darthVikes

Seems like a lot of work to go back to every previous release to make sure that file is there. A quicker option is if that file is not there perhaps look for the installer-info.json file that was created with older versions.

I was able to work around the issue by copying the artifactory.product.version.properties file from the newer build and then editing it to contain the older version information.

darthVikes avatar Feb 07 '24 15:02 darthVikes

We are acknowledging this issue. We will plan for a viable solution and update this thread at a later time.

kammathavaran avatar Feb 12 '24 11:02 kammathavaran

We have the same issue in Ansible:

13:21:18  TASK [jfrog.platform.artifactory : Ensure jfrog_home_directory exists] *********
13:21:18  ok: [x01134745]
13:21:18  [WARNING]: Unable to find '/tmp/artifactory.product.version.properties' in
13:21:18  expected paths (use -vvvvv to see paths)
13:21:18  
13:21:18  TASK [jfrog.platform.artifactory : Set running_version] ************************
13:21:18  fatal: [x01134745]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'ansible.builtin.ini'. Error was a <class 'ansible.errors.AnsibleParserError'>, original message: Invalid filename: 'None'. Invalid filename: 'None'"}

If this was introduced by https://github.com/jfrog/JFrog-Cloud-Installers/pull/369, it should be marked as a breaking change. Also, can you please provide a more detailed workaround or can the issue itself be fixed?

meiswjn avatar Mar 04 '24 12:03 meiswjn

@meiswjn From the above log ,we can see it is fetching from /tmp/artifactory.product.version.properties not from artifactory_home ? Could you please provide us more information on this ? How are you running this ansible playbook. And from which version of artifactory are you trying to upgrade ?

Logeshwarsn avatar Mar 11 '24 11:03 Logeshwarsn

Hello,

Yes, I think the fetching itself is only done indirectly on the artifactory_home with the copy task. The actual task works on /tmp: https://github.com/jfrog/JFrog-Cloud-Installers/blob/7eeaf27d09a9af3db302d5438b4bb477f00fbe7a/Ansible/ansible_collections/jfrog/platform/roles/artifactory/tasks/upgrade.yml#L68

Our workaround was using version 10.17.0 of this ansible module. We actually didn't upgrade Artifactory at all - I think it just checked whether an update is needed. Our current version is 7.77.5

meiswjn avatar Mar 25 '24 15:03 meiswjn