Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This error means that the UI is unable to contact the REST API listed at [rest-api-url] and/or the response from that [rest-api-url] is unexpected (as it doesn't contain the "_links" to the endpoints available at that REST API).  A valid DSpace [rest-api-url] will respond with JSON similar to our demo API at https://api7.dspace.org/server/api

...

First, test the connection to your REST API from the UI from the command-line.

  1. In DSpace 7.1

...

  1. , this could be tested by runningyarn config:check:rest 

...

Code Block
yarn config:check:rest
  1. This script will attempt a basic Node.js connection to the REST API that is configured in your "environment.prod.ts" file and validate the response.
  2. In DSpace 7.2 (and above), this is instead tested by running yarn test:rest This script will attempt a basic Node.js connection to the REST API that is configured in your "config.prod.yml" file and validate the response.
  3. A successful connection should return a 200 Response and all JSON validation

...

  1. checks should return "true".

...

  1. If you

...

  1. receive a connection error or different response code,

...

  1. you MUST fix your REST API before the UI will be able to work (see additional hints below for likely causes). 

Oftentimes, this issue is caused by one of the following scenariosUnfortunately, this is a generic error message which simply says your frontend cannot communicate with your backend.  It may be caused by a variety of installation scenarios...these are a few we've discovered so far:

  • A possible configuration issue in the frontend or backend.
    • Check the "rest" section of your config.*.yml (or environment.*.ts for 7.1 or 7.0) configuration file for the User Interface.  That configuration section defines which REST API the UI will attempt to use.  If the settings do NOT map to a valid DSpace REST API, then you will see this "No _links section found.." error.
    • Check the "dspace.ui.url" configuration of your backend & verify it corresponds to the public URL of the User Interface (i.e. the exact same URL you use in your browser)
  • A possible SSL certificate issue. This issue may also appear if the REST API's SSL Certificate is either untrusted (by the frontend) or expired
    • If you are using a Let's Encrypt style certificate, you may need to modify your backend's Apache settings to also provide a Chain File as follows:

      Code Block
      # For example: /etc/letsencrypt/live/[domain]/cert.pem
      SSLCertificateFile [full-path-to-PEM-cert]
      # For example: /etc/letsencrypt/live/[domain]/privkey.pem
      SSLCertificateKeyFile [full-path-to-cert-KEY]
      # For example: /etc/letsencrypt/live/[domain]/chain.pem
      SSLCertificateChainFile [full-path-to-chain-file]


    • Per the Apache docs, you can also use the SSLCertificateFile setting to specify intermediate CA certificates along with the main cert.
    • For self-signed certs, see also "Using a Self-Signed SSL Certificate causes the Frontend to not be able to access the Backend" common issue listed below.
  • Something blocking access to the REST API. This may be a proxy issue, a firewall issue, or something else generally blocking the port (e.g. port 443 for SSL).
    • Verify that you can access the REST API from the machine where Node.js is running (i.e. your UI is running).  For example try a simple "wget" or "curl" to verify the REST API is returning expected JSON similar to our demo API at https://api7.dspace.org/server/api

      Code Block
      # Attempt to access the REST API via HTTPS from command-line on the machine where Node.js is running.
      # If this fails or throws a SSL cert error, you must fix it.
      wget https://[rest.host]/server/api


    • In most production scenarios, your REST API should be publicly accessible on the web, unless you are guaranteed that all your DSpace users will access the site behind a VPN or similar.  So, this "No _links section found" error may also occur if you are accessing the UI from a client computer/web browser which is unable to access the REST API.

...