ARTIFACTORY: Why does the gem remote repository always request the source register to update the index

AuthorFullName__c
Sun Jinlong
articleNumber
000005968
FirstPublishedDate
2024-01-08T19:18:04Z
lastModifiedDate
2025-08-01

ARTIFACTORY: Why does the gem remote repository always request the source register to update the index

Issue

The Artifactory provides the RubyGems repository (type: local, remote, virtual) and supports the Bundler Compact index for Local and Remote repositories, providing you with the latest version of the package that is compatible with your installed Ruby version of the project.
But, we will always get the frequent HEAD requests to the gem source register in the artifactory-request-out.log to update the index of the gem repo. Although we have adjusted the Metadata Retrieval Cache Period (Sec) parameter in the gem remote repo, it still does not request at the expected time.
The logs in the Artifactory are like the following:

# the artifactory-request-out.log
2023-12-24T13:34:40.223Z|749e5e6f73693388|test-gems-remote||HEAD|https://rubygems.org/specs.4.8.gz|200|0|5214498|489
2023-12-24T13:34:40.322Z|749e5e6f73693388|test-gems-remote||HEAD|https://rubygems.org/latest_specs.4.8.gz|200|0|1516660|84
2023-12-24T13:34:40.409Z|749e5e6f73693388|test-gems-remote||HEAD|https://rubygems.org/prerelease_specs.4.8.gz|200|0|432058|84
2023-12-24T13:34:40.495Z|749e5e6f73693388|test-gems-remote||GET|https://rubygems.org/specs.4.8.gz|200|0|5214498|83
2023-12-24T13:35:47.845Z|749e5e6f73693388|test-gems-remote||GET|https://rubygems.org/latest_specs.4.8.gz|200|0|1516660|673
2023-12-24T13:36:14.145Z|749e5e6f73693388|test-gems-remote||GET|https://rubygems.org/prerelease_specs.4.8.gz|200|0|432058|103

# the artifactory-service.log
artifactory-service.log:4870:2023-12-24T13:34:40.410Z [jfrt ] [INFO ] [749e5e6f73693388] [.i.GemsVirtualIndexHandler:128] [art-exec-16         ] - Started indexing virtual repo test-gems
artifactory-service.log:4871:2023-12-24T13:34:40.410Z [jfrt ] [INFO ] [749e5e6f73693388] [.g.i.GemsRemoteIndexHandler:51] [art-exec-16         ] - Started updating remote repo index for test-gems-remote
artifactory-service.log:4872:2023-12-24T13:34:40.496Z [jfrt ] [INFO ] [749e5e6f73693388] [o.a.r.HttpRepo:436            ] [art-exec-16         ] - test-gems-remote downloading https://rubygems.org/specs.4.8.gz 4.97 MB 
artifactory-service.log:4873:2023-12-24T13:35:47.846Z [jfrt ] [INFO ] [749e5e6f73693388] [o.a.r.HttpRepo:436            ] [art-exec-16         ] - test-gems-remote downloading https://rubygems.org/latest_specs.4.8.gz 1.45 MB 
artifactory-service.log:4874:2023-12-24T13:36:14.146Z [jfrt ] [INFO ] [749e5e6f73693388] [o.a.r.HttpRepo:436            ] [art-exec-16         ] - test-gems-remote downloading https://rubygems.org/prerelease_specs.4.8.gz 421.93 KB 
artifactory-service.log:4875:2023-12-24T13:36:21.470Z [jfrt ] [INFO ] [749e5e6f73693388] [.g.i.GemsRemoteIndexHandler:63] [art-exec-16         ] - Finished updating remote repo index for test-gems-remote
artifactory-service.log:4876:2023-12-24T13:38:25.406Z [jfrt ] [INFO ] [749e5e6f73693388] [.i.GemsVirtualIndexHandler:145] [art-exec-16         ] - Finished indexing virtual repo test-gems

Resolution

In the Artifactory logs, we can see from the logs that the request to update the gem index was initiated by the gem virtual repo, So we can resolve this issue by adjusting the updating period of the index for the gem virtual repo.
We can edit the artifactory.system.properties($JFROG_HOME/artifactory/var/etc/artifactory/) config to add the parameter as follows:

artifactory.gems.virtualIndexTaskIntervalSecs=600  # default 300


Then restart the Artifactory for it to take effect. You can get through the Get System Info API to confirm whether the modification is successful.