Backend URL changed.

42 views
Skip to first unread message

Shaun donovan

unread,
Sep 20, 2024, 9:00:54 AM9/20/24
to DSpace Technical Support

Hi All.

I am experiencing a weird problem on DSpace 7.6.1. This site went live two weeks ago and has been running fine until this morning when I suddenly started getting errors. Observing the PM2 logs, I saw requests to the backend being made to http://localhost:8080/api. This is not how the site is configured.

My [dspace-ui]/conf/config.prod.yaml is configured as such:


# The REST API server settings
# NOTE: these settings define which (publicly available) REST API to use. They are usually
# 'synced' with the 'dspace.server.url' setting in your backend's local.cfg.
rest:
 ssl: true
 host: univendspace.univen.ac.za
 port: 443
 # NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
 nameSpace: /server

As you can see, the url for the site is https://univendspace.univen.ac.za and for the backend includes /server. If I go to https://univendspace.univen.ac.za/server/api, I get the expected API.

But trying to access the frontend I get a 500 error. The PM2 logs show:

5|dspace-ui  | {
5|dspace-ui  |   statusCode: 0,
5|dspace-ui  |   statusText: 'Unknown Error',
5|dspace-ui  |   message: 'Http failure response for http://localhost:8080/api: 0 Unknown Error'
5|dspace-ui  | }
5|dspace-ui  | No _links section found at http://localhost:8080/api
5|dspace-ui  | No _links section found at http://localhost:8080/api

Why is node suddenly trying to access a different URL and how do I fix it?

Kind Regards.

Shaun


DSpace Technical Support

unread,
Oct 3, 2024, 12:06:08 PM10/3/24
to DSpace Technical Support
Hi Shaun,

If you are still hitting this error, then I'd recommend also checking your backend's "local.cfg" or "dspace.cfg" to make sure that the "dspace.server.url" setting is correct.  If it's set to "http://localhost:8080" then that may be the cause of the error.

If that's not the culprit, then I'd make sure you are running the UI in production mode, and not accidentally in development mode.  See the recommended PM2 settings in the installation guide, step 6: https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace#InstallingDSpace-FrontendInstallation

Tim

Reply all
Reply to author
Forward
0 new messages