Search code examples
artifactoryrpmremote-repository

RPM Remote Repository - Package does not match intended download


We're making use of a remote repository and are storing artifacts locally. However, we are running into a problem because of the fact the remote repository regularly rebuilds all artifacts that it hosts. In our current state, we update metadata (e.x. repodata/repomd.xml), but artifacts are not updated.

We have to continually clear our local remote-repository-cache out in order to allow it to download the rebuilt artifacts.

Is there any way we can configure artifactory to allow it to recache new artifacts as well as the new artifact metadata?

In our current state, the error we regularly run into is

https://artifactory/artifactory/remote-repo/some/path/package.rpm:
[Errno -1] Package does not match intended download. 
Suggestion: run yum --enablerepo=artifactory-newrelic_infra-agent clean metadata

Solution

  • Unfortunately, there is no good answer to that. Artifacts under a version should be immutable; it's dependency management 101.

    I'd put as much effort as possible to convince the team producing the artifacts to stop overriding versions. It's true that it might be sometimes cumbersome to change versions of dependencies in metadata, but there are ways around it (like resolving the latest patch during development, as supported in the semver spec), and in any way, that's not a good excuse.

    If that's not possible, I'd look into enabling direct repository-to-client streaming (i.e. disabling artifact caching) to prevent the problem of stale artifacts.

    Another solution might be cleaning up the cache using a user plugin or a script using JFrog CLI once you learn about newer artifacts being published in the remote repository.