mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-05-04 18:08:46 +03:00
An error occurred uploading an image #4242
Closed
opened 2026-02-05 08:20:12 +03:00 by OVERLORD
·
11 comments
No Branch/Tag Specified
development
l10n_development
release
v26-03
ci_fixing
codeberg-actions
lexical_may_2026
MilnerMart/development
sort_rule_text
GamerClassN7/impersonations-for-admin
Zhey-on/feature/csp-image-css-controls-6033
tortillas5/development
clauvaldez/mfaReset
llm_only
vectors
McTom234/oidc-key-algorithms
docker_env
drawio_rendering
user_permissions
ldap_host_failover
svg_image
prosemirror
captcha_example
fix/video-export
v26.03.4
v26.03.3
v26.03.2
v26.03.1
v26.03
v25.12.9
v25.12.8
v25.12.7
v25.12.6
v25.12.5
v25.12.4
v25.12.3
v25.12.2
v25.12.1
v25.12
v25.11.6
v25.11.5
v25.11.4
v24.11.4
v25.11.3
v25.11.2
v25.11.1
v25.11
v25.07.3
v25.07.2
v25.07.1
v25.07
v25.05.2
v25.05.1
v25.05
v25.02.5
v25.02.4
v25.02.3
v25.02.2
v25.02.1
v25.02
v24.12.1
v24.12
v24.10.3
v24.10.2
v24.10.1
v24.10
v24.05.4
v24.05.3
v24.05.2
v24.05.1
v24.05
v24.02.3
v24.02.2
v24.02.1
v24.02
v23.12.3
v23.12.2
v23.12.1
v23.12
v23.10.4
v23.10.3
v23.10.2
v23.10.1
v23.10
v23.08.3
v23.08.2
v23.08.1
v23.08
v23.06.2
v23.06.1
v23.06
v23.05.2
v23.05.1
v23.05
v23.02.3
v23.02.2
v23.02.1
v23.02
v23.01.1
v23.01
v22.11.1
v22.11
v22.10.2
v22.10.1
v22.10
v22.09.1
v22.09
v22.07.3
v22.07.2
v22.07.1
v22.07
v22.06.2
v22.06.1
v22.06
v22.04.2
v22.04.1
v22.04
v22.03.1
v22.03
v22.02.3
v22.02.2
v22.02.1
v22.02
v21.12.5
v21.12.4
v21.12.3
v21.12.2
v21.12.1
v21.12
v21.11.3
v21.11.2
v21.11.1
v21.11
v21.10.3
v21.10.2
v21.10.1
v21.10
v21.08.6
v21.08.5
v21.08.4
v21.08.3
v21.08.2
v21.08.1
v21.08
v21.05.4
v21.05.3
v21.05.2
v21.05.1
v21.05
v21.04.6
v21.04.5
v21.04.4
v21.04.3
v21.04.2
v21.04.1
v21.04
v0.31.8
v0.31.7
v0.31.6
v0.31.5
v0.31.4
v0.31.3
v0.31.2
v0.31.1
v0.31.0
v0.30.7
v0.30.6
v0.30.5
v0.30.4
v0.30.3
v0.30.2
v0.30.1
v0.30.0
v0.29.3
v0.29.2
v0.29.1
v0.29.0
v0.28.3
v0.28.2
v0.28.1
v0.28.0
v0.27.5
v0.27.4
v0.27.3
v0.27.2
v0.27.1
v0.27
v0.26.4
v0.26.3
v0.26.2
v0.26.1
v0.26.0
v0.25.5
v0.25.4
v0.25.3
v0.25.2
v0.25.1
v0.25.0
v0.24.3
v0.24.2
v0.24.1
v0.24.0
v0.23.2
v0.23.1
v0.23.0
v0.22.0
v0.21.0
v0.20.3
v0.20.2
v0.20.1
v0.20.0
v0.19.0
v0.18.5
v0.18.4
v0.18.3
v0.18.2
v0.18.1
v0.18.0
v0.17.4
v0.17.3
v0.17.2
v0.17.1
v0.17.0
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.15.3
v0.15.2
v0.15.1
v0.15.0
v0.14.3
v0.14.2
v0.14.1
v0.14.0
v0.13.1
v0.13.0
v0.12.2
v0.12.1
v0.12.0
v0.11.2
v0.11.1
v0.11.0
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.2
v0.8.1
v0.8.0
v0.7.6
v0.7.5
v0.7.4
v0.7.3
0.7.2
v.0.7.1
v0.7.0
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
Labels
Clear labels
🎨 Design
📖 Docs Update
🐛 Bug
🐛 Bug
:cat2:🐈 Possible duplicate
💿 Database
☕ Open to discussion
💻 Front-End
🐕 Support
🚪 Authentication
🌍 Translations
🔌 API Task
🏭 Back-End
⛲ Upstream
🔨 Feature Request
🛠️ Enhancement
🛠️ Enhancement
🛠️ Enhancement
❤️ Happy feedback
🔒 Security
🔍 Pending Validation
💆 UX
📝 WYSIWYG Editor
🌔 Out of scope
🔩 API Request
:octocat: Admin/Meta
🖌️ View Customization
❓ Question
🚀 Priority
🛡️ Blocked
🚚 Export System
♿ A11y
🔧 Maintenance
> Markdown Editor
pull-request
Mirrored from GitHub Pull Request
No Label
🐕 Support
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/BookStack#4242
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SysAdminSmith on GitHub (Sep 28, 2023).
Attempted Debugging
Searched GitHub Issues
Describe the Scenario
Greetings:
I am running Bookstack within a LXC container (Debian 12) on a ProxMox host. Bookstack is served up and reverse-proxied via Cloudflare Tunnel Services which also handles the cert.
Cloudflare is configured as follows: https://bookstack.foo.bar/ -> http://192.168.1.1/
Apache2 receives the request with the following config:
Details
My .env is as follows:
Details
So, my setup is:
Cloudflare (https://bookstack.foo.bar/) -> Apache2 (*:80) -> /var/www/bookstack
Additionally, all of /var/www/bookstack is owned recursively by www-data:www-data
Still, any time I attempt to upload an image to a page whilst editing, I get this:
Finally, browser debugging panel looks thusly:
Details
Any thoughts? Any help is greatly appreciated!
Also, I posted this over on Redit but am posting here in case this is the better location. If this is viewed as spam, I will happily take one down.
Exact BookStack Version
v23.08
Log Content
tail -ffor/var/log/apache2/access.logat time of errorNote: 192.168.1.50 is the IP for my Cloudflare Tunnel Container
Details
tail -ffor/var/www/bookstack/storage/laravel.logat time of errorDetails
Hosting Environment
PHP 8.2.10
Apache2 2.4.57 (Debian)
Debian 12 (bookworm)
Housed in a LXC container within a ProxMox environment
PVE: pve-manager/8.0.3/bbf3993334bfa916
Kernel: Linux 6.2.16-3-pve #1 SMP PREEMPT_DYNAMIC PVE 6.2.16-3 (2023-06-17T05:58Z)
@ssddanbrown commented on GitHub (Sep 28, 2023):
Could you get a bigger chunk from
laravel.logwhen the error occurs? Right now that only provides the tail end of the log stack. Getting 100 lines should do the tricktail -n 100 /var/www/bookstack/storage/laravel.log. The most relevant lines should start with a datetime for the error, ideally matching when you reproduced the error in the UI.If you're running
tail -f /var/www/bookstack/storage/laravel.logand don't see new lines appear when you cause this specific error, then this may not be a back-end error. Possible that the request is not hitting the server due to the browser console errors you're reporting.@SysAdminSmith commented on GitHub (Sep 28, 2023):
I suspect your suspicion may be correct. No new laravel entries once the bookstack container restarts:
Details
Any ideas where to go next if that is the case?
And, as always, thank you for your time and expertise!
@ssddanbrown commented on GitHub (Sep 28, 2023):
Can you got to edit a page, open the browser development console, then paste in the below and hit enter?:
When confirm if the value it returns starts with a
https://orhttp://or if it doesn't match your mainAPP_URLvalue.@SysAdminSmith commented on GitHub (Sep 28, 2023):
The output:
https://bookstack.foo.bar/attachments/upload?uploaded_to=21which is to be expected (where foo.bar is a substituted for my domain)When I click the pic upload icon/link:
Mixed Content: The page at 'https://bookstack.foo.bar/books/azure/page/create-the-storage-account/edit' was loaded over HTTPS, but requested an insecure resource 'http://bookstack.foo.bar/images/gallery/?page=1&uploaded_to=21'. This request has been blocked; the content must be served over HTTPS.@ssddanbrown commented on GitHub (Sep 29, 2023):
Does a similar console error/warning appear if you start typing a search in the header search bar (at least 3 characters, without pressing enter)?
@SysAdminSmith commented on GitHub (Sep 29, 2023):
Dan:
No, the only errors that appear in the console are those that are referenced above and only when you are a) editing and/or b) attempting to insert a picture.
One critical element I left out (and I apologize, I can't believe it slipped my mind) is that this bookstack instance started clean and then an existing, backup was imported in (we had a hardware failure). Existing articles, books, etc. show the same errors as when dealing with new (ones created post import) however, on the old instance, there were no errors.
@ssddanbrown commented on GitHub (Sep 29, 2023):
That shouldn't really affect things to be honest, really unsure why this is occuring just here though.
Your access logs show a an image upload POST resulting in a 301 response, which I really don't understand being possible from a BookStack handling point of view.
document.querySelector('[option\\:dropzone\\:url].image-manager').getAttribute('option:dropzone:url')to confirm if that starts with http or https.@SysAdminSmith commented on GitHub (Sep 29, 2023):
This is the response with the above command:
'https://bookstack.foo.bar/images/gallery?uploaded_to=21'No, they produce the same error
No, it produces a similar error:
app.js?version=v23.08:25 TypeError: Failed to fetch at Go (app.js?version=v23.08:18:1286) at an (app.js?version=v23.08:18:1752) at Object.Gu (app.js?version=v23.08:18:1858) at jf (app.js?version=v23.08:25:32608) at app.js?version=v23.08:25:32980I have not
Nothing that I am aware of outside of using a new tunnel on this new instance (the old tunnel died with the hardware that housed the old bookstack)
@ssddanbrown commented on GitHub (Nov 2, 2023):
Coming back to this, there's not much else I can think of to understand why the wrong URL is being attempted here.
The only other thing that might provide some answers, is if you can provide a HAR capture that covers the time from loading up the editor to attempting an image upload. That way I can get a fuller picture of the browser-side of things.
There's details here on how to capture a HAR file in various browsers.
It can contain private information, so probably best not to post here, but you can send it to my email (shown in my Github profile), just reference this issue within the email itself.
@SysAdminSmith commented on GitHub (Nov 2, 2023):
Dan:
Ultimately I decided to start from scratch so unfortunately I can't go down this path. Thank you so much for checking back. Even I forgot about it.
@ssddanbrown commented on GitHub (Nov 3, 2023):
Okay, no worries, I'll therefore close this off.