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

Found orphan containers #64

Open
zeornelas opened this issue Nov 13, 2024 · 2 comments
Open

Found orphan containers #64

zeornelas opened this issue Nov 13, 2024 · 2 comments

Comments

@zeornelas
Copy link

zeornelas commented Nov 13, 2024

Hi,

First of all, congrats on the great work on making sidekick available!

I've deployed in a fresh VPS and the launch went smooth. When I tried to deploy a new version this happened (and happens all the time I do it):

panic: error running command -
export SOPS_AGE_KEY=AGE-SECRET-KEY-THE-SECRET-HAS-BEEN-REMOVED &&
cd test_app &&
old_container_id=$(docker ps -f name=test_app -q | tail -n1) &&
sops exec-env encrypted.env 'docker compose -p sidekick up -d --no-deps --scale test_app=2 --no-recreate test_app' &&
new_container_id=$(docker ps -f name=test_app -q | head -n1) &&
new_container_ip=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $new_container_id) &&
curl --silent --include --retry-connrefused --retry 30 --retry-delay 1 --fail http://$new_container_ip:443/ || exit 1 &&
docker stop $old_container_id &&
docker rm $old_container_id &&
sops exec-env encrypted.env 'docker compose -p sidekick up -d --no-deps --scale test_app=1 --no-recreate test_app'
: - time="2024-11-13T16:47:26Z" level=warning msg="Found orphan containers ([sidekick-traefik-service-1]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up."

goroutine 3 [running]:
github.com/mightymoud/sidekick/cmd/deploy.init.func1.1()
github.com/mightymoud/sidekick/cmd/deploy/deploy.go:177 +0x1c1d
created by github.com/mightymoud/sidekick/cmd/deploy.init.func1 in goroutine 1
github.com/mightymoud/sidekick/cmd/deploy/deploy.go:86 +0xb6b

Not sure what the issue is. This a simple Django app that is listening on port 80 and 443 to expose an API.
I thought my the ports were causing this issue so I changed my app to run on a single port (8000) and the issue remains.

Apart from that, my changes weren't on the docker image itself just on the Django app code.

Any insights on how to proceed from here?

I ran docker ps on the VPS and the two containers test_app-1 and test_app-1 are running as expected.

Thanks!

EDIT1: whenever I deploy the new version doesn't run, only if I manually remove the containers and then deploy again.

@jamesx00
Copy link

I am having the same issue. After the error message, there will be two app containers running, and the traffic seems to go to both. I only need to remove the old container. Not sure if I am doing anything wrong here.

@zeornelas
Copy link
Author

@MightyMoud I believe the issue is somehow with the version on sidekick.yml which eventually generates the new container with the version number. I had to do sidekick init again and redeploy all my services. Now, what I have is that sometimes I'm having this problem and sometimes it just deploys correctly. It looks quite random to be honest.

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

No branches or pull requests

2 participants