linuxserver / docker-bookstack

A Docker container for the BookStack documentation wiki
GNU General Public License v3.0
762 stars 108 forks source link

wkhtmltopdf segfault #76

Closed danielfaulknor closed 3 years ago

danielfaulknor commented 3 years ago

linuxserver.io


Expected Behavior

As per docs, update bookstack to use /usr/bin/wkhtmltopdf to generate PDFs

Current Behavior

The process has been signaled with signal "11".

Steps to Reproduce

  1. Update .env to point to /usr/bin/wkhtmltopdf
  2. Attempt to export a book to PDF

Environment

OS: Debian 10 CPU architecture: x86_64 How docker service was installed: DockerHub

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

version: '3.2'

secrets:
  bookstack_db_password:
    external: true

services:
  bookstack:
    image: linuxserver/bookstack
    secrets:
      - bookstack_db_password
    environment:
      - PUID=1000
      - PGID=1000
      - APP_URL=https://xxxxxxxxxxxxxxxxx
      - DB_HOST=db
      - DB_USER=bookstack
      - FILE__DB_PASS=/run/secrets/bookstack_db_password
      - DB_DATABASE=bookstack
    volumes:
      - /srv/bookstack/data/bookstack:/config
    networks:
      - db-net
      - traefik-net
    deploy:
      mode: replicated
      replicas: 1
      labels:
        - traefik.frontend.rule=Host:xxxxxxxxxxxxxxx
        - traefik.enable=true
        - traefik.backend.loadbalancer.swarm=true
        - traefik.http.services.portainer.loadbalancer.server.port=80
        - traefik.docker.network=traefik-net

networks:
  db-net:
    external:
      name: db-net
  traefik-net:
    external:
      name: traefik-net

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...
[env-init] DB_PASS set from FILE__DB_PASS
[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] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing...
App Key found - setting variable for seds
Running config - db_user set
sed: unmatched '/'
/var/run/s6/etc/cont-init.d/50-config: line 86: warning: command substitution: ignored null byte in input
/var/run/s6/etc/cont-init.d/50-config: line 86: warning: command substitution: ignored null byte in input
Nothing to migrate.
[cont-init.d] 50-config: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
github-actions[bot] commented 3 years ago

Thanks for opening your first issue here! Be sure to follow the issue template!

Flight777 commented 3 years ago

Can report the same error! 👍

danielfaulknor commented 3 years ago

@chbmb @alex-phillips ?

ssddanbrown commented 3 years ago

Double checked this on my dev system (Ubuntu 20.10 host), Seems to work fine when adding WKHTMLTOPDF=/usr/bin/wkhtmltopdf to the .env file.

Couple of questions that may help diagnose this.

danielfaulknor commented 3 years ago

Removing the Custom HTML does indeed fix it...

https://gist.github.com/danielfaulknor/fcc615b9f75553ec555da1f1acedefe8

ssddanbrown commented 3 years ago

@danielfaulknor Cool, Thanks for confirming. Likely not something that the lsio team can do anything about then so probably worth closing this to save their time.

If you can nail down what might be causing this in that code then feel free to raise on https://github.com/BookStackApp/BookStack/issues, it might be the case we have to filter stuff out or provide some level of non-export custom HTML content.