ARTIFACTORY: How to change the BaseURL in a Federated Repository Environment?

Fadi Rouhana
2022-11-02 18:14

You may encounter the following error when modifying the Base URL in Artifactory that has Federated Repositories set up:

Caused by: org.jfrog.common.ExecutionFailed: Last retry failed: Failed to reload configuration: The Base URL cannot be changed if a federated member exist. Not trying again

As stated above, if you have Federated repositories configured with remote mirroring, you cannot modify the Base URL of Artifactory.

Therefore, in order to do so, you will need to perform the following steps: 

1. Create a backup of your Artifactory Configuration Descriptor file located under $JFROG_HOME/artifactory/var/etc/artifactory/artifactory.config.latest.xml

2. Disconnect the federated repositories using the Update Repository Configuration REST API endpoint or from the UI by performing the following:

  • From the Administration module, click Repositories | Repositories and click the Federated tab to view a list of Federations.
  • Select the Federated repository from the list and click the Federation tab.
  • Click the x located on the top right of the repository (See screenshot below)

User-added image

3. It is recommended to wait for a short period of time, between removing the remote members and changing the base URL. Hence, wait for a while and then validate that all the federated repositories are disconnected on the member site.

4. Update the Base URL using the UI by going to the Administration module under General | Settings or by modifying the <urlBase> tag in the Artifactory Configuration Descriptor. There are two ways to directly modify the Global Configuration Descriptor:

 
5. Re-enable the Federated Repository federation by clicking the “Enabled” slider found under the Administration module → Repositories | Repositories → the Federated tab (as a result, there should only be one entry in the Included Repositories section)

User-added image

6. Reconnect all the federated repositories using the UI by adding each via the Administration module → Repositories | Repositories → the Federated tab. Alternatively, you may use the Update Repository Configuration REST API endpoint to do so.

7. Validate that the configuration was applied in the member site and the URL should be updated successfully!

In case you observe any issue following the configuration changes, you may revert the changes by renaming Bootstrapping the Global Configuration. For more information, please refer to our documentation page here.