coolify: [Bug]: On each redeploy new volume is created
Description
For each redeploy of an app - new volume is created. I use docker compose app with mentioned volume
volumes:
store:
driver: local
It creates a new volume for each redeploy:
It does not see storage in storages:
Minimal Reproduction (if possible, example repository)
Create docker compose service with storage -> redeploy it
Exception or Error
No response
Version
v4.0.0-beta.294 Latest
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 5
- Comments: 25 (6 by maintainers)
I have the same problem. Not figured out how exactly it reproduces yet, but every day my data is being lost after some of redeploys. I use postgres and docker-compose with a volume.
Developer note (for confirmed bugs). Reproduction steps:
@renatoaraujoc Wow, thanks for this find. This solves the issue for me.
EDIT: Forget what I said, I was just stupid. Changed the postgres image of one of my services to make use of backups and in this process did not change the volume mapping path. Setting pg-data:/var/lib/postgresql/data solved the issue. Layer 8 (user) problem š
@andrasbacsai I can confirm that predefined volumes arenāt working, Iām on version v4.0.0-beta.360.
Iām trying to deploy the predefined app Grafana with Prometheus, but I want to use my predefined volumes and not the auto-generated ones.
Print screens are as follows:
Resolved docker-compose for grafana service:
Resolved volumes for this docker-compose:
external: truedoes not work as wellUI:
Am I doing something wrong?
EDIT
I found a hackish way to make this work! The problem is at this line:
https://github.com/coollabsio/coolify/blob/5d62a46a16f252e6ece4d25fe56838e99883d91b/bootstrap/helpers/shared.php#L1767C51-L1767C62
From that code, when Coolify sees ādriver_opts.typeā as ācifsā, it just returns the volume as is and exclude any dynamic created volume, so this will work (also you must tell that the volume is external!):
Will resolve to:
I have the same problem. Some templates like dragonfly let me set a volume name and the data is persistent across restarts. Other templates or pure docker compose deployments set a random string in front of the volume name. I tried setting volume names in the docker compose, but that did not work.
or
When I pull a new image and restart the containers, I get a new random string in front of the volume names and the old volume is lost.
I still canāt fix this. The volumes are being lost on each redeploy.
My
docker-compose.yamlvolumes are:I noticed similar bug that kinda relates to this, so I wonāt open new issue yet.
Issue / bug: Coolify is not adding dynamic name for the volumes. This creates problems when deploying multiple services with identical Docker Compose files on a single server, as they both attempt to use the same volume.
In documentation it says that each volume should get dynamic name. But that is not the case. (At least when deploying with docker compose) āTo prevent storage overlapping between resources, Coolify automatically adds the resourceās UUID to the volume name.ā Persistent Storage - Coolify Docs
Example fo
docker-compose.yamlwhere this happens. When deploying this twice, bothpocketbasecontainers tries to use same volumepb_dataWhen creating new resource using previous docker-compose file, coolify just adds this to it. No dynamic tag.