linuxserver / docker-calibre

GNU General Public License v3.0
339 stars 62 forks source link

Calibre does not autostart with the container #64

Closed apiontek closed 2 years ago

apiontek commented 2 years ago

Expected Behavior

I want to run calibre with the content server automatically starting. Once configured and working, if I restart the container, or stop and start it, I would expect calibre and its content server to automatically start, and the content server to be accessible at my endpoint, without me needing to connect to the separate guacamole endpoint.

Current Behavior

Currently, once I connect to the guacamole endpoint, then calibre starts and the content server becomes accessible.

However, if I launch the container and do not connect to the guacamole endpoint, calibre does not start inside the container and the content server remains dead.

I'm seeing an error during container launch:

/usr/bin/websocat: line 1: Not: command not found

And when I attach to the container (docker exec -i -t xxxxxx /bin/bash) and do cat /usr/bin/websocat it's just a text file saying "Not Found"

Steps to Reproduce

  1. start calibre docker container with docker-compose up
  2. observe websocat error
  3. try to connect to content server endpoint without first connecting to guac endpoint
  4. sadness

Environment

OS: Ubuntu 20.04.3 LTS CPU architecture: x86_64 How docker service was installed: official docker repo

Command used to create docker container (run/create/compose/screenshot)

compose yaml:

version: '3.9'
services:
  calibre:
    image: lscr.io/linuxserver/calibre
    container_name: calibre
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /srv/dck/calibre:/config
      - /tank/media/books/Calibre:/config/Calibre Library
    env_file: /tank/srv/dck/calibre/.env
    dns:
      - 9.9.9.9
      - 8.8.8.8
      - 1.1.1.1
      - 8.8.4.4
    ports:
      - 8470:8080
      - 8471:8081
    restart: unless-stopped
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

.env file:

PUID=1000
PGID=1000
TZ=America/New_York

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

                                                                                                                                          Brought to you by linuxserver.io
-------------------------------------

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

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 12-prep_xrdp: executing...
[cont-init.d] 12-prep_xrdp: exited 0.
[cont-init.d] 13-keygen: executing...

Generating 2048 bit rsa key...

ssl_gen_key_xrdp1 ok

saving to rsakeys.ini

Can't load /config/.rnd into RNG
139891429200320:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:88:Filename=/config/.rnd Generating a RSA private key
........................................+++++
................................+++++
writing new private key to '/etc/xrdp/key.pem'
-----
[cont-init.d] 13-keygen: exited 0.
[cont-init.d] 30-config: executing...
[cont-init.d] 30-config: exited 1.
[cont-init.d] 50-config: executing...
No password is set for the interface.
[cont-init.d] 50-config: exited 0.
[cont-init.d] 55-autostart-config: executing...
[cont-init.d] 55-autostart-config: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
guacd[412]: INFO:       Guacamole proxy daemon (guacd) version 1.1.0 started
guacd[412]: INFO:       Listening on host 0.0.0.0, port 4822
guacd[412]: INFO:       Guacamole connection closed during handshake
Starting guacamole-lite websocket server
listening on *:8080                                                                                                                       guacd[412]: INFO:       Guacamole connection closed during handshake
[guac-init] Auto start set, starting application
/usr/bin/websocat: line 1: Not: command not found
github-actions[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

apiontek commented 2 years ago

Just to add, if I attach to the container and perform:

rm /usr/bin/websocat && \
wget -c https://github.com/vi/websocat/releases/download/v1.9.0/websocat_linux64 -O /usr/bin/websocat && \
chmod +x /usr/bin/websocat

And then restart the container, autostart of calibre & content server works as expected, without the need to access the guacamole endpoint first.

aptalca commented 2 years ago

We already fixed it in the baseimage a couple of days ago. It should have propagated to the latest calibre version build pushed earlier today.

apiontek commented 2 years ago

Yes, this is working now.