kamal
kamal copied to clipboard
kamal setup crashing on redis accessory
Hi,
I have an issue with kamal setup
crashing on redis accessory.
INFO [4243044c] Running docker run --name app-redis --detach --restart unless-stopped --log-opt max-size="10m" --publish 36379:6379 --env-file .kamal/env/accessories/app-redis.env --volume /var/lib/redis:/data --label service="app-redis" redis:latest redis-server --save 60 1 on 10.0.0.6
Releasing the deploy lock...
Finished all in 9.0 seconds
ERROR (SSHKit::Command::Failed): Exception while executing on host 10.0.0.6: docker exit status: 125
docker stdout: Nothing written
docker stderr: docker: Error response from daemon: Conflict. The container name "/app-redis" is already in use by container "069c97eb7287142e2fbaaad7de82c656a488fdb7bc115dcebbaadbfe799f5f8f". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
redis deploy config:
accessories:
redis:
image: redis:latest
cmd: redis-server --save 60 1
hosts:
- 10.0.0.6
port: "36379:6379"
volumes:
- /var/lib/redis:/data
I have tried kamal remove
and rebuilding/reinstalling the hosting instance from ground up to no avail.
The only thing that helps is sshing to the instance and doing docker rm -f /app-redis
.
Then I am able to run kamal setup
for one time, second run crashes again.
Some time ago I've stuck with the same issue, but with mongodb database.
As I understand the problem - kamal setup
is a command only for first-time deployment.
For next deployments you should use kamal deploy
command instead.
@picolino I agree, but it's possible you could have an issue deploying, I some guard rails would be nice here, "oh the container exists, don't start another one" etc.
@lizdeika Any luck solving the issue?
@hapiben no, sadly no luck
the only workaround is executing docker rm -f /app-redis
on the redis server machine
I also had similar issue, and I commented the accessory part after the first setup, just so I could run kamal setup
again after the first setup.