POST api/image-gallery reurn 500 and no content #5061

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

Originally created by @GamerClassN7 on GitHub (Nov 27, 2024).

Describe the Bug

when i trying to upload, ima with this request

$headers=@{}
$headers.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
$headers.Add("Authorization", "Token ")
$response = Invoke-RestMethod -Uri '' -Method POST -Headers $headers -ContentType 'multipart/form-data; boundary=---011000010111000001101001' -Body '-----011000010111000001101001
Content-Disposition: form-data; name="type"

gallery
-----011000010111000001101001
Content-Disposition: form-data; name="uploaded_to"

196817
-----011000010111000001101001
Content-Disposition: form-data; name="image"; filename="2821d7ed-da77-47b2-940a-7e3905f4e94f.jpeg"
Content-Type: image/jpeg


-----011000010111000001101001--

Steps to Reproduce

Op api client of your choice and try to upload file

Expected Behaviour

upload file

Screenshots or Additional Context

image

Browser Details

No response

Exact BookStack Version

BookStack v24.10.2 https://docs.linuxserver.io/images/docker-bookstack/

Originally created by @GamerClassN7 on GitHub (Nov 27, 2024). ### Describe the Bug when i trying to upload, ima with this request ```powersehll $headers=@{} $headers.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001") $headers.Add("Authorization", "Token ") $response = Invoke-RestMethod -Uri '' -Method POST -Headers $headers -ContentType 'multipart/form-data; boundary=---011000010111000001101001' -Body '-----011000010111000001101001 Content-Disposition: form-data; name="type" gallery -----011000010111000001101001 Content-Disposition: form-data; name="uploaded_to" 196817 -----011000010111000001101001 Content-Disposition: form-data; name="image"; filename="2821d7ed-da77-47b2-940a-7e3905f4e94f.jpeg" Content-Type: image/jpeg -----011000010111000001101001-- ``` ### Steps to Reproduce Op api client of your choice and try to upload file ### Expected Behaviour upload file ### Screenshots or Additional Context ![image](https://github.com/user-attachments/assets/26bc3345-c5b3-496f-80eb-951d40e6eb69) ### Browser Details _No response_ ### Exact BookStack Version BookStack v24.10.2 https://docs.linuxserver.io/images/docker-bookstack/
OVERLORD added the 🐛 Bug label 2026-02-05 09:37:30 +03:00
Author
Owner

@GamerClassN7 commented on GitHub (Nov 27, 2024):

What i tried ho threw all available logs, nothing, enable APP_DEBUG, also no result

@GamerClassN7 commented on GitHub (Nov 27, 2024): What i tried ho threw all available logs, nothing, enable APP_DEBUG, also no result
Author
Owner

@ssddanbrown commented on GitHub (Nov 27, 2024):

Hi @GamerClassN7,

If you're seeing a 500 that really should be logged at some level. Check error logs at the proxy(ies) level(s) first then work down, as this might not be reaching the app container if the format is invalid, which could be easy to get wrong if manually creating multipart requests.

Without testing it, the code looks okay apart from not knowing what's been redacted/trimmed from this example. Is the file content actually being added to the multi-part body (I see no direct inclusion of the actual jpeg image data in any of this).

@ssddanbrown commented on GitHub (Nov 27, 2024): Hi @GamerClassN7, If you're seeing a 500 that really should be logged at some level. Check error logs at the proxy(ies) level(s) first then work down, as this might not be reaching the app container if the format is invalid, which could be easy to get wrong if manually creating multipart requests. Without testing it, the code looks okay apart from not knowing what's been redacted/trimmed from this example. Is the file content actually being added to the multi-part body (I see no direct inclusion of the actual jpeg image data in any of this).
Author
Owner

@GamerClassN7 commented on GitHub (Dec 4, 2024):

Hi @GamerClassN7,

If you're seeing a 500 that really should be logged at some level. Check error logs at the proxy(ies) level(s) first then work down, as this might not be reaching the app container if the format is invalid, which could be easy to get wrong if manually creating multipart requests.

Without testing it, the code looks okay apart from not knowing what's been redacted/trimmed from this example. Is the file content actually being added to the multi-part body (I see no direct inclusion of the actual jpeg image data in any of this).

Hi i checked every possible log nothing there, but interesting few other Files get threw ? just first 100 or so, on other hand i am able to paste them in WYSIWYG editor. Would be possible to connect over discord (Images contains mac addresses and SN o HW) or something no so open/public so maybe i can share few images with you to check if you are able to figure something what can be wrong.

@GamerClassN7 commented on GitHub (Dec 4, 2024): > Hi @GamerClassN7, > > If you're seeing a 500 that really should be logged at some level. Check error logs at the proxy(ies) level(s) first then work down, as this might not be reaching the app container if the format is invalid, which could be easy to get wrong if manually creating multipart requests. > > Without testing it, the code looks okay apart from not knowing what's been redacted/trimmed from this example. Is the file content actually being added to the multi-part body (I see no direct inclusion of the actual jpeg image data in any of this). Hi i checked every possible log nothing there, but interesting few other Files get threw ? just first 100 or so, on other hand i am able to paste them in WYSIWYG editor. Would be possible to connect over discord (Images contains mac addresses and SN o HW) or something no so open/public so maybe i can share few images with you to check if you are able to figure something what can be wrong.
Author
Owner

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

  • Do those images work if uploading via the UI?
  • Are you sure they are jpeg images?
@ssddanbrown commented on GitHub (Dec 4, 2024): - Do those images work if uploading via the UI? - Are you sure they are jpeg images?
Author
Owner

@GamerClassN7 commented on GitHub (Dec 11, 2024):

  • Do those images work if uploading via the UI?
  • Are you sure they are jpeg images?
  • yes
  • yes
@GamerClassN7 commented on GitHub (Dec 11, 2024): > * Do those images work if uploading via the UI? > * Are you sure they are jpeg images? - yes - yes
Author
Owner

@ssddanbrown commented on GitHub (Feb 25, 2025):

I'm going to close this off since this appears to be content/scenario specific, but if able to provide a simple and complete replication example feel free to share that still and this can be re-opened for further investigation.

@ssddanbrown commented on GitHub (Feb 25, 2025): I'm going to close this off since this appears to be content/scenario specific, but if able to provide a simple and complete replication example feel free to share that still and this can be re-opened for further investigation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5061