Bookstack failed to handle image and/or create thumbnails due to system resource limits #4802

Closed
opened 2026-02-05 09:16:49 +03:00 by OVERLORD · 13 comments
Owner

Originally created by @rodgaray on GitHub (May 31, 2024).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Hi!
We have a problem with our Bookstack site. When we try to insert a new image, the image selection box fails to show any thumbnail and We're unable to upload new images to the platform.

This is running serverless on GCP Cloud Run.

image

Most of the reported issues refer to php limit but how can we be sure, we don't have CLI to check or modify php.ini, if that could be the problem?

Exact BookStack Version

v23.12.2-ls125

Log Content

The log shows this:

2024-05-31 21:52:49.636 CEST
POST500830 B795 msChrome 125 http://wiki.ingenia.la/images/gallery?uploaded_to=144

On the GCP console the error is as follows:

{
httpRequest: {
latency: "0.795066948s"
protocol: "HTTP/1.1"
referer: "https://wiki.ingenia.la/books/procedimientos-ingenials/page/nuestros-gastos/edit"
remoteIp: "172.68.216.130"
requestMethod: "POST"
requestSize: "291133"
requestUrl: "http://wiki.ingenia.la/images/gallery?uploaded_to=144"
responseSize: "830"
serverIp: "34.128.145.114"
status: 500
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"
}
insertId: "665a2a920006a17dc6de4352"
labels: {
instanceId: "00f46b9285c2c05ea2ebf7a494d3d065b161ddd46949d05f85e031a01f08bb3626f90e6548ff51ec46a3d8f3a55f6af7bc27c4bd569c051956b50a0d49ab5c9910"
}
logName: "projects/influence-413820/logs/run.googleapis.com%2Frequests"
receiveTimestamp: "2024-05-31T19:52:50.731041553Z"
resource: {
labels: {5}
type: "cloud_run_revision"
}
severity: "ERROR"
spanId: "1293029083332901613"
timestamp: "2024-05-31T19:52:49.636972Z"
trace: "projects/influence-413820/traces/43e175bd5c308361031888151d5719ab"
traceSampled: true
}

On the browser console:

app.js?version=v23.12.2:43 Refused to set the document's base URI to '' because it violates the following Content Security Policy directive: "base-uri 'self'".

init_instance_callback @ app.js?version=v23.12.2:43
(anonymous) @ tinymce.min.js?version=v23.12.2:4
pO @ tinymce.min.js?version=v23.12.2:4
(anonymous) @ tinymce.min.js?version=v23.12.2:4
Promise.then (async)
(anonymous) @ tinymce.min.js?version=v23.12.2:4
fold @ tinymce.min.js?version=v23.12.2:4
hO @ tinymce.min.js?version=v23.12.2:4
n @ tinymce.min.js?version=v23.12.2:4
(anonymous) @ tinymce.min.js?version=v23.12.2:4
(anonymous) @ tinymce.min.js?version=v23.12.2:4
load (async)
(anonymous) @ tinymce.min.js?version=v23.12.2:4
_o @ tinymce.min.js?version=v23.12.2:4
(anonymous) @ tinymce.min.js?version=v23.12.2:4
(anonymous) @ tinymce.min.js?version=v23.12.2:4
xO @ tinymce.min.js?version=v23.12.2:4
await in xO (async)
o @ tinymce.min.js?version=v23.12.2:4
Promise.then (async)
_O @ tinymce.min.js?version=v23.12.2:4
(anonymous) @ tinymce.min.js?version=v23.12.2:4
render @ tinymce.min.js?version=v23.12.2:4
(anonymous) @ tinymce.min.js?version=v23.12.2:4
(anonymous) @ tinymce.min.js?version=v23.12.2:4
Re @ tinymce.min.js?version=v23.12.2:4
s @ tinymce.min.js?version=v23.12.2:4
executeHandlers @ tinymce.min.js?version=v23.12.2:4
i @ tinymce.min.js?version=v23.12.2:4
s @ tinymce.min.js?version=v23.12.2:4
app.js?version=v23.12.2:19 
        
        
       POST https://wiki.ingenia.la/images/gallery?uploaded_to=144 500 (Internal Server Error)
