Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[BUG] Workspace sessions still shown as running after a container restart, but their containers are stopped

Đang mở
#106 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, python, shell
Lĩnh vực
backend, devops

Hướng nghiên cứu

The issue is in the startup script svc-kasm/run, which stops all containers after a restart. Look at the docker events output to see the sequence: containers start, then receive SIGTERM (15) and stop. The fix likely involves modifying the script to not stop containers that are already running or to check their state before stopping. Start by examining the script and understanding how Kasm tracks session state versus container state.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

After docker restart kasm, Kasm still has running sessions as running and paused ones as paused, but their containers are Exited (2). For a running one, resume_kasm answers Session (03e5a2ab-7872-4e14-ad37-6af2842a1fb2) is in status (running) and cannot be resumed and get_kasm_status answers Kasm is not running.

dockerd restarts the session containers, since the Kasm agent creates them with unless-stopped and dockerd does not count its own shutdown as a manual stop (moby). Then docker ps -q | xargs docker stop &> /dev/null in svc-kasm/run (added in #102) stops them again:

$ docker exec kasm docker events --since 10m --until "$(date +%s)" --filter label=kasm.kasmid --format '{{.Action}} {{.Actor.Attributes.name}} {{.Actor.Attributes.signal}}'
start adminkasm.lo_f41f757f <no value>
start userkasm.loc_03e5a2ab <no value>
kill userkasm.loc_03e5a2ab 15
kill adminkasm.lo_f41f757f 15
stop adminkasm.lo_f41f757f <no value>
die adminkasm.lo_f41f757f <no value>
stop userkasm.loc_03e5a2ab <no value>
die userkasm.loc_03e5a2ab <no value>
Expected Behavior

Sessions come back in the state Kasm has them in: running, paused or stopped.

Steps To Reproduce
  1. Launch a Workspace session.
  2. docker restart kasm and wait for Kasm to be back.
  3. docker exec kasm docker ps -a --filter label=kasm.kasmid shows the session container Exited (2), while Kasm still has the session as running.
  4. resume_kasm and get_kasm_status for it fail with the errors above.
Environment
- OS: Ubuntu 24.04.4 LTS (kernel 6.18, cgroup v1)
- How docker service was installed: docker-ce 29.3.1 from Docker's apt repository
- Workspace image: kasmweb/remmina:1.19.0-rolling-daily
CPU architecture

x86-64

Docker creation
docker run -d --name kasm --privileged --network host --stop-timeout 90 \
  -e KASM_PORT=443 \
  -v /path/to/kasm/data:/opt \
  lscr.io/linuxserver/kasm:1.19.0-ls150
# plus HTTPS_PROXY and a CA bundle for the test VM's egress proxy
Container logs
Stopping Kasm Services
time="2026-09-23T10:31:30Z" level=warning msg="/opt/kasm/1.19.0/docker/docker-compose.yaml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion"
 Container kasm_rdp_gateway Stopping 
 Container kasm_rdp_https_gateway Stopping 
 Container kasm_rdp_https_gateway Stopped 
 Container kasm_proxy Stopping 
 Container kasm_rdp_gateway Stopped 
 Container kasm_proxy Stopped 
 Container kasm_guac Stopping 
 Container kasm_api Stopping 
 Container kasm_agent Stopping 
 Container kasm_agent Stopped 
 Container kasm_manager Stopping 
 Container kasm_manager Stopped 
 Container kasm_guac Stopped 
 Container kasm_api Stopped 
 Container kasm_db Stopping 
 Container kasm_db Stopped 
time="2026-09-23T10:31:51Z" level=warning msg="/opt/kasm/1.19.0/docker/docker-compose.yaml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion"
 Container kasm_db Removing 
 Container kasm_rdp_gateway Removing 
Going to remove kasm_rdp_https_gateway, kasm_proxy, kasm_agent, kasm_rdp_gateway, kasm_manager, kasm_api, kasm_guac, kasm_db
 Container kasm_rdp_https_gateway Removing 
 Container kasm_manager Removing 
 Container kasm_proxy Removing 
 Container kasm_agent Removing 
 Container kasm_api Removing 
 Container kasm_guac Removing 
 Container kasm_proxy Removed 
 Container kasm_manager Removed 
 Container kasm_rdp_gateway Removed 
 Container kasm_api Removed 
 Container kasm_guac Removed 
 Container kasm_db Removed 
 Container kasm_agent Removed 
 Container kasm_rdp_https_gateway Removed 
time="2026-09-23T10:32:06.654121651Z" level=error msg="Force shutdown daemon"
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    911
User GID:    911
───────────────────────────────────────
Linuxserver.io version: 1.19.0-ls150
Build-date: 2026-09-22T23:50:52+00:00
───────────────────────────────────────
    
[custom-init] No custom files found, skipping...
time="2026-09-23T10:32:11Z" level=warning msg="Configuration migrated from version 2, use `containerd config migrate` to avoid migration" t="10.663µs"
time="2026-09-23T10:32:11.021649797Z" level=error msg="copy shim log after reload" error="read /proc/self/fd/13: file already closed" namespace=plugins.moby
time="2026-09-23T10:32:11.133980181Z" level=error msg="failed to load shim /var/run/docker/containerd/daemon/io.containerd.runtime.v2.task/plugins.moby/3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d" error="unable to load shim \"3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d\": unable to make connection: failed to create TTRPC connection: dial unix /run/containerd/s/546926296c9b5531eddcdf7066367b63beb659213011edac14ace067c3199cf1: connect: no such file or directory" namespace=plugins.moby
time="2026-09-23T10:32:11Z" level=error msg="+ echo '[ENTRYPOINT] STARTED'" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:11Z" level=error msg="+ SOCKET_PATH=/run/docker/plugins/kasmlogger.sock" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:11Z" level=info msg="[ENTRYPOINT] STARTED" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:11Z" level=error msg="+ '[' -e /run/docker/plugins/kasmlogger.sock ]" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:11Z" level=error msg="+ echo '[ENTRYPOINT] Launching plugin.py...'" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:11Z" level=error msg="+ export 'PATH=/opt/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:11Z" level=error msg="+ + sleep 5" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:11Z" level=info msg="[ENTRYPOINT] Launching plugin.py..." plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:11Z" level=error msg="python3 /plugin.py" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:11Z" level=info msg=" * Serving Flask app 'plugin'" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:11Z" level=info msg=" * Debug mode: off" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:11Z" level=info msg=" * Serving Flask app 'plugin'" plugin=39040d0a342598a0a73f2eb011795b3f62f744ed010799b4efa8408e08c1a8c6
time="2026-09-23T10:32:11Z" level=info msg=" * Debug mode: off" plugin=39040d0a342598a0a73f2eb011795b3f62f744ed010799b4efa8408e08c1a8c6
Failed to fetch workspace list, falling back to local list.json: fetch failed
Pulling Latest Kasm Service Images
time="2026-09-23T10:32:13Z" level=warning msg="/opt/kasm/1.19.0/docker/docker-compose.yaml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion"
 Image kasmweb/rdp-gateway:1.19.0-rolling Pulling 
 Image kasmweb/postgres:1.19.0-rolling Pulling 
 Image kasmweb/proxy:1.19.0-rolling Pulling 
 Image kasmweb/agent:1.19.0-rolling Pulling 
 Image kasmweb/kasm-guac:1.19.0-rolling Pulling 
 Image kasmweb/api:1.19.0-rolling Pulling 
 Image kasmweb/rdp-https-gateway:1.19.0-rolling Pulling 
 Image kasmweb/manager:1.19.0-rolling Pulling 
 Image kasmweb/postgres:1.19.0-rolling Pulled 
 Image kasmweb/rdp-gateway:1.19.0-rolling Pulled 
 Image kasmweb/agent:1.19.0-rolling Pulled 
 Image kasmweb/proxy:1.19.0-rolling Pulled 
 Image kasmweb/api:1.19.0-rolling Pulled 
 Image kasmweb/manager:1.19.0-rolling Pulled 
 Image kasmweb/rdp-https-gateway:1.19.0-rolling Pulled 
 Image kasmweb/kasm-guac:1.19.0-rolling Pulled 
Upgrading rolling plugins
Inspecting plugin:	kasmweb/logger:amd64-1.1-rolling-daily
* Type: log plugin
* Will not update rolling plugin: currently at the latest version
Inspecting plugin:	kasmweb/sidecar:amd64-1.5-rolling-daily
* Type: network plugin
* Will not update rolling plugin: currently at the latest version
Starting Kasm Services
time="2026-09-23T10:32:16Z" level=warning msg="/opt/kasm/1.19.0/docker/docker-compose.yaml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion"
time="2026-09-23T10:32:16Z" level=error msg="+ echo '[ENTRYPOINT] Checking socket existence...'" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:16Z" level=error msg="+ ls -l /run/docker/plugins" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:16Z" level=info msg="[ENTRYPOINT] Checking socket existence..." plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:16Z" level=info msg="total 0" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:16Z" level=info msg="prwx------    1 root     root             0 Sep 23 10:32 3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d-stderr" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:16Z" level=info msg="prwx------    1 root     root             0 Sep 23 10:32 3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d-stdout" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:16Z" level=info msg="srwxr-xr-x    1 root     root             0 Sep 23 10:32 kasmlogger.sock" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:16Z" level=error msg="+ '[' '!' -S /run/docker/plugins/kasmlogger.sock ]" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
time="2026-09-23T10:32:16Z" level=error msg="+ tail -f /dev/null" plugin=3b563bb3570b26a02f9250083b57c7e11d4bdb7b83ab4724497a920d3dbc565d
 Container kasm_db Creating 
 Container kasm_guac Creating 
 Container kasm_guac Created 
 Container kasm_db Created 
 Container kasm_api Creating 
 Container kasm_manager Creating 
 Container kasm_manager Created 
 Container kasm_agent Creating 
 Container kasm_api Created 
 Container kasm_rdp_gateway Creating 
 Container kasm_agent Created 
 Container kasm_proxy Creating 
 Container kasm_rdp_gateway Created 
 Container kasm_proxy Created 
 Container kasm_rdp_https_gateway Creating 
 Container kasm_rdp_https_gateway Created 
 Container kasm_db Starting 
 Container kasm_guac Starting 
 Container kasm_db Started 
 Container kasm_db Waiting 
 Container kasm_db Waiting 
 Container kasm_guac Started 
 Container kasm_db Healthy 
 Container kasm_db Healthy 
 Container kasm_manager Starting 
 Container kasm_api Starting 
 Container kasm_manager Started 
 Container kasm_agent Starting 
 Container kasm_api Started 
 Container kasm_rdp_gateway Starting 
 Container kasm_agent Started 
 Container kasm_manager Waiting 
 Container kasm_api Waiting 
 Container kasm_rdp_gateway Started 
 Container kasm_manager Healthy 
 Container kasm_api Healthy 
 Container kasm_proxy Starting 
 Container kasm_proxy Started 
 Container kasm_rdp_https_gateway Starting 
 Container kasm_rdp_https_gateway Started 
[ls.io-init] done.
Ngôn ngữ chính
Shell
Star
487
Fork
51
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của linuxserver/docker-kasm

Tất cả issue của linuxserver/docker-kasm

Issue tương tự

Thêm issue về Shell/Bash

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.