seanmorley15 / AdventureLog

Self-hostable travel tracker and trip planner.
https://adventurelog.app
Other
550 stars 14 forks source link

Photos not uploading for entries #235

Closed TheBig-O closed 2 months ago

TheBig-O commented 2 months ago

Any time I try to upload an image through the frontend, the application just stops and never uploads the file. When I click the "Edit" button after adding an image through the "Choose File" button or the "Image Search" button, I cannot get the "Edit" button to do anything.
At the same time, if I go into the Admin area, I can select the adventure and add the file directly through that interface. This works perfectly and shows the image on the front end when I refresh the page.
Is this a configuration error or some sort of permissions issue? Thanks for the help with this.

seanmorley15 commented 2 months ago

Hmm. Are you able to send a screenshot of the console and network tab in the frontend? Also a screenshots of the docker container logs could be helpful. Thanks

TheBig-O commented 2 months ago

Okay, so this was my fault. Had I looked at the stupid logs, I would have noticed what happened. I was trying to set the max upload size in my docker-compose.yml to 5mb. I had set the - BODY_SIZE_LIMIT= to 5120, thinking that it was in KBytes. Turns out it is in Bytes. It is now set properly at 5242880 and is working just fine. sorry.

This is what clued me in:

SvelteKitError: Content-length of 880739 exceeds limit of 5120 bytes.
    at Object.start (file:///app/build/handler.js:984:19)
    at setupReadableStreamDefaultController (node:internal/webstreams/readablestream:2333:23)
    at setupReadableStreamDefaultControllerFromSource (node:internal/webstreams/readablestream:2366:3)
    at new ReadableStream (node:internal/webstreams/readablestream:289:7)
    at get_raw_body (file:///app/build/handler.js:973:9)
    at getRequest (file:///app/build/handler.js:1054:7)
    at Array.ssr (file:///app/build/handler.js:1248:19)
    at handle (file:///app/build/handler.js:1318:23)
    at file:///app/build/handler.js:1318:40
    at Array.<anonymous> (file:///app/build/handler.js:1237:4) {
  status: 413,
  text: 'Payload Too Large'