linuxserver / docker-calibre

GNU General Public License v3.0
366 stars 64 forks source link

[BUG] Calibre App not launching #128

Closed Just4Link closed 9 months ago

Just4Link commented 1 year ago

Is there an existing issue for this?

Current Behavior

When i spin up in portainer a new stack with the example given from github it i only see the kasm workspace but the calibre app dont launch.

Expected Behavior

See a calibre window when connect to the ip:port

Steps To Reproduce

New stack in portainer with this

services: calibre: image: lscr.io/linuxserver/calibre:latest container_name: calibre security_opt:

Environment

- OS: Ubuntu 22.04
- How docker service was installed: instraction from offical docker site

CPU architecture

x86-64

Docker creation

services:
  calibre:
    image: lscr.io/linuxserver/calibre:latest
    container_name: calibre
    security_opt:
      - seccomp:unconfined #optional
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      #- PASSWORD= #optional
      #- CLI_ARGS= #optional
    volumes:
      - /docker/calibre/data:/config
    ports:
      - 8080:8080
      - 8181:8181
      - 8081:8081
    restart: unless-stopped

Container logs

[migrations] started
[migrations] no migrations found
───────────────────────────────────────

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

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

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

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

User UID:    1000
User GID:    1000
───────────────────────────────────────

[custom-init] No custom files found, skipping...
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.

Xvnc KasmVNC 1.1.0 - built Apr  7 2023 19:59:10
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

[ls.io-init] done.
Obt-Message: Xinerama extension is not present on the server
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-abc'
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.

aptalca commented 1 year ago

Try actual docker compose instead of portainer

Just4Link commented 1 year ago

ok tried it with docker compose but same result

calibre

Just4Link commented 1 year ago

I downgraded now to the tag lscr.io/linuxserver/calibre:6.14.1 and calibre works again like a charm. With 6.15.0 the mess starts.

rcarmo commented 1 year ago

Yep. Came here to confirm this. Also, with the new base image I lost the ability to connect to the desktop directly via RDP (which is much more efficient than VNC).

j0nnymoe commented 1 year ago

@rcarmo be so kind to provide information about your setup, would be useful.

j0nnymoe commented 1 year ago

I'm not able to replicate this issue.

Just done some testing of the container across the platforms I have access to:

Synology: https://hastebin.com/share/iyebikavak.yaml QNAP: https://hastebin.com/share/umawixifem.yaml Zimaboard: https://hastebin.com/share/iseceyejuv.yaml

Note, I could only get the webui to show up on the HTTPs port across all platforms so that is likely a pebcak on my part.

j0nnymoe commented 1 year ago

@rcarmo RDP won't be coming back to the image. You can see info about the new KasmVNC baseimage here: https://www.linuxserver.io/blog/webtop-2-0-the-year-of-the-linux-desktop#we-are-approaching-reality

rcarmo commented 1 year ago

That’s too bad, since I use an iPad to connect to my Calibre instance and I also see that KasmVNC does not work correctly with Safari (besides also breaking RFB, judging from my tests).

Since I remote to GPU accelerated RDP instances (and maintain a couple of images for that) just fine I guess I will have to roll my own.

Regardless, the current image (running in Docker compose on a Ubuntu host) does not work for me even if I use Firefox or Chromium to reach it - something seems fundamentally broken, and I am rather sad this change made it through without enough testing.

j0nnymoe commented 1 year ago

We tested it as much as we physically can within the team, for example, I can't replicate any issues booting this image across the platforms I listed above. Like I asked previously, if you provide information about your setup, it helps us try to figure out what's going on.

Just4Link commented 1 year ago

My machine is a Minisforum HM80 with 64GB RAM and a AMD Ryzen 7 4800U. There i set up a VM with the latest ubuntu server 22.04.2. Apt update are the latest. On this VM is only docker running, installed with the instructions given from der official docker site. Im currently running 41 conatainers in this VM without problems and all spun up with portainer stacks. Only portainer itself with docker compose.

I have a second VM with the same specifications for testing purposes new containers before i spin up on my main docker vm.

On the main docker vm updates on containers where made by watchtower and yes i read about you not like this method. But on my testing vm there is all handmade without watchtower. Further more after every new test i reset the machine to the state before with backups -> Bring up the vm -> apt update upgrade -> backup -> test my stuff -> revert to backup.

On both vm's i was unable to get the newer images 6.15+ to work. The logs spit not out more what i posted above in first post.

j0nnymoe commented 1 year ago

@Just4Link Thanks - though I should've stated that my comment about setup info was directed at you :) - only question I've got abotu your setup is kernel version uname -a.

Just4Link commented 1 year ago

From Proxmox Host: Linux PVE-Alpha 5.15.104-1-pve #1 SMP PVE 5.15.104-1 (2023-03-29T15:51Z) x86_64 GNU/Linux From Ubuntu VM Docker Main Linux docker 5.15.0-69-generic #76-Ubuntu SMP Fri Mar 17 17:19:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux From Ubuntu VM Docker Test Linux docker-beta 5.15.0-69-generic #76-Ubuntu SMP Fri Mar 17 17:19:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Just4Link commented 1 year ago

Hope that helps further :D

thelamer commented 1 year ago

That’s too bad, since I use an iPad to connect to my Calibre instance and I also see that KasmVNC does not work correctly with Safari (besides also breaking RFB, judging from my tests).

The main dev for KasmVNC exclusively tests on Apple devices, and I assure you not only does it work on Safari but all Safari mobile versions as well.

IMG_0007

RDP was a side effect of the underlying technology stack to deliver to web not an advertised feature. The goal of all of the GUI app containers was always to convert desktop to web.

RDP specifically xrdp in Linux is not more efficient than this web native protocol as it lacks the ability to send graphics primitives and remoteFX like you would get with a native windows server. I would be interested in your benchmarks comparing RDP in Linux to KasmVNC, please post them when you get a chance.

thelamer commented 1 year ago

@Just4Link outside of Synology hardware with 2014 era processors and 2019 era Docker the common thread I am noticing here is Portainer Stacks. Other users have reported similar issues to yours when using Portainer Stacks I would be very interested in a the docker inspect output from this container launched in your setup. Portainer must be tacking on some kind of restrictions on top of what standard Docker compose/Docker run does.

I tried to test portainer locally but it looks like their current CE version is broken. https://github.com/portainer/portainer/issues/8461

NebKi commented 1 year ago

I think this has to do with specific browser settings, something obscure. I'm running this docker on Unraid and on Chrome it works fine. On Firefox only when it's a fully clean unaltered version it seems. But then the new Mullvad Browser also works consistently which is a stricter version of Firefox. As soon as I install some extensions on Firefox (even when they are disabled) the KasmVNC session won't connect anymore. It will often run one time after I start a new Firefox session, but 1 refresh and it won't connect anymore. Been changing some about:config settings and lowering security settings, but nothing seems to work. This is all on Windows 10.

Hopefully the KasmVNC devs find a solution to this, because right now it's just not solid enough and I don't feel like it gets tested thoroughly enough throughout different browsers and setups. With Guacamole I never had this issue and it would connect perfectly.

j0nnymoe commented 1 year ago

For what it's worth, I solely run Firefox and have had zero issues accessing calibre.

NebKi commented 1 year ago

For what it's worth, I solely run Firefox and have had zero issues accessing calibre.

I'm happy it works for you, but that still doesn't give me any information to work on. Are you on Windows? Is it Windows 10? Did you change any default Firefox settings. Are you using any extensions? Did you connect to calibre and then reloaded that page with F5, does it still work? Etcetera.

I've spent about 6 hours troubleshooting this right now. Going through different browser versions from Firefox, with clean versions and versions with installed extensions. Compared specific advanced settings between my Firefox and Mullvad browser and although there are many settings that differ, nothing jumps out as potential cause for this problem.

Just4Link commented 1 year ago

ok .. things getting weird .. but i come to the conclusion it has nothing to do with the image ....

i just give it a extra try and connected to the instance on my test vm on port 8080 with blank kasm workspace screen and give port https 8181 a extra try too result was a blank kasm screen too ... but when i pressed the refresh button f5 it loads up the calibre screen oO but i must every time i visit the site the refresh thing. On port 8080 this refresh trick didnt work ... also to mention this was on google chrome

I normally use firefox and with it no of the ports work.

So ... i have a vm with kasm workspace and i tried there chrome, brave and firefox .. result: every port works there like a charm without problems on each browser, port 8080 and 8181.

Big excuse from me for this bug report ... but it also states out kasm have a problem browser setups ... cookies or extensions ...

With firefox it does no matter in normal mode or incognito without extensions .. it fails on my pc ... Google chrome wokrs in incognito on both ports .. but with the refresh thing each time i connect and only port 8181 in normal mode on my pc

On my smartphone i have firefox and chrome ... only chrome on port 8181 works there

thelamer commented 1 year ago

I think this has to do with specific browser settings, something obscure. I'm running this docker on Unraid and on Chrome it works fine. On Firefox only when it's a fully clean unaltered version it seems. But then the new Mullvad Browser also works consistently which is a stricter version of Firefox. As soon as I install some extensions on Firefox (even when they are disabled) the KasmVNC session won't connect anymore. It will often run one time after I start a new Firefox session, but 1 refresh and it won't connect anymore. Been changing some about:config settings and lowering security settings, but nothing seems to work. This is all on Windows 10.

Hopefully the KasmVNC devs find a solution to this, because right now it's just not solid enough and I don't feel like it gets tested thoroughly enough throughout different browsers and setups. With Guacamole I never had this issue and it would connect perfectly.

Maybe WebRTC being enabled/disabled. There is a UDP mode that will run some tests in the init logic to try to peer up. But I have not been able to break that, though I would think many security focused extensions might block or disable that in a non standard way.

NebKi commented 1 year ago

I think this has to do with specific browser settings, something obscure. I'm running this docker on Unraid and on Chrome it works fine. On Firefox only when it's a fully clean unaltered version it seems. But then the new Mullvad Browser also works consistently which is a stricter version of Firefox. As soon as I install some extensions on Firefox (even when they are disabled) the KasmVNC session won't connect anymore. It will often run one time after I start a new Firefox session, but 1 refresh and it won't connect anymore. Been changing some about:config settings and lowering security settings, but nothing seems to work. This is all on Windows 10. Hopefully the KasmVNC devs find a solution to this, because right now it's just not solid enough and I don't feel like it gets tested thoroughly enough throughout different browsers and setups. With Guacamole I never had this issue and it would connect perfectly.

Maybe WebRTC being enabled/disabled. There is a UDP mode that will run some tests in the init logic to try to peer up. But I have not been able to break that, though I would think many security focused extensions might block or disable that in a non standard way.

Tried it with webRTC on or off (both in browser as in KasmVNC), no success. Also experimented with settings regarding mixed content. But that does not work either. It's just weird to me that it will often start up fine on a clean session and first start. And then after a refresh it just won't reconnect. So the browser is able to connect and function, but then something is blocking it after that. Hopefully someone smarter than me has other ideas.

micnik8 commented 1 year ago

I run Calibre on a Synology NAS. I'm getting the same issue. Ever since the update I get an error and can't connect with KasmVNC. I have tried to completely rebuild the container from scratch, but still get the same error. Different web browsers don't work for me; I tried Chrome, Brave, Safari, and Firefox. I have tried accessing Calibre from an iPad, still nothing. I have double checked that I have all necessary parameters such as --security-opt seccomp=unconfined. Nothing has worked for me to fix the issue. I am rolling back the update to 6.14.1 until this is fixed. Screenshot 2023-04-09 at 7 09 14 PM

thelamer commented 1 year ago

I run Calibre on a Synology NAS. I'm getting the same issue. Ever since the update I get an error and can't connect with KasmVNC. I have tried to completely rebuild the container from scratch, but still get the same error. Different web browsers don't work for me; I tried Chrome, Brave, Safari, and Firefox. I have tried accessing Calibre from an iPad, still nothing. I have double checked that I have all necessary parameters such as --security-opt seccomp=unconfined. Nothing has worked for me to fix the issue. I am rolling back the update to 6.14.1 until this is fixed. Screenshot 2023-04-09 at 7 09 14 PM

Can you please post the model of your Synology and the output of uname -a runc --version

micnik8 commented 1 year ago

Model: Synology DS220+ I captured the commands through the Docker terminal on the NAS. If you need it another way, please let me know.

Screenshot 2023-04-09 at 8 12 41 PM
thelamer commented 1 year ago

Model: Synology DS220+ I captured the commands through the Docker terminal on the NAS. If you need it another way, please let me know. Screenshot 2023-04-09 at 8 12 41 PM

Thanks for the info, and are you running seccomp unconfined as well?

micnik8 commented 1 year ago

Yes.

micnik8 commented 1 year ago

Well, this is embarrassing. I tried to recreate the container from scratch one more time and for some reason it works. I have no idea what changed to fix this, but I am now running 6.15.1 successfully with KasmVNC. I am able to successfully access locally and by URL from an external network.

EDIT: After stopping the container to update a few parameters such as a custom username, the new version no longer works for me. I tried to undo everything before the new version worked, and now the new version just doesn't work anymore. I don't get it. I don't get why it worked momentarily just to stop after stopping the container and restarting it.

micnik8 commented 1 year ago

UPDATE: Well after a couple hours I believe I have figured out what was causing my issue. This whole thing is giving me whiplash. I believe my issue was related to my Synology's firewall. Whenever I created test containers to attempt to see if the issue is a configuration issue, I would always make sure I add the specific external port numbers I mapped with the container's internal ones. I even restarted my NAS at one point to see if that would fix the issue. Turns out even though I added exceptions to allow specific ports AND filtered by exception of built-in applications (there are 3 ways to add exceptions to the firewall: first is by check-marking by built-in application, second is by typing in the specific port number, and third is a custom option) the firewall appeared to still be blocking the ports. I turned off the firewall entirely and Calibre started working through KasmVNC. Then I turned the firewall back on and it continued working. Previously I tried to recreate the container from scratch and that magically worked when previous attempts did not; then I stopped that container to adjust some parameters, and when I attempted to restart after adjustment, Calibre just wouldn't work again. The firewall on the Synology NAS is glitchy as hell apparently.

thelamer commented 1 year ago

Bugfixes have been applied to the base specifically to address networks that might not have internet access.

Between that fix and fallback if audio cannot be started please try pulling the latest image and letting me know.

Tailslide commented 1 year ago

@thelamer This latest version works for me with no errors. Thanks!

DunklerPhoenix commented 1 year ago

For me it doesn't work. Calibre still not start.

But I found out that I can ssh into the container, go to /opt/calibre, launch calibre with ./calibre and it appears in the vnc brave_Fb7YcgFqq1

Could it be that the image starts calibre too fast? So maybe the usage of a lil sleep could help?

thelamer commented 1 year ago

For me it doesn't work. Calibre still not start.

But I found out that I can ssh into the container, go to /opt/calibre, launch calibre with ./calibre and it appears in the vnc brave_Fb7YcgFqq1

Could it be that the image starts calibre to fast?

Can't you just right click the desktop and launch the application from the openbox menu? I will look into possible race conditions but the s6 init ordering should be handling this.

DunklerPhoenix commented 1 year ago

If calibre already started once and closed: yes. But if not I get the blue error screen (https://github.com/linuxserver/docker-calibre/issues/128#issuecomment-1501257963) and on this screen I can't right-click

Tailslide commented 1 year ago

FWIW my successful Synology tests involved an existing calibre config I wasn't starting from scratch.

NebKi commented 1 year ago

I've installed the latest docker on my Unraid server, the Firefox issue didn't get fixed unfortunately. But I also got errors in my logs while starting the docker. Not sure if they are important or relevant.

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root' Traceback (most recent call last): File "calibre/gui2/ui.py", line 138, in __init__ File "calibre/gui2/ui.py", line 156, in init_iaction File "calibre/customize/__init__.py", line 646, in load_actual_plugin File "importlib/__init__.py", line 126, in import_module File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "calibre/customize/zipplugin.py", line 199, in exec_module File "calibre/customize/zipplugin.py", line 195, in get_code File "calibre_plugins.savetoformat.savetoformataction", line 53 print 'Default saving' ^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)? qt.gui.imageio: libpng warning: iCCP: known incorrect sRGB profile

jnaskali commented 1 year ago

I have the same error message on a custom pc. Downgraded to 6.14.1, which runs well.

kernel: 6.2.10-arch1-1 runc version: 1.1.6 spec: 1.0.2-dev go: go1.20.3 libseccomp: 2.5.4

Salvora commented 1 year ago

Same problem with synology NAS

j0nnymoe commented 1 year ago

@Salvora Please don't just same problem. Provide some useful information that helps us diagnose the issue.

Salvora commented 1 year ago

Well, sorry about that. The problem was almost the same. Going into details: Environment: Synology NAS 718+ Using portainer and trying to deploy the calibre stack, I get the following error everytime the container starts:

[migrations] started
[migrations] no migrations found
───────────────────────────────────────
      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 
   Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    1033
User GID:    100
───────────────────────────────────────
[custom-init] No custom files found, skipping...
[ls.io-init] done.
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
Xvnc KasmVNC 1.1.0 - built Apr 10 2023 22:15:13
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Error: Connection refused
    at PulseAudioContext.<anonymous> (/kclient/node_modules/pulseaudio2/lib/pulse.js:120:36)
    at /kclient/node_modules/pulseaudio2/lib/pulse.js:133:21
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
Kclient was unable to init audio, it is possible your host lacks support!!!!
Error: Access denied
    at /kclient/node_modules/pulseaudio2/lib/pulse.js:133:21
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
Kclient was unable to init audio, it is possible your host lacks support!!!!
Underlying X server release 12014000, The X.Org Foundation
Obt-Message: Xinerama extension is not present on the server
Openbox-Message: Unable to find a valid menu file "/var/lib/openbox/debian-menu.xml"
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-abc'
Failed to initialize plugin: '/config/.config/calibre/plugins/DeDRM.zip'
Failed to initialize plugin: '/config/.config/calibre/plugins/Goodreads.zip'

My compose is below:

version: "3.9"
services:
  calibre-vm:
    image: lscr.io/linuxserver/calibre:latest
    container_name: Calibre-VM
    security_opt:
      - seccomp:unconfined #optional
    labels:
      - "com.centurylinklabs.watchtower.enable"
    environment:
      - PUID=1033
      - PGID=100
      - TZ=Europe/Istanbul
      - CUSTOM_USER=User
      - PASSWORD=Pass
    volumes:
      - /volume1/Files/Books:/Files/Books
      - /volume1/docker/Calibre-VM/config:/config
    ports:
      - 9070:8080
      - 9071:8081
      - 9072:8181
    restart: unless-stopped
    networks:
      - default

networks:
  default:
    name: calibre_network
    external: true

and when I try to launch calibre with the ports I get the same screen as @micnik8 https://github.com/linuxserver/docker-calibre/issues/128#issuecomment-1501249727

I have to push connect, refresh the page. Only then Calibre screen launches.

I can give more information if requested.

thelamer commented 1 year ago

I have fixed a bug with a race condition in the base and this image has been rebuilt, please try the latest one.

NebKi commented 1 year ago

I have fixed a bug with a race condition in the base and this image has been rebuilt, please try the latest one.

This solved my problem being on Windows 11 with Firefox beta 112.0.1 (64-bits)! Even with all my extensions on and after refreshing multiple times Calibre keeps loading. Thank you!

Just4Link commented 1 year ago

I can confirm the latest build runs perfect. Thank you guys for that great support <3

DancingMolly commented 1 year ago

I run Calibre on a Synology NAS. I'm getting the same issue. Ever since the update I get an error and can't connect with KasmVNC. I have tried to completely rebuild the container from scratch, but still get the same error. Different web browsers don't work for me; I tried Chrome, Brave, Safari, and Firefox. I have tried accessing Calibre from an iPad, still nothing. I have double checked that I have all necessary parameters such as --security-opt seccomp=unconfined. Nothing has worked for me to fix the issue. I am rolling back the update to 6.14.1 until this is fixed. Screenshot 2023-04-09 at 7 09 14 PM

I am also getting this same issue on the current latest tag. Typing out (it's not highlightable, probably not great for debugging any future issues either) the full error, so it gets indexed by Google so others can find this thread too:

noVNC encountered an error:
Uncaught TypeError: Cannot read properties of undefined (reading 'lastActiveAt')
https://<host>/vnc/dist/main.bundle.js:22629:61

This is on a Ubuntu 20.04 LTS host

% uname -a           
Linux calibre 5.4.0-126-generic #142-Ubuntu SMP Fri Aug 26 12:12:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
% runc --version
runc version 1.1.4
commit: v1.1.4-0-g5fd4c4d
spec: 1.0.2-dev
go: go1.18.7
libseccomp: 2.5.1

Applicable docker-compose.yml:

version: "3.7"

x-logging: &default-logging
  driver: "json-file"
  options:
    max-file: "10"
    max-size: "1M"

networks:
  public:
    external: true

services:
  ### Calibre #############################################
  calibre:
    container_name: calibre
    image: lscr.io/linuxserver/calibre
    environment:
      - CALIBRE_OVERRIDE_DATABASE_PATH=/config/metadata.db
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
    volumes:
      - ./calibre:/config
      - /mnt/media/books:/mnt/media/books
    networks:
      - public
    security_opt:
      - seccomp:unconfined
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=public"
      - "traefik.http.routers.calibre.rule=Host(`calibre.<host>`)"
      - "traefik.http.routers.calibre.entrypoints=https"
      - "traefik.http.routers.calibre.tls=true"
      - "traefik.http.routers.calibre.service=calibre"
      - "traefik.http.services.calibre.loadbalancer.server.port=8080"
      - "traefik.http.routers.ccs.rule=Host(`ccs.<host>`)"
      - "traefik.http.routers.ccs.entrypoints=https"
      - "traefik.http.routers.ccs.tls=true"
      - "traefik.http.routers.ccs.service=ccs"
      - "traefik.http.services.ccs.loadbalancer.server.port=8081"
    restart: unless-stopped

docker logs calibre shows no egregious errors:

[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:    1000
User GID:    1000
───────────────────────────────────────

[custom-init] No custom files found, skipping...
[ls.io-init] done.
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

Xvnc KasmVNC 1.1.0 - built Apr 19 2023 17:28:36
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

Obt-Message: Xinerama extension is not present on the server
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-abc'

Build was working fine until the switch to an image built with KasmVNC.

I am running traefik in front from a separate compose file, with a user defined using the basicauth module. I can provide the configuration of this if it would be helpful? lastActiveAt in the error may be related to something to do with that user?

thelamer commented 1 year ago

@DancingMolly does it work without traefik? Try 8080 out to the host and hit it directly first, see if it's a proxy config thing.

DancingMolly commented 1 year ago

@DancingMolly does it work without traefik? Try 8080 out to the host and hit it directly first, see if it's a proxy config thing.

I can confirm that it loads when accessing port 8080 directly, without traefik. So it's traefik's proxy that's breaking it somehow. Interestingly, I have just realised that I don't actually apply the basic auth protection to the calibre router in my config above (which is the file from my install), so it's definitely a traefik thing and not the auth module.

I've also realised I can recreate this issue pretty consistently. If I access the container through traefik in an incognito browser it loads successfully. If I modify the traefik or calibre docker compose file (i.e. adding the ports definition to expose the container directly) and rebuild either container with docker-compose up -d, then I get the above lastActiveAt error without manually refreshing the page. Nothing I can do will bring back the working session, except restarting the incognito browser and reaccessing the URL through traefik. This includes clearing cache, hard-refresh, etc.

I have confirmed this by restarting my main (non-incognito) browser, which successfully managed to load the KasmVNC Calibre window too.

traefik docker-compose file:

---
version: "3.7"

networks:
  default:
    name: public

services:
  ### Traefik #############################################
  traefik:
    container_name: traefik
    image: traefik
    ports:
      - 443:443
    command:
      - "--log.level=DEBUG"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.https.address=:443"
      - "--pilot.token=<sanitised>"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro # So that Traefik can listen to Docker events
      - /etc/localtime:/etc/localtime:ro
      - ./users:/root/users:ro
    labels:
      ####### Dashboard Config ####################################################################
      - "traefik.enable=true"
      - "traefik.docker.network=public"
      - "traefik.http.routers.traefik.rule=Host(`traefik.<host>`)"
      - "traefik.http.routers.traefik.entrypoints=https"
      - "traefik.http.routers.traefik.tls=true"
      - "traefik.http.routers.traefik.service=api@internal"
      - "traefik.http.services.traefik.loadbalancer.server.port=8080"
      - "traefik.http.routers.traefik.middlewares=basic-auth"
      ####### Traefik Config ######################################################################################
      - "traefik.http.middlewares.basic-auth.basicauth.usersfile=/root/users"
      - "traefik.http.middlewares.basic-auth.basicauth.removeheader=true"
    restart: unless-stopped
sjthespian commented 1 year ago

I am seeing the same issue with the new version while running the docker container from ghcr.io/linuxserver/calibre:latest. If I connect directly to the service on port 8080, it works. However, if I connect via. nginx with ProxyPass I see the same undefined error about UI.rfb.lastActiveAt that others have reported.

EDIT: Is this because it is using the URL in the browser to try and connect to a websocket? Looking at the browser console, I see this error in the failed session via. the proxy: in.bundle.js:13489 WebSocket connection to 'wss://plex.myproxydomain.com/websockify' failed:.

This proxy config works fine with the older version:

        location /calibre/ {
                rewrite ^/calibre/(.*)$ /$1 break;
                proxy_pass http://calibre/;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection $http_connection;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header X-Forwarded-User $remote_user;
                proxy_no_cache $cookie_session;

        }

and the upstream config for calibre is about as basic as it gets:

upstream calibre {
        server 127.0.0.1:8080;
}
sjthespian commented 1 year ago

DING DING DING -- the websocket appears to be the issue. I just added the following to my nginx config and now requests through the proxy are working!

        location /websockify {
                proxy_pass http://calibre;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                proxy_set_header Host $host;
        }
markchaik commented 1 year ago

I assume a similar fix will help those experiencing the issue with Traefik. Anyone with expertise know how to achieve something similar in Traefik?

DING DING DING -- the websocket appears to be the issue. I just added the following to my nginx config and now requests through the proxy are working!

        location /websockify {
                proxy_pass http://calibre;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                proxy_set_header Host $host;
        }
kausar007 commented 1 year ago

I am having the same issue. Tried both with traefik and direct without traefik, still doesnt work.

image