startXhrForUpload @ app.js?version=v23.12.2:19
createUploadFromFile @ app.js?version=v23.12.2:19
(anonymous) @ app.js?version=v23.12.2:19
app.js?version=v23.12.2:19 
        
        
       POST https://wiki.ingenia.la/images/gallery?uploaded_to=144 500 (Internal Server Error)
startXhrForUpload @ app.js?version=v23.12.2:19
createUploadFromFile @ app.js?version=v23.12.2:19
(anonymous) @ app.js?version=v23.12.2:19
app.js?version=v23.12.2:19 
        
        
       POST https://wiki.ingenia.la/images/gallery?uploaded_to=144 500 (Internal Server Error)
startXhrForUpload @ app.js?version=v23.12.2:19
createUploadFromFile @ app.js?version=v23.12.2:19
(anonymous) @ app.js?version=v23.12.2:19

Hosting Environment

GCP Cloud Run.

Originally created by @rodgaray on GitHub (May 31, 2024). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario Hi! We have a problem with our Bookstack site. When we try to insert a new image, the image selection box fails to show any thumbnail and We're unable to upload new images to the platform. This is running serverless on GCP Cloud Run. ![image](https://github.com/BookStackApp/BookStack/assets/9523204/e2034197-f0ac-4fb8-8778-80cf6c96dd29) Most of the reported issues refer to php limit but how can we be sure, we don't have CLI to check or modify php.ini, if that could be the problem? ### Exact BookStack Version v23.12.2-ls125 ### Log Content The log shows this: ``` 2024-05-31 21:52:49.636 CEST POST500830 B795 msChrome 125 http://wiki.ingenia.la/images/gallery?uploaded_to=144 ``` #### On the GCP console the error is as follows: ``` { httpRequest: { latency: "0.795066948s" protocol: "HTTP/1.1" referer: "https://wiki.ingenia.la/books/procedimientos-ingenials/page/nuestros-gastos/edit" remoteIp: "172.68.216.130" requestMethod: "POST" requestSize: "291133" requestUrl: "http://wiki.ingenia.la/images/gallery?uploaded_to=144" responseSize: "830" serverIp: "34.128.145.114" status: 500 userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" } insertId: "665a2a920006a17dc6de4352" labels: { instanceId: "00f46b9285c2c05ea2ebf7a494d3d065b161ddd46949d05f85e031a01f08bb3626f90e6548ff51ec46a3d8f3a55f6af7bc27c4bd569c051956b50a0d49ab5c9910" } logName: "projects/influence-413820/logs/run.googleapis.com%2Frequests" receiveTimestamp: "2024-05-31T19:52:50.731041553Z" resource: { labels: {5} type: "cloud_run_revision" } severity: "ERROR" spanId: "1293029083332901613" timestamp: "2024-05-31T19:52:49.636972Z" trace: "projects/influence-413820/traces/43e175bd5c308361031888151d5719ab" traceSampled: true } ``` #### On the browser console: ``` app.js?version=v23.12.2:43 Refused to set the document's base URI to '' because it violates the following Content Security Policy directive: "base-uri 'self'". init_instance_callback @ app.js?version=v23.12.2:43 (anonymous) @ tinymce.min.js?version=v23.12.2:4 pO @ tinymce.min.js?version=v23.12.2:4 (anonymous) @ tinymce.min.js?version=v23.12.2:4 Promise.then (async) (anonymous) @ tinymce.min.js?version=v23.12.2:4 fold @ tinymce.min.js?version=v23.12.2:4 hO @ tinymce.min.js?version=v23.12.2:4 n @ tinymce.min.js?version=v23.12.2:4 (anonymous) @ tinymce.min.js?version=v23.12.2:4 (anonymous) @ tinymce.min.js?version=v23.12.2:4 load (async) (anonymous) @ tinymce.min.js?version=v23.12.2:4 _o @ tinymce.min.js?version=v23.12.2:4 (anonymous) @ tinymce.min.js?version=v23.12.2:4 (anonymous) @ tinymce.min.js?version=v23.12.2:4 xO @ tinymce.min.js?version=v23.12.2:4 await in xO (async) o @ tinymce.min.js?version=v23.12.2:4 Promise.then (async) _O @ tinymce.min.js?version=v23.12.2:4 (anonymous) @ tinymce.min.js?version=v23.12.2:4 render @ tinymce.min.js?version=v23.12.2:4 (anonymous) @ tinymce.min.js?version=v23.12.2:4 (anonymous) @ tinymce.min.js?version=v23.12.2:4 Re @ tinymce.min.js?version=v23.12.2:4 s @ tinymce.min.js?version=v23.12.2:4 executeHandlers @ tinymce.min.js?version=v23.12.2:4 i @ tinymce.min.js?version=v23.12.2:4 s @ tinymce.min.js?version=v23.12.2:4 app.js?version=v23.12.2:19 POST https://wiki.ingenia.la/images/gallery?uploaded_to=144 500 (Internal Server Error) startXhrForUpload @ app.js?version=v23.12.2:19 createUploadFromFile @ app.js?version=v23.12.2:19 (anonymous) @ app.js?version=v23.12.2:19 app.js?version=v23.12.2:19 POST https://wiki.ingenia.la/images/gallery?uploaded_to=144 500 (Internal Server Error) startXhrForUpload @ app.js?version=v23.12.2:19 createUploadFromFile @ app.js?version=v23.12.2:19 (anonymous) @ app.js?version=v23.12.2:19 app.js?version=v23.12.2:19 POST https://wiki.ingenia.la/images/gallery?uploaded_to=144 500 (Internal Server Error) startXhrForUpload @ app.js?version=v23.12.2:19 createUploadFromFile @ app.js?version=v23.12.2:19 (anonymous) @ app.js?version=v23.12.2:19 ```` ### Hosting Environment GCP Cloud Run.
OVERLORD added the 🐕 Support label 2026-02-05 09:16:49 +03:00
Author
Owner

