sytone / obsidian-remote

Run Obsidian.md in a browser via a docker container.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker compose does not start - Guacamole connection closed during handshake

nkgiovannivl opened this issue · comments

Describe the bug
At first setup of docker compose logs shows error related to Guacamole connection closed during handshake

To Reproduce
Below docker compose:

version: "3"
services:
  obsidian:
    image: 'ghcr.io/sytone/obsidian-remote:latest'
    container_name: obsidian-remote
    restart: always
    ports:
      - 8080:8080
      - 8443:8443
    volumes:
      - obsidian_vaults:/vaults
      - obsidian_config:/config
    environment:
      - PUID=0
      - PGID=0
      - TZ=America/Bogota
      - DOCKER_MODS=linuxserver/mods:universal-git
      - CUSTOM_PORT="8080"
      - CUSTOM_HTTPS_PORT="8443" 
      - CUSTOM_USER=""
      - PASSWORD=""
      - SUBFOLDER=""
    networks:
      macvlan-favernet:
        ipv4_address: 192.168.1.37      
      
networks:
  macvlan-favernet:
    external: true
    name: macvlan-favernet
    
volumes:
  obsidian_vaults:
    external: true
  obsidian_config:
    external: true

Log info from docker:

guacd[1104]: INFO:	Guacamole proxy daemon (guacd) version 1.1.0 started
guacd[1104]: INFO:	Listening on host 0.0.0.0, port 4822
guacd[1104]: INFO:	Guacamole connection closed during handshake
Starting guacamole-lite websocket server
Starting guacamole-lite websocket server
events.js:377
      throw er; // Unhandled 'error' event
      ^
Error: listen EACCES: permission denied "8080"
    at Server.setupListenHandle [as _listen2] (net.js:1314:21)
    at listenInCluster (net.js:1379:12)
    at Server.listen (net.js:1476:5)
    at Object.<anonymous> (/gclient/app.js:217:6)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
    at internal/main/run_main_module.js:17:47
Emitted 'error' event on WebSocketServer instance at:
    at Server.WebSocketServer._onServerError (/gclient/node_modules/ws/lib/WebSocketServer.js:82:50)
    at Server.emit (events.js:400:28)
    at emitErrorNT (net.js:1358:8)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  code: 'EACCES',
  errno: -13,
  syscall: 'listen',
  address: '"8080"',
  port: -1
}
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake
starting sesman in foreground...
Global configuration:
    ListenAddress:            127.0.0.1
    ListenPort:               3350
    EnableUserWindowManager:  1
    UserWindowManager:        startwm.sh
    DefaultWindowManager:     /etc/xrdp/startwm.sh
    ReconnectScript:          /etc/xrdp/reconnectwm.sh
    AuthFilePath:             disabled
Session configuration:
    MaxSessions:              50
    X11DisplayOffset:         10
    KillDisconnected:         0
    IdleTimeLimit:            0
    DisconnectedTimeLimit:    0
    Policy:                   0
Security configuration:
    AllowRootLogin:           1
    MaxLoginRetry:            4
    AlwaysGroupCheck:         0
    RestrictOutboundClipboard: 0
    TSUsersGroup:             (not defined)
    TSAdminsGroup:            (not defined)
Xorg parameters:
    Parameter 00              /usr/lib/xorg/Xorg
    Parameter 01              -config
    Parameter 02              xrdp/xorg.conf
    Parameter 03              -noreset
    Parameter 04              -nolisten
    Parameter 05              tcp
    Parameter 06              -logfile
    Parameter 07              .xorgxrdp.%s.log
Xvnc parameters:
    Parameter 00              Xvnc
    Parameter 01              -bs
    Parameter 02              -nolisten
    Parameter 03              tcp
    Parameter 04              -localhost
    Parameter 05              -dpi
    Parameter 06              96
SessionVariables parameters:
    Parameter 00              PULSE_SCRIPT=/etc/xrdp/pulse/default.pa
[20230525-04:33:54] [DEBUG] libscp initialized
[20230525-04:33:54] [INFO ] starting xrdp-sesman with pid 1094
[20230525-04:33:54] [INFO ] listening to port 3350 on 127.0.0.1
[20230525-04:33:55] [INFO ] A connection received from ::ffff:127.0.0.1 port 59356
[20230525-04:33:55] [WARN ] libscp network error.
[20230525-04:33:55] [DEBUG] Closed socket 7 (AF_INET6 ::ffff:127.0.0.1 port 3350)
[20230525-04:33:55] [INFO ] A connection received from ::ffff:127.0.0.1 port 59366
[20230525-04:33:55] [WARN ] libscp network error.
[20230525-04:33:55] [DEBUG] Closed socket 7 (AF_INET6 ::ffff:127.0.0.1 port 3350)
[20230525-04:33:56] [INFO ] A connection received from ::ffff:127.0.0.1 port 59378
[20230525-04:33:56] [WARN ] libscp network error.
[20230525-04:33:56] [DEBUG] Closed socket 7 (AF_INET6 ::ffff:127.0.0.1 port 3350)
[20230525-04:33:56] [INFO ] A connection received from ::ffff:127.0.0.1 port 59382
[20230525-04:33:56] [WARN ] libscp network error.
[20230525-04:33:56] [DEBUG] Closed socket 7 (AF_INET6 ::ffff:127.0.0.1 port 3350)
[20230525-04:33:57] [INFO ] A connection received from ::ffff:127.0.0.1 port 59394
[20230525-04:33:57] [WARN ] libscp network error.
[20230525-04:33:57] [DEBUG] Closed socket 7 (AF_INET6 ::ffff:127.0.0.1 port 3350)
[20230525-04:33:57] [INFO ] A connection received from ::ffff:127.0.0.1 port 59400
[20230525-04:33:57] [WARN ] libscp network error.
[20230525-04:33:57] [DEBUG] Closed socket 7 (AF_INET6 ::ffff:127.0.0.1 port 3350)
[20230525-04:33:58] [INFO ] A connection received from ::ffff:127.0.0.1 port 59408
[20230525-04:33:58] [WARN ] libscp network error.
[20230525-04:33:58] [DEBUG] Closed socket 7 (AF_INET6 ::ffff:127.0.0.1 port 3350)
[20230525-04:33:58] [INFO ] A connection received from ::ffff:127.0.0.1 port 59420
[20230525-04:33:58] [WARN ] libscp network error.
[20230525-04:33:58] [DEBUG] Closed socket 7 (AF_INET6 ::ffff:127.0.0.1 port 3350)
[20230525-04:33:59] [INFO ] A connection received from ::ffff:127.0.0.1 port 59424
[20230525-04:33:59] [WARN ] libscp network error.
[20230525-04:33:59] [DEBUG] Closed socket 7 (AF_INET6 ::ffff:127.0.0.1 port 3350)
[20230525-04:33:59] [INFO ] A connection received from ::ffff:127.0.0.1 port 59438
[20230525-04:33:59] [WARN ] libscp network error.
[20230525-04:33:59] [DEBUG] Closed socket 7 (AF_INET6 ::ffff:127.0.0.1 port 3350)
[20230525-04:34:00] [INFO ] A connection received from ::ffff:127.0.0.1 port 59442
[20230525-04:34:00] [WARN ] libscp network error.
[20230525-04:34:00] [DEBUG] Closed socket 7 (AF_INET6 ::ffff:127.0.0.1 port 3350)
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake
guacd[1104]: INFO:	Guacamole connection closed during handshake

Expected behavior
Start normally

Screenshots
N/A

Desktop (please complete the following information):

N/A

Smartphone (please complete the following information):

N/A

Additional context
Add any other context about the problem here.

I'm having the same issue.

Same here. Any solution for this available yet?

Having the same problem. Will there be fix for this in the near future?

commented

Ill try this config later this week to see if I can reproduce.

I second that. Same problem for me. I hope somebody else fix it. I've tried using UFW to allow ports. Nothing seems to work.

Using the following docker-compose.yml worked for me. Obsidian-remote now works, but I don't like how it works. It basically uses Guacamole as VNC server/viewer. It doesn't fit the whole browser window if you click on it.

Docker-compose.yml config I found (you can modify it according to your own taste):
version: "3.9"
services:
obsidian:
image: ghcr.io/sytone/obsidian-remote:latest
container_name: Obsidian-Remote
hostname: obsidian-remote
mem_limit: 1g
cpu_shares: 768
security_opt:
- no-new-privileges:true
healthcheck:
test: curl -f http://localhost:8080/ || exit 1
ports:
- 4501:8080
- 27123:27123
- 27124:27124
- 8446:8443
volumes:
- /volume1/docker/obsidian/vaults:/vaults:rw
- /volume1/docker/obsidian/config:/config:rw
environment:
PUID: 1000
PGID: 1000
TZ: America/Sao_Paulo
DOCKER_MODS: linuxserver/mods:universal-git
restart: on-failure:5

same problem here, use shell interact with the container find that the server failed starting.

commented

ghcr.io/sytone/obsidian-remote:latest is outdated with the last release of it 9 months ago. Changes to the base image and some fixes have went out since - @sytone can we get an update to the Docker tag to better help you debug this on the current codebase?

I solved it by removing the "" from the port, like so

- CUSTOM_PORT=8080
- CUSTOM_HTTPS_PORT=8443
commented

I solved it by removing the "" from the port, like so

- CUSTOM_PORT=8080
- CUSTOM_HTTPS_PORT=8443

Hi there! I tried doing what you did but mine just said websocat: invalid port number. I'm doing the installation through Codesandbox for context.

Hi there! I tried doing what you did but mine just said websocat: invalid port number. I'm doing the installation through Codesandbox for context.

I'm getting the same message and when loading the page in a browser I also get Cannot GET /.
This is the state of my docker-compose.

services:
  obsidian:
    image: 'ghcr.io/sytone/obsidian-remote:latest'
    container_name: obsidian-remote
    restart: unless-stopped
    ports:
      - 8081:8081
      - 8443:8443
    volumes:
      - /home/obsidian/vaults:/vaults
      - /home/obsidian/config:/config
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Stockholm
      - DOCKER_MODS=linuxserver/mods:universal-git
      - CUSTOM_PORT=8081
      - CUSTOM_HTTPS_PORT=8443
      - CUSTOM_USER=""
      - PASSWORD=""
      - SUBFOLDER=""
      ```

Hi Guys,

By doing a bit of a mix of the two docker compose that are in this thread here is one that works:

  obsidian:
    image: 'ghcr.io/sytone/obsidian-remote:latest'
    container_name: obsidian-remote
    restart: unless-stopped
    hostname: obsidian-remote
    mem_limit: 2g
    cpu_shares: 768
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: curl -f http://localhost:8080/ || exit 1
    ports:
      - 8080:8080
      - 8443:8443
    volumes:
      - /home/tosmaniac/docker/obsidian/vaults:/vaults
      - /home/tosmaniac/docker/obsidian/config:/config
    environment:
      - PUID=1000
      - PGID=100
      - TZ=European/Berlin
      - DOCKER_MODS=linuxserver/mods:universal-git
#      - CUSTOM_PORT="8080"
#      - CUSTOM_HTTPS_PORT="8443" 
#      - CUSTOM_USER=""
#      - PASSWORD=""
#      - SUBFOLDER=""```

Latest version of obsidian gets installed.

Thank you all.

Florent
commented

It seems like guacd closing the connection during the handshake with guacamole-lite (I think it runs both? unsure to be honest, I've never used guacamole before) because of some improperly mapped configuration files. They exist in the image, but I think unpinned versions caused it to break after initial release.

Looking into the container with docker compose exec -it obsidian-remote /bin/bash I can see that guaclog outputs the following:

root@obsidian-remote:/# guaclog
guaclog: INFO: Guacamole input log interpreter (guaclog) version 1.1.0
guaclog: INFO: No input files specified. Nothing to do.

I also noticed that the user and group within the container is abc:abc, potentially incorrect user mapping is to blame.


I stopped at the point where I'd have to clone the repo and build the image from the Dockerfile as I am running out of time to fiddle with it today, if anyone gets it working definitely let me know.

p.s. the docker compose config from @tosmaniac modified to have the commented fields uncommented and port numbers unquoted was the closest I managed to get, only outputting this error instead of the longer ones above.

obsidian-remote  | guacd[208]: INFO:	Guacamole proxy daemon (guacd) version 1.1.0 started
obsidian-remote  | guacd[208]: INFO:	Listening on host 0.0.0.0, port 4822
obsidian-remote  | Starting guacamole-lite websocket server
obsidian-remote  | listening on *:8080
obsidian-remote  | guacd[208]: INFO:	Guacamole connection closed during handshake
obsidian-remote  | [guac-init] Auto start set, starting application
obsidian-remote  | websocat: invalid port number

I had the websocat: invalid port number, but got it working. I don't understand the fix, but I started removing arguments to get to basic config until I got it working.
Key adjustment steps as I progressed:

  • Remove quotes around port number env variables
  • Remove the SUBFOLDER env variable. An empty string causes problems
  • The last thing I changed that fixed the websocat error was to remove CUSTOM-USER AND PASSWORD env variables. I just switched to auth through my reverse proxy, instead. Here's my final docker-compose:
  obsidian:
    container_name: obsidian
    image: 'ghcr.io/sytone/obsidian-remote:latest'
    restart: unless-stopped
    ports:
      - 8080:8080
    volumes:
      - ./obsidian/vaults:/vaults
      - ./obsidian/config:/config
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/New_York
      - DOCKER_MODS=linuxserver/mods:universal-git

I ended up having to do a number things, which leads me to believe there's not one issue, but several small issues.

Here's my docker-compose.yml

Note: I opted to build using the local Dockerfile since its more up-to-date.
Also, I copied some of this from a prior post.

services:
  obsidian:
    # image: 'ghcr.io/sytone/obsidian-remote:latest'
    build:
      context: ./
      dockerfile: Dockerfile
    container_name: obsidian-remote
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: curl -f http://localhost:7436/ || exit 1
    ports:
      - 7436:8080 # I'm using a different host port to avoid collision
      - 7496:8443 # I'm using a different host port to avoid collision
      - 27123:27123
      - 27124:27124
    volumes:
      - ./my-vaults:/vaults
      - ./my-config:/config
    environment:
      - PUID=1000 # this matches my user when I run `id $USER`
      - PGID=1000 # this matches my user when I run `id $USER`
      - TZ=America/New_York
      - DOCKER_MODS=linuxserver/mods:universal-git
      - CUSTOM_PORT=8080
      - CUSTOM_HTTPS_PORT=8443
      - CUSTOM_USER=yourUser
      - PASSWORD=yourPassword
      # - SUBFOLDER=""

This gave me a little bit of progress, but I couldn't yet open Obsidian successfully. I got some sort of error like /squashfs-root/obsidian is not a directory.
To fix this issue, I modified some of the files that were created within the config directory. (mine is setup to the my-config folder)

Updates to menu.xml

my-config/.config/openbox/menu.xml

<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/3.4/menu">
    <menu id="root-menu" label="MENU">
-      <item label="Obsidian" icon="/squashfs-root/usr/share/icons/hicolor/48x48/apps/obsidian.png">
+       <item label="Obsidian" icon="/usr/share/icons/hicolor/48x48/apps/obsidian.png">
            <action name="Execute">
-               <command>/squashfs-root/obsidian --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer</command>
+               <command>obsidian --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer</command>
            </action>
        </item>
        <item label="xterm" icon="/usr/share/pixmaps/xterm-color_48x48.xpm">
            <action name="Execute">
                <command>/usr/bin/xterm</command>
            </action>
        </item>
        <item label="Reload OB">
            <action name="Reconfigure" />
        </item>
    </menu>
</openbox_menu>
Changes to autostart

my-config/.config/openbox/autostart

- /squashfs-root/obsidian --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer
+ obsidian --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer

The last change is not required, but something I did just to improve my QoL (Qualify of Life).

Changes to Dockerfile
  ...
- ARG OBSIDIAN_VERSION=1.4.16
+ ARG OBSIDIAN_VERSION=1.5.3
  ...

Is this on AMD or ARM?

  obsidian:
    image: 'ghcr.io/sytone/obsidian-remote:latest'
    container_name: obsidian-remote
    restart: unless-stopped
    ports:
      - 6666:8080
      - 8663:8443
    volumes:
      - ${DATA}/obsidian/vaults:/vaults
      - ${DATA}/obsidian/config:/config
    environment:
      - PUID=1003
      - PGID=1003
      - TZ=${TZ}
      - DOCKER_MODS=linuxserver/mods:universal-git
      - CUSTOM_PORT=8080
      - CUSTOM_HTTPS_PORT=8443 
      - CUSTOM_USER=123
      - PASSWORD=123

with this config i got no websocat error, but in the logs i got this:


[2024-02-06 11:28:48] [Connection 1]  Closing connection with error:  Error: WS was inactive for too long
    at ClientConnection.checkActivity (/gclient/node_modules/guacamole-lite/lib/ClientConnection.js:154:24)
    at listOnTimeout (internal/timers.js:557:17)
[2024-02-06 11:28:48] [Connection 1]  Closing guacd connection
    at processTimers (internal/timers.js:500:7)
[2024-02-06 11:28:48] [Connection 1]  Client connection closed
guacd[1135]: ERROR:     User is not responding.
guacd[1135]: INFO:      User "@085c8313-50ce-4eb0-872a-05e831788aae" disconnected (0 users remain)
guacd[1135]: INFO:      Last user of connection "$9225c7a9-a824-415c-8041-03bcd513541e" disconnected
guacd[1135]: INFO:      Internal RDP client disconnected
guacd[1100]: INFO:      Connection "$9225c7a9-a824-415c-8041-03bcd513541e" removed.
rdpClientConRecv: g_sck_recv failed(returned 0)
rdpClientConRecvMsg: error
rdpClientConCheck: rdpClientConGotData failed
rdpClientConDisconnect:
rdpRemoveClientConFromDev: removing clientCon 0x5617e058a850

it doesnt matter if i use the last four lines with the costum ports, user and passwort, same result.

does anybody got it working?

  obsidian:
    image: 'ghcr.io/sytone/obsidian-remote:latest'
    container_name: obsidian-remote
    restart: unless-stopped
    ports:
      - 6666:8080
      - 8663:8443
    volumes:
      - ${DATA}/obsidian/vaults:/vaults
      - ${DATA}/obsidian/config:/config
    environment:
      - PUID=1003
      - PGID=1003
      - TZ=${TZ}
      - DOCKER_MODS=linuxserver/mods:universal-git
      - CUSTOM_PORT=8080
      - CUSTOM_HTTPS_PORT=8443 
      - CUSTOM_USER=123
      - PASSWORD=123

with this config i got no websocat error, but in the logs i got this:


[2024-02-06 11:28:48] [Connection 1]  Closing connection with error:  Error: WS was inactive for too long
    at ClientConnection.checkActivity (/gclient/node_modules/guacamole-lite/lib/ClientConnection.js:154:24)
    at listOnTimeout (internal/timers.js:557:17)
[2024-02-06 11:28:48] [Connection 1]  Closing guacd connection
    at processTimers (internal/timers.js:500:7)
[2024-02-06 11:28:48] [Connection 1]  Client connection closed
guacd[1135]: ERROR:     User is not responding.
guacd[1135]: INFO:      User "@085c8313-50ce-4eb0-872a-05e831788aae" disconnected (0 users remain)
guacd[1135]: INFO:      Last user of connection "$9225c7a9-a824-415c-8041-03bcd513541e" disconnected
guacd[1135]: INFO:      Internal RDP client disconnected
guacd[1100]: INFO:      Connection "$9225c7a9-a824-415c-8041-03bcd513541e" removed.
rdpClientConRecv: g_sck_recv failed(returned 0)
rdpClientConRecvMsg: error
rdpClientConCheck: rdpClientConGotData failed
rdpClientConDisconnect:
rdpRemoveClientConFromDev: removing clientCon 0x5617e058a850

it doesnt matter if i use the last four lines with the costum ports, user and passwort, same result.

does anybody got it working?

I'm having the same issue, Tried all suggested changes above but nothing is working for me.

I was able to get it working by pulling this newer image not from ghcr.io

services:
  obsidian:
    image: sytone/obsidian-remote:latest
    container_name: obsidian
    hostname: obsidian
    restart: unless-stopped
    ports:
      - 8080:8080
      - 8443:8443
    volumes:
      - /obsidian/vaults:/vaults
      - /obsidian/config:/config
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Toronto
      - DOCKER_MODS=linuxserver/mods:universal-git```