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

Auxiliary containers left running after harbor down #37

Closed
FrantaNautilus opened this issue Sep 28, 2024 · 5 comments
Closed

Auxiliary containers left running after harbor down #37

FrantaNautilus opened this issue Sep 28, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@FrantaNautilus
Copy link

When command harbor down librechat or harbor down bionicgpt is issued the "auxiliary" containers, such as harbor.lc-db harbor.lc-vector harbor.lc-search for Librechat are left running according to docker ps. Is this expected behavior? I could not find details in the documentation. I also noticed that these containers are not being removed upon harbor down and are still listed in docker containers list --all, unlike the "main" containers of the respective frontends.


I am running harbor version 1.35, on Bluefin DX (Fedora Silverblue 40).

@av
Copy link
Owner

av commented Sep 28, 2024

Thanks for trying things out!

No, it's not expected for those containers to remain running after harbor down, however that could happen if the down is cancelled prematurely.

I just tried following workflow locally and it doesn't seem to leave dangling containers:

 everlier@pop-os:~$ ▼ h ps
NAME      IMAGE     COMMAND   SERVICE   CREATED   STATUS    PORTS

 everlier@pop-os:~$ ▼ h u librechat
[+] Running 8/8
 ✔ Network harbor_harbor-network  Created                                                                                0.0s 
 ✔ Container harbor.webui         Healthy                                                                                6.6s 
 ✔ Container harbor.lc-db         Healthy                                                                                1.1s 
 ✔ Container harbor.lc-search     Healthy                                                                                1.1s 
 ✔ Container harbor.lc-vector     Healthy                                                                                1.1s 
 ✔ Container harbor.ollama        Healthy                                                                                1.1s 
 ✔ Container harbor.lc-rag        Healthy                                                                                1.0s 
 ✔ Container harbor.librechat     Healthy                                                                                1.0s 

 everlier@pop-os:~$ ▼ h ps
NAME               IMAGE                                      COMMAND                  SERVICE     CREATED          STATUS                   PORTS
harbor.lc-db       mongo                                      "docker-entrypoint.s…"   lc-db       10 seconds ago   Up 9 seconds             27017/tcp
harbor.lc-search   getmeili/meilisearch:v1.7.3                "tini -- /bin/sh -c …"   lc-search   10 seconds ago   Up 9 seconds             7700/tcp
harbor.lc-vector   ankane/pgvector:latest                     "docker-entrypoint.s…"   lc-vector   10 seconds ago   Up 9 seconds             5432/tcp
harbor.librechat   ghcr.io/danny-avila/librechat-dev:latest   "/app/start_librecha…"   librechat   10 seconds ago   Up 9 seconds             3080/tcp, 0.0.0.0:33891->33891/tcp, :::33891->33891/tcp
harbor.ollama      ollama/ollama:latest                       "/bin/ollama serve"      ollama      10 seconds ago   Up 9 seconds             0.0.0.0:33821->11434/tcp, :::33821->11434/tcp
harbor.webui       ghcr.io/open-webui/open-webui:main         "/app/start_webui.sh"    webui       10 seconds ago   Up 9 seconds (healthy)   0.0.0.0:33801->8080/tcp, :::33801->8080/tcp

 everlier@pop-os:~$ ▼ h d
[+] Running 8/8
 ✔ Container harbor.webui         Removed                                                                                                                                         0.2s 
 ✔ Container harbor.ollama        Removed                                                                                                                                         0.2s 
 ✔ Container harbor.librechat     Removed                                                                                                                                        10.2s 
 ✔ Container harbor.lc-db         Removed                                                                                                                                         0.1s 
 ✔ Container harbor.lc-rag        Removed                                                                                                                                         0.0s 
 ✔ Container harbor.lc-search     Removed                                                                                                                                         0.1s 
 ✔ Container harbor.lc-vector     Removed                                                                                                                                         0.1s 
 ✔ Network harbor_harbor-network  Removed                                                                                                                                         0.2s 

 everlier@pop-os:~$ ▼ h ps
NAME      IMAGE     COMMAND   SERVICE   CREATED   STATUS    PORTS

 everlier@pop-os:~$ ▼ 
  • No services are running
  • up librechat, everything is running
  • down
  • No services are running

Could it be possible that you're Ctrl+Cing out of harbor down? In that instance, not all dependencies might be resolved and containers indeed could be left handling.

If this could be the case - I understand why you'd want to do that, as, librechat containers are left hanging on up/down for 10s, which is Docker's default timeout for unresponsive processes. Such waiting indicates incorrect setup for the service entrypoint, which is another thing that could be fixed here.

@av av added the bug Something isn't working label Sep 28, 2024
@FrantaNautilus
Copy link
Author

Thank you for helping me with this issue. Trying this again and I found that the harbor down works as expected, however its the command harbor down <handle> which leaves containers running. The containers remain running even after 56 minutes.

$harbor down librechat
[+] Running 2/1
 ✔ Container harbor.librechat     Removed                                                                                                                                                                                                                        10.3s 
 ! Network harbor_harbor-network  Resource is still in use
$ harbor ps
NAME               IMAGE                                COMMAND                  SERVICE     CREATED          STATUS                    PORTS
harbor.lc-db       mongo                                "docker-entrypoint.s…"   lc-db       56 minutes ago   Up 56 minutes             27017/tcp
harbor.lc-search   getmeili/meilisearch:v1.7.3          "tini -- /bin/sh -c …"   lc-search   56 minutes ago   Up 56 minutes             7700/tcp
harbor.lc-vector   ankane/pgvector:latest               "docker-entrypoint.s…"   lc-vector   56 minutes ago   Up 56 minutes             5432/tcp
harbor.ollama      ollama/ollama:latest                 "/bin/ollama serve"      ollama      56 minutes ago   Up 56 minutes             0.0.0.0:33821->11434/tcp, :::33821->11434/tcp
harbor.webui       ghcr.io/open-webui/open-webui:main   "/app/start_webui.sh"    webui       56 minutes ago   Up 56 minutes (healthy)   0.0.0.0:33801->8080/tcp, :::33801->8080/tcp

Only after running harbor down all containers were stopped and removed. Tested on CLI version: 0.2.0

@av
Copy link
Owner

av commented Sep 29, 2024

Indeed, this is a bug in how the containers to stop are resolved, thank you for additional tests!

@lee-b
Copy link

lee-b commented Sep 30, 2024

Is this not due to docker compose up rather than docker compose up --remove-orphans (or the compose down equivalent)?

@av
Copy link
Owner

av commented Oct 4, 2024

The fix was released in one of the recent versions - down command now tries to match running sub-services as well. I'm closing this for now, but please feel free to follow-up or open a new one if needed.

@av av closed this as completed Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants