Bad gateway or Failed to save draft #3390

Closed
opened 2026-02-05 06:34:52 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @donnib on GitHub (Dec 6, 2022).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Hi,
I am running BookStack as a docker container latest version 22.11 but had this problem for quite some time. The BookStack is behind reverse proxy Traefik with following config :

version: '3.5'

services:
   bookstack:
    image: linuxserver/bookstack
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - DB_HOST=mariadb1
      - DB_USER=bookstack
      - DB_PASS=bookstack
      - DB_DATABASE=bookstackapp
      - APP_URL=https://wiki.******.dk
      - MAIL_USERNAME=******
      - MAIL_PASSWORD=******
      - MAIL_HOST=smtp.gmail.com
      - MAIL_PORT=587
      - MAIL_ENCRYPTION=tls
      - DRAWIO=https://drawio.******.dk/?embed=1&proto=json&spin=1
    volumes:
      - /var/docker_data/bookstack:/config
    restart: always
    networks:
      - proxy
    expose:
      - "80"
    labels:
      - "traefik.http.routers.wikijs_http.entryPoints=internal,web"
      - "traefik.http.routers.wikijs_http.rule=Host(`wiki.******.dk`)"
      - "traefik.http.routers.wikijs_http.service=wikijs_http"
      - "traefik.http.routers.wikijs_http.middlewares=redirect-secure"
      - "traefik.http.services.wikijs_http.loadbalancer.server.port=80"
      
      - "traefik.http.routers.wikijs_https.entryPoints=internalsecure,websecure"
      - "traefik.http.routers.wikijs_https.rule=Host(`wiki.******.dk`)"
      - "traefik.http.routers.wikijs_https.service=wikijs_https"
      - "traefik.http.routers.wikijs_https.tls=true" 
      - "traefik.http.services.wikijs_https.loadbalancer.server.port=80"
networks:
  proxy:
    external: true

I have a dozen other container apps and i have never seen this issue with any of them and only with bookstack. What happens is when i access the URL i get Bad gateway then i try again and after some tries it works then if i click on something inside bookstack i either get the page correctly or get Bad gateway again. Sometimes i start editing then i get Failed to save draft. Ensure you have internet connection before saving this page.

I looked at the logs no errors so i can't figure out what's causing these problem. I looked at bookstack and traefik logs and none shows problems. I tried multiple internet connections and still i see these. Any ideas what might be causing this ?

Exact BookStack Version

22.11

Log Content

No response

PHP Version

No response

Hosting Environment

Docker

Originally created by @donnib on GitHub (Dec 6, 2022). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario Hi, I am running BookStack as a docker container latest version 22.11 but had this problem for quite some time. The BookStack is behind reverse proxy Traefik with following config : ``` version: '3.5' services: bookstack: image: linuxserver/bookstack container_name: bookstack environment: - PUID=1000 - PGID=1000 - DB_HOST=mariadb1 - DB_USER=bookstack - DB_PASS=bookstack - DB_DATABASE=bookstackapp - APP_URL=https://wiki.******.dk - MAIL_USERNAME=****** - MAIL_PASSWORD=****** - MAIL_HOST=smtp.gmail.com - MAIL_PORT=587 - MAIL_ENCRYPTION=tls - DRAWIO=https://drawio.******.dk/?embed=1&proto=json&spin=1 volumes: - /var/docker_data/bookstack:/config restart: always networks: - proxy expose: - "80" labels: - "traefik.http.routers.wikijs_http.entryPoints=internal,web" - "traefik.http.routers.wikijs_http.rule=Host(`wiki.******.dk`)" - "traefik.http.routers.wikijs_http.service=wikijs_http" - "traefik.http.routers.wikijs_http.middlewares=redirect-secure" - "traefik.http.services.wikijs_http.loadbalancer.server.port=80" - "traefik.http.routers.wikijs_https.entryPoints=internalsecure,websecure" - "traefik.http.routers.wikijs_https.rule=Host(`wiki.******.dk`)" - "traefik.http.routers.wikijs_https.service=wikijs_https" - "traefik.http.routers.wikijs_https.tls=true" - "traefik.http.services.wikijs_https.loadbalancer.server.port=80" networks: proxy: external: true ``` I have a dozen other container apps and i have never seen this issue with any of them and only with bookstack. What happens is when i access the URL i get Bad gateway then i try again and after some tries it works then if i click on something inside bookstack i either get the page correctly or get Bad gateway again. Sometimes i start editing then i get Failed to save draft. Ensure you have internet connection before saving this page. I looked at the logs no errors so i can't figure out what's causing these problem. I looked at bookstack and traefik logs and none shows problems. I tried multiple internet connections and still i see these. Any ideas what might be causing this ? ### Exact BookStack Version 22.11 ### Log Content _No response_ ### PHP Version _No response_ ### Hosting Environment Docker
OVERLORD added the 🐕 Support label 2026-02-05 06:34:52 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Dec 6, 2022):

Any ideas what might be causing this ?

Not really, how easy it is to reproduce? First step would to be confirm where the requests are getting to and any errors occuring, by checking/watching the error logs of each layer when this occurs. So start with Traefik when the BookStack container, Just to see if you can gain any extra info to indicate where and what the issue is.

@ssddanbrown commented on GitHub (Dec 6, 2022): > Any ideas what might be causing this ? Not really, how easy it is to reproduce? First step would to be confirm where the requests are getting to and any errors occuring, by checking/watching the error logs of each layer when this occurs. So start with Traefik when the BookStack container, Just to see if you can gain any extra info to indicate where and what the issue is.
Author
Owner

@ssddanbrown commented on GitHub (Dec 12, 2022):

Since there's been no follow-up I'm going to close this. If the issue remains and is something you still require to be fixed respond to my previous comment and this can then be re-opened.

@ssddanbrown commented on GitHub (Dec 12, 2022): Since there's been no follow-up I'm going to close this. If the issue remains and is something you still require to be fixed respond to my previous comment and this can then be re-opened.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3390