@david-prv commented on GitHub (Jun 1, 2024):

Hi, I realized a difference between your logfile and the console output. In your logfile it says http://wiki.foo.bar, but the error shows https://wiki.foo.bar. Is your base uri correctly defined in your env file?

@david-prv commented on GitHub (Jun 1, 2024): Hi, I realized a difference between your logfile and the console output. In your logfile it says `http://wiki.foo.bar`, but the error shows `https://wiki.foo.bar`. Is your base uri correctly defined in your env file?
Author
Owner

@jacobslutsky-blacksmith commented on GitHub (Jun 3, 2024):

Hi...Possibly related to this thread?
https://github.com/BookStackApp/BookStack/issues/5029#issue-2312227088

@jacobslutsky-blacksmith commented on GitHub (Jun 3, 2024): Hi...Possibly related to this thread? https://github.com/BookStackApp/BookStack/issues/5029#issue-2312227088
Author
Owner

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

Yeah, that reflected error message will generally show when you're hitting the memory limit during image resizing.
You can try to bump the PHP memory_limit in your environment, which addresses this in most cases.

@ssddanbrown commented on GitHub (Jun 4, 2024): Yeah, that reflected error message will generally show when you're hitting the memory limit during image resizing. You can try to bump the PHP `memory_limit` in your environment, which addresses this in most cases.
Author
Owner

@rodgaray commented on GitHub (Jun 4, 2024):

Yeah, that reflected error message will generally show when you're hitting the memory limit during image resizing. You can try to bump the PHP memory_limit in your environment, which addresses this in most cases.

Thanks! I think you're right, that may be the problem. I will rebuild the image and try again. Later I'll post the result.
Any recommendation regarding memory_limit, any recommended value?

Thanks!

@rodgaray commented on GitHub (Jun 4, 2024): > Yeah, that reflected error message will generally show when you're hitting the memory limit during image resizing. You can try to bump the PHP `memory_limit` in your environment, which addresses this in most cases. Thanks! I think you're right, that may be the problem. I will rebuild the image and try again. Later I'll post the result. Any recommendation regarding `memory_limit`, any recommended value? Thanks!
Author
Owner

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

@rodgaray The PHP default is 128M, so doubling to 256M alleviates most scenarios.

@ssddanbrown commented on GitHub (Jun 5, 2024): @rodgaray The PHP default is `128M`, so doubling to `256M` alleviates most scenarios.
Author
Owner

