ARTIFACTORY: How to fix 404 error resource has expired

Products
Frog_Artifactory
Content Type
Use_Case
AuthorFullName__c
Marwa Sharif
articleNumber
000003912
FirstPublishedDate
2017-06-20T13:38:42Z
lastModifiedDate
2025-07-08

ARTIFACTORY: How to fix 404 error resource has expired

Introduction

In this article, we will outline how to overcome the error “Resource has expired” when you try to download a package from a remote repository.





Reason


In Artifactory, some artifacts (usually metadata files, such as the “maven-metadata.xml” file) are called “Expirable Resources”. In the context of Artifactory, expirable resources are files or artifacts within a repository that can become outdated over time.

Artifactory determines if an expirable resource needs to be replaced by checking if the file has been updated at the remote location. To minimize network overhead and request latency, Artifactory does not do this check on every request. Instead it uses a configurable expiry mechanism, called the Metadata Retrieval Cache Period (Sec). After this set period, the metadata file is considered “expired”, prompting Artifactory to recheck the remote endpoint for a newer version on the next request.
However, if a download request is made directly to the '-cache' endpoint (e.g., my-remote-repo-cache), this check is not made . If the artifact has already expired, Artifactory will respond with a 404 "Resource has expired" error.

Note

The Metadata Retrieval Cache Period parameter is configurable by going to the WebUI → Admin → Repositories | Remote → Select your repository → Advanced → ‘Metadata Retrieval Cache Period (Sec)’. After a change is made it is sometimes necessary to trigger a ZAP of the remote cache repository ( this is done from the artifact view, right click on the remote cache you wish to zap and click zap cache). 
When performing a ZAP on the remote cache repository, the metadata will be updated based on the upstream, which will also fix this issue (temporarily, for permanent solutions, read on).


Why does Artifactory do this?


It can be useful to think about the remote repository as a proxy for the configured endpoint.

When you interact with the remote repository itself, you are interacting with this proxy.

However the remote-cache can almost be compared to a local repository. It does not hold any logic for proxying the remote endpoint configured in the remote repository. Instead the remote cache is just the location Artifactory stores all local copies of artifacts from the remote source that have been saved to Artifactory at this time.

A request to this remote cache will just look for local artifacts it has saved, and in this case, where the artifact is marked as expired the cache will not serve this request.


Solution


Customers should configure their clients to make requests against the remote repository (my-remote-repo) or a virtual containing the remote and not directly to remote cache repositories.

If the remote resource is no longer available, so the check for these expirable resources fails, there are further remediation steps that can be taken.

Setting the Repository Offline: If the required file is no longer available, an effective alternative would be to set the upstream repository offline. You can do this by navigating to Administration > Repository. In the Basic Tab of the repository, locate the Docker settings and enable the Offline feature. This action will allow you to download the manifest successfully.



Now, we are able to download the manifest:



Copying from Remote Cache: Another viable option is to copy the desired file from the remote-cache repository to a local repository. Once this is completed, you can then proceed to download the required file.