Frontend issues - refused to connect or 500 Error no load

3,088 views
Skip to first unread message

Lisle Waldron

unread,
Feb 18, 2022, 11:33:18 AM2/18/22
to DSpace Technical Support
Hello all (again),

I'm on the final stage of this epic server walk and keep hitting my head on the proverbial wall. I'm acclimating self to the install and felt pretty good about my progress until the error of the last 48 hours. For some context... I'm really (for now) just helping the library and I'm setting up Dspace for them to begin testing. I'd have done the Docker install - and it was a little easier but I was not able to figure out how to get external devices on the LAN to get into the Docker instance - so I decided to just go full blow and install it the 'long' way. Inevitably if I'm called on to do the production instance it's a closer estimation of the work that I'd have to do anyway. So here I am but I have a configuration issue that's resulting in me not being able to move any further and I'm out of ideas.

The issue? The first was that I wasn't even getting a page to load (Almalinux VM in a bridge mode with it's own IP on the LAN) from any other device on the LAN if these files were configured using 'localhost':
/opt/dspace-angular/config/config.prod.yml
/opt/DSpace-dspace-7.2/dspace/config/local.cfg
/opt/DSpace-dspace-7.2/dspace/config/local.cfg
/opt/DSpace-dspace-7.2/dspace/target/dspace-installer/config/local.cfg

I found a partial(?)(I think) explanation of this issue here: https://groups.google.com/g/dspace-tech/c/DXRdx0vO-TA/m/xmkYieWHEgAJ. I say partial because it got be from the refused to connect to a page loading a 500 error. The console error is:

Access to XMLHttpRequest at 'http://192.168.5.156:8080/server/api' from origin 'http://192.168.5.156:4000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

So then I looked at this: https://wiki.lyrasis.org/display/DSDOC7x/User+Interface+Configuration but couldn't get any further forward. Mohammed's guidance from this https://groups.google.com/g/dspace-tech/c/DXRdx0vO-TA/m/TeIZwpujEgAJ was a help but I can't seem to either translate it properly for 7.2 or it's just not the issue.

Currently my config.prod.yml looks like this:

ui:
  ssl: false
  host: 192.168.5.156
  port: 4000
  # NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
  nameSpace: /
  # The rateLimiter settings limit each IP to a 'max' of 500 requests per 'windowMs' (1 minute).
  rateLimiter:
    windowMs: 60000 # 1 minute
    max: 500 # limit each IP to 500 requests per windowMs

rest:
  ssl: false
  host: 192.168.5.156
  port: 8080
  # NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
  nameSpace: /server


Any ideas? At a minimum I definitely searched the interwebs and the forum before posting lol.

Thanks in advance and cheers!
Lisle

Tim Donohue

unread,
Feb 18, 2022, 11:37:46 AM2/18/22
to DSpace Technical Support
Hi Lisle,

The error you are hitting looks to be one in our "Common Installation Issues" section at the bottom of the "Installing DSpace" instructions. 

https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace#InstallingDSpace-%22XMLHttpRequest..hasbeenblockedbyCORSpolicy%22or%22CORSerror%22or%22InvalidCORSrequest%22

Try out the suggestions there. It's likely a configuration error on the *backend* in your local.cfg, as you'll see in those suggestions.

Tim

Reply all
Reply to author
Forward
0 new messages