basecamp / kamal

Deploy web apps anywhere.
https://kamal-deploy.org
MIT License
11.28k stars 444 forks source link

Deploy error after changing role name #1147

Open erichstark opened 2 days ago

erichstark commented 2 days ago

Hello, I had standard configuration which was working fine. Then I wanted to change the role to match it's meaning from web to api

primary_role: api
servers:
  api:
    - x.x.x.x

It wasn't production server, so I removed also app, old containers and start deploy again. Then I have got error at the end.

  ERROR (SSHKit::Command::Failed): Exception while executing on host x.x.x.x: docker exit status: 1
docker stdout: Nothing written
docker stderr: Error: host settings conflict with another service

Kamal: 2.2.2 Rails 7.2 Ruby 3.3.5

djmb commented 2 days ago

I think you'd need to run kamal app remove with the old config, then change it and then run kamal deploy. Is that what you did?

erichstark commented 2 days ago

After those issues I have also removed app kamal app remove and remove all unused containers: docker ps -a, docker rm xxx. And then kamal deploy -d staging. At the end of the build process, I have got mentioned error.

When I changed that role back to web, everything is working fine. But for clarity I would like to keep it with name api.

djmb commented 2 days ago

I'm not sure why this is happening then.

The error suggests that kamal-proxy still has a deployment registered under the old role. You should be able to remove it manually with:

docker exec kamal-proxy kamal-proxy ls

This should report the service name. Then you can remove it with

docker exec kamal-proxy kamal-proxy remove <service>