Uploading bitstreams got you down?

69 views
Skip to first unread message

M P

unread,
Oct 4, 2022, 10:26:18 AM10/4/22
to DSpace Technical Support
TLDR; Behind NGINX proxy? Add client_max_body_size 512M; to your server block.

This one may seem obvious to some, but it is easy to overlook.  I was getting errors in my console that were completely misleading:

[Error] Origin https://my-dpace-angular-ui is not allowed by Access-Control-Allow-Origin. Status code: 413
[Error] XMLHttpRequest cannot load https://my-dspace-restapi/server/api/core/bundles/083ff9dd-4ef7-49ff-8ba8-8184e7e5b08a/bitstreams due to access control checks.
[Error] Failed to load resource: Origin https://my-dspace-angula-rui is not allowed by Access-Control-Allow-Origin. Status code: 413 (bitstreams, line 0)

Okay, so this must be a problem with CORS, right? Check local.cfg... 

rest.cors.allowed-origins = ${dspace.ui.url}

What gives? Check everywhere else the CORS might be set:

sh /dspace/bin/beginwildgoosechase.sh

grep -rl "cors.allowed" #find everywhere there is cors setting, etc.


Fast forward to a discovery that I can only upload files under 1mb.

It must be some issue with Tomcat, so I check /dspace/webapps/server/WEB-INF/classes/application.properties > spring.servlet.multipart.max-file-size = 512mb

Maybe it only accepts byte sizes? Restart tomcat... still doesn't work.


Wait! Tomcat is behind an Nginx proxy:

Add "client_max_body_size 200M;" to the server block of my site configuration.

FINALLY!


Reply all
Reply to author
Forward
0 new messages