louislam / dockge

A fancy, easy-to-use and reactive self-hosted docker compose.yaml stack-oriented manager
https://dockge.kuma.pet
MIT License
11.85k stars 333 forks source link

stack marked as "exited" when conatiners are running #177

Open zx900930 opened 9 months ago

zx900930 commented 9 months ago

⚠️ Please verify that this bug has NOT been reported before.

🛡️ Security Policy

Description

I'm trying to deploy this project using dockge https://github.com/makeplane/plane but it was marked as exited even if those containers are running. image

👟 Reproduction steps

  1. cd /opt/stacks
  2. git clone https://github.com/makeplane/plane.git
  3. hit the deploy button on dockge

👀 Expected behavior

Stack will be marked as ''active'' when containers starts running.

😓 Actual Behavior

Stack marked as ''exited'' when containers starts running.

Dockge Version

1.1.1

💻 Operating System and Arch

Debian GNU/Linux 12 (bookworm) x86_64

🌐 Browser

Google Chrome 119.0.6045.160

🐋 Docker Version

Docker CE 24.0.7

🟩 NodeJS Version

No response

📝 Relevant log output

No response

louislam commented 9 months ago

I tried this stack, I saw the minio container is not started, I think it is the reason, because the stack is active only if all containers are up.

zx900930 commented 9 months ago

I tried this stack, I saw the minio container is not started, I think it is the reason, because the stack is active only if all containers are up.

That createbuckets minio container is an init task, like the jobs in k8s, once the needed bucket is created, it will exit.

Can we add a filter (using labels for example: - "dockge.container.status.enable=false" ) to exclude containers from being checked by dockge?

Yann-J commented 9 months ago

I have a similar issue with a Plex compose file, which contains an init container that installs/updates some plugins, then exits. There is a depends_on: {plex_plugins:{condition: service_completed_successfully}} condition on the main plex container

Yann-J commented 9 months ago

Looking a bit into the code, I fear this might be tricky to implement, as right now the status is computed based on parsing the response from docker compose ls which will return something like exited(1), running(2), without further details...

thefrana commented 9 months ago

I also encountered this issue and all responses from docker compose ls are in status running. It still shows exited in the UI.

nzprog commented 9 months ago

Im also having this problem.

queeup commented 8 months ago

Same here. I am using bash container to do some jobs before services start like init task.

version: "3"
services:
  bash:
    image: bash:latest
    container_name: bash
    network_mode: none
    user: 1000:100
    volumes:
      - /container-data:/container-data
    restart: no
    command: -c 'mkdir -p
      /container-data/{sonarr/config,radarr,prowlarr/config,bazarr/config,transmission/{config,custom-cont-init.d}}'
  transmission:
    image: ghcr.io/linuxserver/transmission:latest
    container_name: transmission
    hostname: transmission
    networks:
      - servarr
    depends_on:
      - bash
    environment:
      - PUID=1000
      - PGID=100
      - TZ=Europe/Istanbul
    volumes:
      - /container-data/transmission/config:/config
      - /container-data/transmission/custom-cont-init.d:/custom-cont-init.d:ro
      - /data/downloads:/data/downloads:shared
    ports:
      - 9091:9091
      - 51413:51413
      - 51413:51413/udp
    restart: unless-stopped
golgor commented 8 months ago

I also bumped into this problem. I haven't looked into the code at all, but isn't is possible to somehow specify which services to include in the status? I.e. no real changes in the how everything is executed/managed and no changes needed in the docker-compose, but just some updated to the GUI like a setting "Ignore these services to track status".

Sorry if that is a stupid idea... I'm fairly new to docker as a whole and especially dockge.

carelinus commented 8 months ago

Same issue here. docker compose ls shows correct status, dockge shows stack as exited.

akshara-tg commented 8 months ago

I also have the same issue. I have total 50 containers. Around 40 containers are showing as running. The remaining 10 are shown as inactive.

Below is one of the stack showing as inactive while actually it is up & running. docker compose ls also shows it as running.

image

tippfehlr commented 8 months ago

I would propose to just show how many of the containers are running, just like the output of docker compose ls. e.g. "4/5 running"

If one of the containers crashes/exits before the others, there is currently no indicator that some containers might still be running.

arminus commented 7 months ago

Here's another perfectly valid example where an init container is stopped by default:

2024-01-24_185526

Appreciate the work on this regardless!

ChrisB85 commented 7 months ago

Same issue here with just one container only. image

Triskae commented 6 months ago

Me too here, is the satck missing a config, or something like that ?

Great job for dockge, saves me a lot of time !

image

bwcummings1 commented 3 months ago

Has anyone found a resolution to this bug yet? I have a project that is running in the browser port, but showing as exited in the UI.

x1ao4 commented 2 months ago

I tried this stack, I saw the minio container is not started, I think it is the reason, because the stack is active only if all containers are up.

You're right, when a stack has one or more containers that have exited but still has other running containers, the stack is shown as "exited." To me, this seems like a bug because if there are still running containers, the stack's status should be "running" rather than "exited." In Docker Desktop or Orbstack, such a state would be shown as "running," which better meets user expectations. I hope the logic can be modified so that in this situation, the status is displayed as "running." Only when all containers have exited should it show as "exited."

Shponzo commented 1 month ago

I'm experiencing the same problem. Is there any update on this bug?

Preclowski commented 6 days ago

cd /opt/stacks/yourstack && docker compose up -d --remove-orphans should help most of you guys :)

Handrail9 commented 4 days ago

cd /opt/stacks/yourstack && docker compose up -d --remove-orphans should help most of you guys :)

Perhaps another solution to this bug could be for Dockge to automatically run this before marking a container as exited.