Skip to content

[Bug] - Restricting Image to network other than kasm_default_network, stuck on "creating a secure connection" on launch and "Error calling KasmVNC API..." comes up.  #615

Closed

Description

@MxD-js

Existing Resources

Describe the bug
I created a IPVLAN network with tagged VLAN from IPVLAN kasm document https://kasmweb.com/docs/latest/how_to/ipvlan.html and I restricted the container to the newly created VLAN for this debian bookworm image. "kasmweb/debian-bookworm-desktop:1.15.0" and when I try to connect to the container, this is all I see this.

image

after 45 seconds or so it backs out and I get brought back to the workspaces page and I get this error just before i get redirected back to the workspaces page.

image

I refresh the workspaces page and I see the container is "started"
image

when I click on the resume button for the running container, it brings me back to the origional screen shot "creating a secure connection window"

I have vlan6ipvlan network only selected in the workspace config

image

If I remove vlan6ipvlan and only add "kasm_default_network" then image "kasmweb/debian-bookworm-desktop:1.15.0" connects just fine but it's on the wrong network.

image

I also tried another image "kasmweb/chrome:1.15.0" restricting it to also to VLAN6 and it works as expected, I also tried kasmweb/firefox:1.15.0" and it also works when restricted to specific network.
Not sure why "kasmweb/debian-bookworm-desktop:1.15.0" or ubuntu variations, and other desktop containers fail to connect when restricted to specific network.

I get this error in kasm admin section.

image
and
image

and the export of the issues from the errors page.
application-export.json

To Reproduce
Steps to reproduce the behavior:

  1. Create ipvlan per kasm docker ipvlan documentation and restrict a container to specific network like "kasmweb/debian-bookworm-desktop:1.15.0" and other linux desktop variants with full desktop experience.

Expected behavior
Expect that the container be restricted to specific docker network.

Screenshots
If applicable, add screenshots to help explain your problem.

Workspaces Version
Version 1.15.0

Workspaces Installation Method
Bare Metal single server installation

Client Browser (please complete the following information):

  • OS: Windows/MacOS
  • Browser: Chrome, Firefox, Safari

Workspace Server Information (please provide the output of the following commands):

  • uname -a
Linux kasm-01 5.15.0-119-generic #129-Ubuntu SMP Fri Aug 2 19:25:20 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  • cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
  • sudo docker info
Client: Docker Engine - Community
 Version:    27.2.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.16.2
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.5.0
    Path:     /usr/local/lib/docker/cli-plugins/docker-compose

Server:
 Containers: 10
  Running: 9
  Paused: 0
  Stopped: 1
 Images: 18
 Server Version: 27.2.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 472731909fa34bd7bc9c087e4c27943f9835f111
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-119-generic
 Operating System: Ubuntu 22.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.598GiB
 Name: kasm-01
 ID: 87d9f569-72fa-4bfd-861e-acb403b4081a
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
  • sudo docker ps | grep kasm
fc189fea52f0   kasmweb/debian-bookworm-desktop:1.15.0   "/dockerstartup/kasm…"   12 minutes ago      Restarting (6) 8 seconds ago                                                                                                    adminkasm.lo_6338f014
224777ea7d7c   kasmweb/nginx:1.25.3                     "/docker-entrypoint.…"   About an hour ago   Up About an hour               80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp
                                kasm_proxy
ad7ae555d8cf   kasmweb/share:1.15.0                     "/bin/sh -c '/usr/bi…"   About an hour ago   Up About an hour (healthy)     8182/tcp
                                kasm_share
a0ae0a39f179   kasmweb/agent:1.15.0                     "/bin/sh -c '/usr/bi…"   About an hour ago   Up About an hour (healthy)     4444/tcp
                                kasm_agent
a70ae5389b8a   kasmweb/manager:1.15.0                   "/bin/sh -c '/usr/bi…"   About an hour ago   Up About an hour (healthy)     8181/tcp
                                kasm_manager
689599c38457   redis:5-alpine                           "docker-entrypoint.s…"   About an hour ago   Up About an hour               6379/tcp
                                kasm_redis
3d227ed1ec70   kasmweb/kasm-guac:1.15.0                 "/dockerentrypoint.sh"   About an hour ago   Up About an hour (healthy)
                                kasm_guac
41bb3c5f10a4   kasmweb/api:1.15.0-rolling               "/bin/sh -c '/usr/bi…"   About an hour ago   Up About an hour (healthy)     8080/tcp
                                kasm_api
d33f6fc1a55e   postgres:12-alpine                       "docker-entrypoint.s…"   15 hours ago        Up About an hour (healthy)     5432/tcp

Additional context
Bit confusing why restricting some containers to specifc network breaks things but for other containers who are also restricted work just fine.

Activity

  1. added
    bug
    on Sep 2, 2024
  2. MxD-js commented on Sep 4, 2024

    @MxD-js
    Author

    quick update as I try and work through this. Appears that when I use almalinux desktop image, I don't have the same issue. If I use kasmweb/almalinux-9-desktop:1.15.0 and restrict it to VLAN6, kasm workspaces connects just fine and I'm on the proper network but when I do the same for kasmweb/ubuntu-jammy-desktop:1.15.0 or kasmweb/debian-bullseye-desktop:1.15.0 or other desktop images like alpine with a desktop environment. I get the issue that I described above.

  3. MxD-js commented on Sep 4, 2024

    @MxD-js
    Author

    Another update. If I pull image kasmweb/ubuntu-jammy-desktop:1.14.0 then everything works just fine and I can place the 1.14.0 image on any network and kasm workspaces connects just fine. So what changed between 1.15.0 and 1.14.0 image?

  4. mmcclaskey commented on Sep 4, 2024

    @mmcclaskey

    @MxD-js , I suspect it does not have to do with the images, but rather networking. Each time you create a new session, it gets assigned a random IP within the range you defined on the ipvlan network. Can you try creating multiple sessions, say 10 times or so, to ensure it is actually tied to specific images and not just random.

  5. MxD-js commented on Sep 4, 2024

    @MxD-js
    Author

    @mmcclaskey The IPvlan range I assigned is small 192.168.6.20/30 and both 1.15.0 image and 1.14.0 are given the same IP from what I can tell.

    It's hard to say because 1.15.0 image never makes it past this stage (log attached) and just loops over and over again and the 1.15.0 image fails to get a IP assigned but for the brief moment 5-10 seconds I see it get assigned the same IP as 1.14.0 image. I also tried creating another session on 1.15.0 to test your suggestion and both sessions on image 1.15.0 do the same thing but when I do the same test with couple sessions on 1.14.0 both sessions work just fine.

    log output :
    ubuntu_jamy_1_15_0_test.txt

  6. MxD-js commented on Sep 4, 2024

    @MxD-js
    Author

    Update: I widened the ip range to 192.168.6.16/28 to get more sessions opened, I opened 4 sessions and 1.15.0 sessions do the same as I described and fail to connect but when I launch 4 sessions of 1.14.0 each session works as expected.

  7. mmcclaskey commented on Sep 4, 2024

    @mmcclaskey

    It looks like it is having issues with a persistent profile. Do you have persistent profiles enabled on this workspace? Can you try disabling the profile?

  8. MxD-js commented on Sep 4, 2024

    @MxD-js
    Author

    It looks like it is having issues with a persistent profile. Do you have persistent profiles enabled on this workspace? Can you try disabling the profile?

    Thx for the quick responses. Very much appreciated. I found a thread discussing this issue also and it suggested disabling persistence profiles also. I tried with and without persistent profile on 1.15.0 images and didn't work, same result.

    But I can enable/disable persistent profile on 1.14.0 image and it works just fine and persists the data across container sessions.

  9. MxD-js commented on Sep 6, 2024

    @MxD-js
    Author

    Update: I built a custom image using ubuntu jammy kasmweb/core-ubuntu-jammy:1.14.0-rolling and it builds and works as expected, isolating to vlan network works as well. if I build with kasmweb/core-ubuntu-jammy:1.15.0-rolling I get the same issues result that I described above, but chrome/firefox images kasmweb/chrome:1.15.0 and kasmweb/firefox:1.15.0 and kasmweb/almalinux-9-desktop:1.15.0 all work as expected, it's just the debian variants from what I'm finding out, debian or ubuntu images specifically.

    I know it's frowned upon to use 1.14.0 on 1.15.0 kasm workspaces but it does work, not sure why 1.15.0 images fail for some reason.

  10. MxD-js commented on Sep 24, 2024

    @MxD-js
    Author

    Ok. I finally tracked down the issue what's going on and why 1.14.0 images work and 1.15.0 and newer images dont..

    In versions 1.15.0 and on 1.16.0 as well the startup /dockerstartup/vnc_startup.sh script waits for interfaces, but the loop only checks for type veth or virtual interfaces which when I created a ipvlan network like the documentation shows. I restricted the image to the newly created ipvlan and when running ip link show type ipvlan I get the eth0 interface listed. the type is ipvlan if I do ip link show veth I get nothing, so the loop repeats over and over. I see this in the log as this.
    So you can see interfaces variable is an empty string, and so the loop repeats over and over.

    .......
    wxrwxrwx 1 kasm-user kasm-user   291 Sep 18 07:05 slack.desktop
    -rwxrwxrwx 1 kasm-user kasm-user   560 Sep 18 07:00 sublime_text.desktop
    -rwxrwxrwx 1 kasm-user kasm-user   434 Sep 18 07:04 telegram.desktop
    -rwxrwxrwx 1 kasm-user kasm-user   961 Sep 18 07:04 thunderbird.desktop
    lrwxrwxrwx 1 kasm-user kasm-user    23 Sep 24 16:23 Uploads -> /home/kasm-user/Uploads
    -rwxrwxrwx 1 kasm-user kasm-user   490 Sep 18 07:03 Zoom.desktop
    + rm -rf /home/kasm-user/.config/pulse
    + echo -e '\n\n------------------ EXECUTE COMMAND ------------------'
    + echo 'Executing command: '\''/dockerstartup/vnc_startup.sh' /dockerstartup/kasm_startup.sh '--tail-log'\'''
    ------------------ EXECUTE COMMAND ------------------
    + exec /dockerstartup/vnc_startup.sh /dockerstartup/kasm_startup.sh --tail-log
    Executing command: '/dockerstartup/vnc_startup.sh /dockerstartup/kasm_startup.sh --tail-log'
    ------------------ DEBUG KASM STARTUP -----------------
    + wait_for_network_devices
    + true
    ++ ip link show type veth
    ++ awk -F: '/^[0-9]+: / {print $2}'
    ++ awk '{print $1}'
    ++ sed 's/@.*//'
    + interfaces=
    + '[' -z '' ']'
    
    

    simple workaround is to add ipvlan into the type checking.
    I changed this line from this:

    function wait_for_network_devices() {
            while true; do
                    interfaces=$(ip link show type veth | awk -F: '/^[0-9]+: / {print $2}' | awk '{print $1}' | sed 's/@.*//')
                    if [ -z "$interfaces" ]; then
                            sleep 1
                            continue
                    fi

    to this:

    function wait_for_network_devices() {
            while true; do
                    interfaces=$(ip link show type veth type ipvlan | awk -F: '/^[0-9]+: / {print $2}' | awk '{print $1}' | sed 's/@.*//')
                    if [ -z "$interfaces" ]; then
                            sleep 1
                            continue
                    fi

    and now things work as expected.

    I'm not sure what the best course of action is moving on or what the intent behind the script to check for only veth interfaces. I think just checking for eth0 interfaces would suffice. something like this?

    function wait_for_network_devices() {
            while true; do
                    interfaces=$(ip link show | awk -F: '/^[0-9]+: / {print $2}' | awk '{print $1}' | sed 's/@.*//')
                    if [ -z "$interfaces" ]; then
                            sleep 1
                            continue
                    fi

    When I looked at 1.14.0 images in the vnc_startup.sh script in /dockerstartup/vnc_startup.sh script in the container I don't see this veth strict interface type check which makes sense why all my 1.14.0 images work.

    But for now I'm going to close this issue with this comment.

    I guess for now the work around is to replace the vnc_startup.sh in file mapping and set it to executable in kasm to add ipvlan to the type checking list, or just remove the interface type checking all-together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions