Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A new /data/compose/3/v<x> directory is created with a vanilla database.sqlite whenever i pull new releases #3736

Open
Bodo-von-Greif opened this issue May 3, 2024 · 4 comments
Labels

Comments

@Bodo-von-Greif
Copy link

Describe the bug

Whenever i pull a new/different version of nginx-proxy-manager the existing data in /data/compose/3/data is ignored and
a new lets say /data/compose/3/v2 is created if there is an existing /data/compose/3/v1
Normally the data should be and remain in /data/compose/3

I have to stop the container, copy an existing data direcory including database.sqlite over the new one and restart to remain my settings/data.

Another point: on a different installation i see /data/compose/2
Where does this behaviour/numer come from ?
The Version in the docker-compose file? version: "3"
Should be obsolete in newer docker version anyway.

Nginx Proxy Manager Version

coming from older versions, for example:
v2.11.1 pr3478
v2.11.2

To Reproduce
Steps to reproduce the behavior:

  1. Have a running nginx-proxy-manager installation with users etc.
  2. Pull newer version, restart/rebuild
  3. Try to login: User is not there

Expected behavior

The existing data should be used instead of creating a new "instance"

Screenshots

cd /data/compose/3
drwxr-xr-x 7 root root 4096 Mar 14 12:11 ./
drwxr-xr-x 3 root root 4096 Jul 21 2022 ../
drwxr-xr-x 7 root root 4096 Sep 21 2023 data/
drwxr-xr-x 4 root root 4096 Oct 5 2023 letsencrypt/
drwxr-xr-x 4 root root 4096 May 3 07:38 v1/
drwxr-xr-x 4 root root 4096 Mar 14 09:24 v2/
drwxr-xr-x 5 root root 4096 May 3 07:38 v3/

Operating System

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS"

Additional context

Docker version 26.1.1, build 4cf5afa
Same with Docker Ubuntu distribution

Thanks for any insight to this issue

@remcoros
Copy link

remcoros commented May 5, 2024

That is an issue (or feature) of portainer when you create a stack and use relative paths for your volumes. Whenever the stack/compose content is updated, it creates a new version and you end up with a whole new 'v##' folder which is used for relative volume mappings. I switched to using absolute paths for the volumes because of this.

@Bodo-von-Greif
Copy link
Author

Hi remcoros,

at the end i suspected portainer for doing this. Thanks a lot for confirming this!
Also i see there is a version switch at the right upper corner when you edit the stack.
How did you manage to switch to absolute paths?

Best,
Bodo

@remcoros
Copy link

remcoros commented May 6, 2024

don't use ./data:/data, but point to a full path on your host system like this:

    volumes:
      - /data/nginx-proxy-manager/data:/data

@Bodo-von-Greif
Copy link
Author

Thats a way better answer than KI:

Gemini: how do i prevent portainer from creating new versions of stack direcories?

There isn't a direct way to disable stack versioning in Portainer currently. This feature was a point of discussion among users on the Portainer GitHub Discussions https://github.com/orgs/portainer/discussions/10415.

Here are two options to consider:

  1. Use Portainer CE: If stack versioning is a major inconvenience, you can switch to the Portainer Community Edition (CE). Unlike the Business Edition, the CE version doesn't automatically create new versions for your stacks.

  2. Manage Data Volumes Manually: Even with stack versioning, your data volumes (folders containing persistent data) typically remain in the original location. You can manage these volumes manually and copy them over to the new version directory if needed. This approach requires some manual intervention but avoids creating new data copies every time.

thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants