linuxserver / docker-kasm

Kasm Workspaces platform provides enterprise-class orchestration, data loss prevention, and web streaming technology to enable the delivery of containerized workloads to your browser.
GNU General Public License v3.0
315 stars 28 forks source link

[BUG] Connection Timed Out When Initializing Postgres Database #41

Closed notkudu closed 1 year ago

notkudu commented 1 year ago

Is there an existing issue for this?

Current Behavior

the interface on 3000 does work but it fails the installation and the other interface on 443 does not work

Expected Behavior

the installer should have finished with no errors. but instead was getting this: `kasm_api Pulled 2023-10-28 22:40:28,902 [INFO] root: Performing Database Connectivity Test 2023-10-28 22:40:28,927 [INFO] root: Initializing Postgres Database Traceback (most recent call last): File "sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect File "sqlalchemy/pool/base.py", line 363, in connect File "sqlalchemy/pool/base.py", line 760, in _checkout File "sqlalchemy/pool/base.py", line 492, in checkout File "sqlalchemy/pool/impl.py", line 139, in _do_get File "sqlalchemy/util/langhelpers.py", line 68, in exit File "sqlalchemy/util/compat.py", line 129, in reraise File "sqlalchemy/pool/impl.py", line 136, in _do_get File "sqlalchemy/pool/base.py", line 308, in _create_connection File "sqlalchemy/pool/base.py", line 437, in init File "sqlalchemy/pool/base.py", line 639, in connect File "sqlalchemy/engine/strategies.py", line 114, in connect File "sqlalchemy/engine/default.py", line 453, in connect File "psycopg2/init__.py", line 126, in connect psycopg2.OperationalError: could not connect to server: Connection timed out Is the server running on host "db" (172.21.0.2) and accepting TCP/IP connections on port 5432?

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "server.py", line 220, in File "initialize_postgres_db.py", line 24, in init File "data/data_access_factory.py", line 17, in createSession File "data/access_postgres.py", line 70, in init File "sqlalchemy/dialects/postgresql/base.py", line 2547, in has_table File "sqlalchemy/engine/base.py", line 2165, in execute File "sqlalchemy/engine/base.py", line 2226, in _contextual_connect File "sqlalchemy/engine/base.py", line 2265, in _wrap_pool_connect File "sqlalchemy/engine/base.py", line 1536, in _handle_dbapi_exception_noconnection File "sqlalchemy/util/compat.py", line 383, in raise_from_cause File "sqlalchemy/util/compat.py", line 128, in reraise File "sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect File "sqlalchemy/pool/base.py", line 363, in connect File "sqlalchemy/pool/base.py", line 760, in _checkout File "sqlalchemy/pool/base.py", line 492, in checkout File "sqlalchemy/pool/impl.py", line 139, in _do_get File "sqlalchemy/util/langhelpers.py", line 68, in exit File "sqlalchemy/util/compat.py", line 129, in reraise File "sqlalchemy/pool/impl.py", line 136, in _do_get File "sqlalchemy/pool/base.py", line 308, in _create_connection File "sqlalchemy/pool/base.py", line 437, in init File "sqlalchemy/pool/base.py", line 639, in connect File "sqlalchemy/engine/strategies.py", line 114, in connect File "sqlalchemy/engine/default.py", line 453, in connect File "psycopg2/init__.py", line 126, in connect sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: Connection timed out Is the server running on host "db" (172.21.0.2) and accepting TCP/IP connections on port 5432?

(Background on this error at: http://sqlalche.me/e/e3q8) [1] Failed to execute script 'server' due to unhandled exception!`

Steps To Reproduce

  1. run the container
  2. go to https://ip:3000
  3. run the installer
  4. wait for the error

Environment

- OS: Debian
- How docker service was installed: from the pkg manager "apt install docker docker-compose"

CPU architecture

x86-64

Docker creation

version: "2.1"
services:
  gluetun:
    image: qmcgaw/gluetun
    container_name: kasm-gluetun
    environment:
      - VPN_SERVICE_PROVIDER=mullvad
      - VPN_TYPE=wireguard
      - WIREGUARD_PRIVATE_KEY=SECRATE
      - WIREGUARD_PUBLIC_KEY=SECRATE
      - WIREGUARD_ADDRESSES=10.68.117.211/32
      - WIREGUARD_ALLOWED_IPS=0.0.0.0/0
      - SERVER_CITIES=Stockholm
    ports:
      - 3000:3000
      - 1443:443
    cap_add:
      - NET_ADMIN
    restart: unless-stopped
    networks:
      - nginx-proxy-manager_default

  kasm:
    image: linuxserver/kasm:latest
    container_name: kasm
    network_mode: "service:gluetun"
    privileged: true
    environment:
      - KASM_PORT=443
      - DOCKER_HUB_USERNAME=kudu #optional
      - DOCKER_HUB_PASSWORD=pass #optional
      - DOCKER_MTU=1500 #optional
    volumes:
      - /home/kudu/docker/kasm/opt:/opt
      - /home/kudu/docker/kasm/profiles:/profiles #optional
      - /dev/input:/dev/input #optional
      - /run/udev/data:/run/udev/data #optional
    restart: unless-stopped

networks:
  nginx-proxy-manager_default:
    external: true

Container logs

[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
───────────────────────────────────────

WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Get "https://registry-1.docker.io/v2/": unauthorized: incorrect username or password
[custom-init] No custom files found, skipping...
[ls.io-init] done.
time="2023-10-28T21:51:51.171274804Z" level=error msg="failed to initialize a tracing processor \"otlp\"" error="no OpenTelemetry endpoint: skip plugin"
time="2023-10-28T21:55:36.905453593Z" level=info msg="loading plugin \"io.containerd.event.v1.publisher\"..." runtime=io.containerd.runc.v2 type=io.containerd.event.v1
time="2023-10-28T21:55:36.905652406Z" level=info msg="loading plugin \"io.containerd.internal.v1.shutdown\"..." runtime=io.containerd.runc.v2 type=io.containerd.internal.v1
time="2023-10-28T21:55:36.905681075Z" level=info msg="loading plugin \"io.containerd.ttrpc.v1.task\"..." runtime=io.containerd.runc.v2 type=io.containerd.ttrpc.v1
time="2023-10-28T21:55:36.906013403Z" level=info msg="starting signal loop" namespace=moby path=/run/docker/containerd/daemon/io.containerd.runtime.v2.task/moby/e0cc006c1be1ae373db135db8bc5b39f3747b52949e5a9dc76a7565f0e665b89 pid=972 runtime=io.containerd.runc.v2
time="2023-10-28T21:56:57.285903696Z" level=info msg="loading plugin \"io.containerd.event.v1.publisher\"..." runtime=io.containerd.runc.v2 type=io.containerd.event.v1
time="2023-10-28T21:56:57.286110153Z" level=info msg="loading plugin \"io.containerd.internal.v1.shutdown\"..." runtime=io.containerd.runc.v2 type=io.containerd.internal.v1
time="2023-10-28T21:56:57.286139013Z" level=info msg="loading plugin \"io.containerd.ttrpc.v1.task\"..." runtime=io.containerd.runc.v2 type=io.containerd.ttrpc.v1
time="2023-10-28T21:56:57.286588030Z" level=info msg="starting signal loop" namespace=moby path=/run/docker/containerd/daemon/io.containerd.runtime.v2.task/moby/16918e4ea6c4258a68defdd0471fe6fcaaf9644f3af04822b8d6fbda56b309c1 pid=1236 runtime=io.containerd.runc.v2
[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
───────────────────────────────────────

WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Get "https://registry-1.docker.io/v2/": unauthorized: incorrect username or password
.......+...+............+...............+.+.....+....+...+.....+..........+...+..+......+......+.+...+...............+..+.......+..+...+......+.+...+..+.+..............+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*....+.....+.......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*............+....+...........+.........+......+.+............+......+..+.............+..+....+......+..............+.+..+......+.......+..+.+.....+....+...+..+...+..........+...+.........+....................+.......+........+...+...+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.+.+......+........+.+......+...+..+..........+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*......+......+.....+...+.........+...............+.+..+.......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*...............+..+...+............+.......+..................+..+.+...+..+....+........+...............+......+....+.....+.+..............+.+...........+......+....+...+...........+......+...+...+.......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
[custom-init] No custom files found, skipping...
[ls.io-init] done.
time="2023-10-28T22:25:07.291815169Z" level=error msg="cleanup working directory in namespace" error="open /opt/docker/containerd/daemon/io.containerd.runtime.v2.task/moby: no such file or directory" namespace=moby
time="2023-10-28T22:25:07.293073176Z" level=error msg="failed to initialize a tracing processor \"otlp\"" error="no OpenTelemetry endpoint: skip plugin"
{ hostname: 'kasm' }
time="2023-10-28T22:26:41.712699817Z" level=info msg="loading plugin \"io.containerd.event.v1.publisher\"..." runtime=io.containerd.runc.v2 type=io.containerd.event.v1
time="2023-10-28T22:26:41.712897058Z" level=info msg="loading plugin \"io.containerd.internal.v1.shutdown\"..." runtime=io.containerd.runc.v2 type=io.containerd.internal.v1
time="2023-10-28T22:26:41.712926037Z" level=info msg="loading plugin \"io.containerd.ttrpc.v1.task\"..." runtime=io.containerd.runc.v2 type=io.containerd.ttrpc.v1
time="2023-10-28T22:26:41.713307296Z" level=info msg="starting signal loop" namespace=moby path=/run/docker/containerd/daemon/io.containerd.runtime.v2.task/moby/bdfa5666513bb8c5cd3e0a85936253aa5a93a28bc58271fc00b3ea528ee7ccbb pid=934 runtime=io.containerd.runc.v2
time="2023-10-28T22:28:14.969609103Z" level=info msg="loading plugin \"io.containerd.event.v1.publisher\"..." runtime=io.containerd.runc.v2 type=io.containerd.event.v1
time="2023-10-28T22:28:14.969802520Z" level=info msg="loading plugin \"io.containerd.internal.v1.shutdown\"..." runtime=io.containerd.runc.v2 type=io.containerd.internal.v1
time="2023-10-28T22:28:14.969856690Z" level=info msg="loading plugin \"io.containerd.ttrpc.v1.task\"..." runtime=io.containerd.runc.v2 type=io.containerd.ttrpc.v1
time="2023-10-28T22:28:14.970285415Z" level=info msg="starting signal loop" namespace=moby path=/run/docker/containerd/daemon/io.containerd.runtime.v2.task/moby/70c12fba1e053069a3b8d0448892154e02c42fdc963e3060e042f8a2667686ba pid=1218 runtime=io.containerd.runc.v2
[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
───────────────────────────────────────

WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Get "https://registry-1.docker.io/v2/": unauthorized: incorrect username or password
................+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*...+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*....+.........+.......+......+...+.........+...+..+.+......+.........+..+...+....+...+...+..+.......+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.+...+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*........+.........+.......+...+..+...+.......+..+.+......+.....+...+...............+.+......+...+...+..+.+......+......+..+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+...............+..+..........+..+...+..........+............+.....+.+........+..........+.....+......+......+....+...........+.........+.+..+.+..............+...+....+...+.....+......+....+..+.+..................+............+..+......+............+...+......+.+..............+...+................+..+....+......+...+......+.........+..+...+......+...+..........+..+....+..+...+............+....+........+.+.........+...........+....+...........+.........+......+.......+.........+.........+...........+......+.......+..+.........+.+...+......+..+....+.....+...+......+.+.....+.........+.....................+....+............+...+......+........+...+.......+...+...+.....+.+......+...+............+..+...+.......+...+..+..........+......+..+.......+..+.+.........+..................+.....+.......+...+..+.........+.......+...+..+...+............+...+....+...........+......+......+.........+....+..+....+...+......+..+...+.+........+......+......+...+...+....+......+.....+..........+..............+......+....+.........+......+...+.....+..........+.....+......+......+.+...+.....+......................+.....+.......+............+...+.....+...+...+.......+.....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
[custom-init] No custom files found, skipping...
[ls.io-init] done.
time="2023-10-28T22:37:36.426084518Z" level=error msg="cleanup working directory in namespace" error="open /opt/docker/containerd/daemon/io.containerd.runtime.v2.task/moby: no such file or directory" namespace=moby
time="2023-10-28T22:37:36.427371707Z" level=error msg="failed to initialize a tracing processor \"otlp\"" error="no OpenTelemetry endpoint: skip plugin"
time="2023-10-28T22:39:04.594102741Z" level=info msg="loading plugin \"io.containerd.event.v1.publisher\"..." runtime=io.containerd.runc.v2 type=io.containerd.event.v1
time="2023-10-28T22:39:04.594309448Z" level=info msg="loading plugin \"io.containerd.internal.v1.shutdown\"..." runtime=io.containerd.runc.v2 type=io.containerd.internal.v1
time="2023-10-28T22:39:04.594360411Z" level=info msg="loading plugin \"io.containerd.ttrpc.v1.task\"..." runtime=io.containerd.runc.v2 type=io.containerd.ttrpc.v1
time="2023-10-28T22:39:04.594841761Z" level=info msg="starting signal loop" namespace=moby path=/run/docker/containerd/daemon/io.containerd.runtime.v2.task/moby/de040c754e63d56f659a0f5b8c6926caffc04e470f8bd016e832a2cb777fab00 pid=946 runtime=io.containerd.runc.v2
time="2023-10-28T22:40:27.417287423Z" level=info msg="loading plugin \"io.containerd.event.v1.publisher\"..." runtime=io.containerd.runc.v2 type=io.containerd.event.v1
time="2023-10-28T22:40:27.417481598Z" level=info msg="loading plugin \"io.containerd.internal.v1.shutdown\"..." runtime=io.containerd.runc.v2 type=io.containerd.internal.v1
time="2023-10-28T22:40:27.417510361Z" level=info msg="loading plugin \"io.containerd.ttrpc.v1.task\"..." runtime=io.containerd.runc.v2 type=io.containerd.ttrpc.v1
time="2023-10-28T22:40:27.417844631Z" level=info msg="starting signal loop" namespace=moby path=/run/docker/containerd/daemon/io.containerd.runtime.v2.task/moby/301da8c11789565b49f0030ec00d9197aa7655f7b651ab5ca568ff62a4176426 pid=1214 runtime=io.containerd.runc.v2
github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

j0nnymoe commented 1 year ago

Try not putting it behind gluetun, that's probably what's making this trip up.

notkudu commented 1 year ago

Try not putting it behind gluetun, that's probably what's making this trip up.

I am trying that rn

notkudu commented 1 year ago

@j0nnymoe you are right, it did work, thanks :)