Error saving draft #4836

Closed
opened 2026-02-05 09:19:43 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @nesges on GitHub (Jun 25, 2024).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

The automatic saving of drafts pops an error message in our installation under https://wiki.pnpde.social:

image

The errors in the javascript console happen right on load of the page, the popup error message some seconds after.

I reviewed the older issues to this error but was unable to find a solution for us. Here's some information about our system:

  • APP_URL is set to our base path in .env (APP_URL=https://wiki.pnpde.social)
  • nothing related in storage/logs/laravel.log
  • nothing related in nginx' logs
  • APP_DEBUG=true revealed no additional output
  • BookStack v24.05.2 (the error also happend before, it's not specific to v24.05.2)
  • nginx version: nginx/1.18.0 (Ubuntu)
  • Ubuntu 22.04.4 LTS (Linux oghma 5.15.0-112-generic #122-Ubuntu SMP Thu May 23 07:48:21 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux)

nothing too fancy in nginx, I think:

include snippets/robots.conf;  # sets $badagent dependent on $http_user_agent

server {
    listen 443 ssl; 
    listen [::]:443 ssl;
    server_name wiki.pnpde.social;
    
    access_log  /var/log/nginx/wiki.pnpde.social/wiki-access.log anonymized;
    error_log   /var/log/nginx/wiki.pnpde.social/wiki-error.log;

    root /opt/BookStack/public;
    
    index index.php index.html;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
    
    location /register {
        try_files $uri $uri/ /index.php?$query_string;
    }
  
    location /rss {
        proxy_pass https://oghma.pnpde.social/wiki/rss.php;
    }
    
    location /rss-public {
        proxy_pass https://oghma.pnpde.social/wiki/rss-public.php;
    }
    
    location /helper {
        alias /var/www/nginx/wiki.pnpde.social;
        include snippets/php-fpm.conf;
    }

    ssl_certificate /etc/dehydrated/certs/pnpde.social/fullchain.pem;
    ssl_certificate_key /etc/dehydrated/certs/pnpde.social/privkey.pem;
    
    location = /favicon.ico                { alias /opt/BookStack/favicon/favicon.ico; }
    location = /site.webmanifest           { alias /opt/BookStack/favicon/site.webmanifest; }

    include snippets/basic-pnpde-social.conf; # some basic stuff like dehydradet and php-fpm (see below)
}

snippets/basic-pnpde-social.conf:

if ($badagent) {
    return 403;
}

include snippets/dehydrated.conf;
include snippets/deny-git.conf;
include snippets/deny-htaccess.conf;
include snippets/php-fpm.conf;

snippets/php-fpm.conf:

# php
location ~ \.php$ {
    include fastcgi.conf;
    fastcgi_index index.php;
    fastcgi_pass unix:/run/php/php8.1-fpm.sock;
}

can provide other snippets if you think they would be helpfull

Exact BookStack Version

v24.05.2

Log Content

No response

Hosting Environment

  • nginx version: nginx/1.18.0 (Ubuntu)
  • Ubuntu 22.04.4 LTS (Linux oghma 5.15.0-112-generic #122-Ubuntu SMP Thu May 23 07:48:21 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux)
Originally created by @nesges on GitHub (Jun 25, 2024). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario The automatic saving of drafts pops an error message in our installation under https://wiki.pnpde.social: ![image](https://github.com/BookStackApp/BookStack/assets/1583898/7ba05027-5e04-46d8-bd13-bdece0cce46f) The errors in the javascript console happen right on load of the page, the popup error message some seconds after. I reviewed the older issues to this error but was unable to find a solution for us. Here's some information about our system: * APP_URL is set to our base path in .env (`APP_URL=https://wiki.pnpde.social`) * nothing related in storage/logs/laravel.log * nothing related in nginx' logs * `APP_DEBUG=true` revealed no additional output * BookStack v24.05.2 (the error also happend before, it's not specific to v24.05.2) * nginx version: nginx/1.18.0 (Ubuntu) * Ubuntu 22.04.4 LTS (Linux oghma 5.15.0-112-generic #122-Ubuntu SMP Thu May 23 07:48:21 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux) nothing too fancy in nginx, I think: ``` include snippets/robots.conf; # sets $badagent dependent on $http_user_agent server { listen 443 ssl; listen [::]:443 ssl; server_name wiki.pnpde.social; access_log /var/log/nginx/wiki.pnpde.social/wiki-access.log anonymized; error_log /var/log/nginx/wiki.pnpde.social/wiki-error.log; root /opt/BookStack/public; index index.php index.html; location / { try_files $uri $uri/ /index.php?$query_string; } location /register { try_files $uri $uri/ /index.php?$query_string; } location /rss { proxy_pass https://oghma.pnpde.social/wiki/rss.php; } location /rss-public { proxy_pass https://oghma.pnpde.social/wiki/rss-public.php; } location /helper { alias /var/www/nginx/wiki.pnpde.social; include snippets/php-fpm.conf; } ssl_certificate /etc/dehydrated/certs/pnpde.social/fullchain.pem; ssl_certificate_key /etc/dehydrated/certs/pnpde.social/privkey.pem; location = /favicon.ico { alias /opt/BookStack/favicon/favicon.ico; } location = /site.webmanifest { alias /opt/BookStack/favicon/site.webmanifest; } include snippets/basic-pnpde-social.conf; # some basic stuff like dehydradet and php-fpm (see below) } ``` snippets/basic-pnpde-social.conf: ``` if ($badagent) { return 403; } include snippets/dehydrated.conf; include snippets/deny-git.conf; include snippets/deny-htaccess.conf; include snippets/php-fpm.conf; ``` snippets/php-fpm.conf: ``` # php location ~ \.php$ { include fastcgi.conf; fastcgi_index index.php; fastcgi_pass unix:/run/php/php8.1-fpm.sock; } ``` can provide other snippets if you think they would be helpfull ### Exact BookStack Version v24.05.2 ### Log Content _No response_ ### Hosting Environment * nginx version: nginx/1.18.0 (Ubuntu) * Ubuntu 22.04.4 LTS (Linux oghma 5.15.0-112-generic #122-Ubuntu SMP Thu May 23 07:48:21 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux)
OVERLORD added the 🐕 Support label 2026-02-05 09:19:43 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jun 25, 2024):

Hi @nesges,
I see you have a few custom scripts/assets in the "Custom HTML Head Content" customization setting.
If you temporarily completely empty that setting, does the error remain?

@ssddanbrown commented on GitHub (Jun 25, 2024): Hi @nesges, I see you have a few custom scripts/assets in the "Custom HTML Head Content" customization setting. If you temporarily completely empty that setting, does the error remain?
Author
Owner

@nesges commented on GitHub (Jun 25, 2024):

Thanks for looking into the issue! I tried commenting them out, but that didn't change the behaviour

@nesges commented on GitHub (Jun 25, 2024): Thanks for looking into the issue! I tried commenting them out, but that didn't change the behaviour
Author
Owner

@ssddanbrown commented on GitHub (Jun 25, 2024):

@nesges Okay, thanks for confirming.
Looking at some of your customizations, I'm guessing you have a theme active?
Can you temporarily disable the theme (comment out or remove the APP_THEME env option) and let me know if the error goes away with the theme disabled?

@ssddanbrown commented on GitHub (Jun 25, 2024): @nesges Okay, thanks for confirming. Looking at some of your customizations, I'm guessing you have a theme active? Can you temporarily disable the theme (comment out or remove the `APP_THEME` env option) and let me know if the error goes away with the theme disabled?
Author
Owner

@nesges commented on GitHub (Jun 25, 2024):

That's it! Got rid of the error with disabling the theme. I don't know yet what exactly caused the error, but I'll investigate further and report back here. Thank you very much, so far! :)

@nesges commented on GitHub (Jun 25, 2024): That's it! Got rid of the error with disabling the theme. I don't know yet what exactly caused the error, but I'll investigate further and report back here. Thank you very much, so far! :)
Author
Owner

@nesges commented on GitHub (Jun 25, 2024):

Got it! Seems we missed a major overhaul of pages/parts/editor-toolbar.blade.php. Ours looks very different than the one under resources/views. Since we only added a link to https://www.bookstackapp.com/docs/user/content-overview/ I completely removed that file from the theme.

Thanks again!

@nesges commented on GitHub (Jun 25, 2024): Got it! Seems we missed a major overhaul of pages/parts/editor-toolbar.blade.php. Ours looks very different than the one under resources/views. Since we only added a link to https://www.bookstackapp.com/docs/user/content-overview/ I completely removed that file from the theme. Thanks again!
Author
Owner

@ssddanbrown commented on GitHub (Jun 25, 2024):

Happy to hear you found the cause! Will therefore close this off.

@ssddanbrown commented on GitHub (Jun 25, 2024): Happy to hear you found the cause! Will therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4836