xetus-oss / docker-archiva

A docker image for Apache Archiva
Apache License 2.0
55 stars 34 forks source link

Artifacts are no longer stored under /archiva-data #13

Closed luskentyre-green closed 5 years ago

luskentyre-green commented 5 years ago

Describe the bug Artifacts are no longer stored under /archiva-data, so if a docker volume is used to make the archiva data persistent, it does not include the actual artifacts, which will disappear when the container is restarted. Old artifacts are still under archiva-data but are not found by archiva, and new artifacts are not kept between restarts.

To Reproduce Given a pre v2.2.3 container with a volume which is mapped to /archiva-data in the container, and which has artifacts which have been deployed (ie a managaed repository, not a remote one).

Alternatively:

Environment Details Docker Version: 18.06.1-ce Host OS: Oracle Enterprise Linux 7 Image Version: v2.2.3

tkent commented 5 years ago

Hey @adam-me-uk

Thanks for the report! All the persistent data (including artifacts) will still be stored under /archiva-data in the new v2 series image, but it looks like repository configurations are getting botched. The relative paths that worked in the v2-legacy version now have the wonky behavior you described.

We'll look into it what we can do about that - but in the meantime, manually deleting and re-creating your repositories entries in the UI should resolve the issue. Just be sure to use an absolute path when re-creating the repository entry and not to select the "delete the repository data" option when you remove the existing one.

luskentyre-green commented 5 years ago

Hi,

Thanks for the follow up, I just wanted to make sure you were aware of the problem. I just created a new bind mount for the /archiva/repositories directory and copied the old artifacts in there and that worked fine, but obviously if you don't know it's going to happen you can lose some artifacts which are only stored in the container (though I would always say you should be able to rebuild and redeploy anything important from source anyway). I might look at recreating the repository anyway so that everything is in the right place for future versions of the image.

Very handy image BTW.

tkent commented 5 years ago

Hey @adam-me-uk

Just to close the loop, we've included a script to automatically upgrade Archiva configurations created in v2-legacy versions to avoid the problem you ran into.

On the off chance you have a backup of your environment before you upgraded, I'd love to have a confirmation that the new script would have worked for you. It should be as simple as starting up Archiva normally, but with the UPGRADE_PRE_V2 environment variable set to true.