@rodgaray commented on GitHub (Jun 8, 2024):

@rodgaray The PHP default is 128M, so doubling to 256M alleviates most scenarios.

Hi, thank you for your reply.
I have a problem, the installation is serverless, so I need to rebuild the docker image with the PHP.ini within it. I was able to make a build from the GitHub code but I don't know where the php.ini should be.

@rodgaray commented on GitHub (Jun 8, 2024): > @rodgaray The PHP default is `128M`, so doubling to `256M` alleviates most scenarios. Hi, thank you for your reply. I have a problem, the installation is serverless, so I need to rebuild the docker image with the PHP.ini within it. I was able to make a build from the GitHub code but I don't know where the php.ini should be.
Author
Owner

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

@rodgaray What docker image were you originally using, and do you still have access (or able to use) docker volume mounts?

@ssddanbrown commented on GitHub (Jun 8, 2024): @rodgaray What docker image were you originally using, and do you still have access (or able to use) docker volume mounts?
Author
Owner

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

@rodgaray Going by the original post, I'm assuming the linuxserver contianer.
They provide a way to customize php.ini values by default, via the php/php-local.ini file within the folder/files you have mounted to the /config path on the container.

@ssddanbrown commented on GitHub (Jun 8, 2024): @rodgaray Going by the original post, I'm assuming the linuxserver contianer. They provide a way to customize `php.ini` values by default, via the `php/php-local.ini` file within the folder/files you have mounted to the `/config` path on the container.
Author
Owner

@kayvanaarssen commented on GitHub (Jun 11, 2024):

Had the same issue just now, trying to upload a 3.7MB Image (Long scrolling image of a page we need for reference)
We are not running in docker.
Had PHP Memory limit set to 256MB changed to 512MB and the upload worked.
Pretty weird but, it works now!

Environment: PHP 8.3 NGINX Ubuntu 22.04

@kayvanaarssen commented on GitHub (Jun 11, 2024): Had the same issue just now, trying to upload a 3.7MB Image (Long scrolling image of a page we need for reference) We are not running in docker. Had PHP Memory limit set to 256MB changed to 512MB and the upload worked. Pretty weird but, it works now! Environment: PHP 8.3 NGINX Ubuntu 22.04
Author
Owner

@flemmingss commented on GitHub (Jun 13, 2024):

I had the same just now, when uplaoding PNG-images 17-21MB.
Using the Linuxserver docker image

@flemmingss commented on GitHub (Jun 13, 2024): I had the same just now, when uplaoding PNG-images 17-21MB. Using the Linuxserver docker image
Author
Owner

@federicotravaini commented on GitHub (Sep 16, 2024):

I am having the same issue even with 500kb images. Pretty sure was working fine till some days ago...might be new linuxserver release?

Edit: fixed following https://github.com/BookStackApp/BookStack/issues/5029#issuecomment-2127906502

@federicotravaini commented on GitHub (Sep 16, 2024): I am having the same issue even with 500kb images. Pretty sure was working fine till some days ago...might be new linuxserver release? Edit: fixed following https://github.com/BookStackApp/BookStack/issues/5029#issuecomment-2127906502
Author
Owner

@flemmingss commented on GitHub (Sep 16, 2024):

I can add, for me upload is working, and adding the pictures is working, it is just the thumbnail when adding that is not working.
"Failed to create gallery thumbnails due to system resource limits."
image

@flemmingss commented on GitHub (Sep 16, 2024): I can add, for me upload is working, and adding the pictures is working, it is just the thumbnail when adding that is not working. "Failed to create gallery thumbnails due to system resource limits." ![image](https://github.com/user-attachments/assets/48422b9e-2ce5-4aef-8304-a93ff5a5c8e7)
Author
Owner

@ssddanbrown commented on GitHub (Sep 3, 2025):

Since this support request is quite old, I'm going to close this off.
If support is still required, please open a new support thread specific to your environment/setup.

@ssddanbrown commented on GitHub (Sep 3, 2025): Since this support request is quite old, I'm going to close this off. If support is still required, please open a new support thread specific to your environment/setup.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4802