|
|
What to do if ...
|
|
|
|
|
|
# The Web API returns an internal server error (500)
|
|
|
# Website displays "Internal server error"
|
|
|
|
|
|
The error is probably caused by a Python exception in dbnomics-api. The exception is not visible in the JSON response of the URL, but it is visible in the application log on the server.
|
|
|
This message is either caused by:
|
|
|
- wrong data (or no data at all) fetched by the UI (from the API) causing a problem rendering the page
|
|
|
- a bug in the UI
|
|
|
|
|
|
The first thing to do is to check if the API is OK when loading the page. See section "Find errors in Web API" to do that.
|
|
|
|
|
|
If the API does not fail, the problem is in the UI. To find its source, open the JavaScript console of the browser, and look for a stack trace. The reproduce locally, fix and deploy (see README of dbnomics-website).
|
|
|
|
|
|
# Find errors in Web API
|
|
|
|
|
|
The error is probably caused by a Python exception in dbnomics-api. The exception is not visible in the JSON response of the URL, but is visible in the application log on the server.
|
|
|
|
|
|
See also: [dolos server install doc](https://git.nomics.world/cepremap-private/servers-and-services/blob/master/dbnomics-server-dolos.nomics.world.md) and [production configuration](https://git.nomics.world/dbnomics-fetchers/documentation/wikis/production-configuration).
|
|
|
|
|
|
dbnomics-api logs are handled by uwsgi in `/var/log/uwsgi/app/` (for example see `/var/log/uwsgi/app/dbnomics-api-uwsgi-v21.log`)
|
|
|
Search for errors in the logs (dbnomics-api is deployed using uwsgi so the logs are in `/var/log/uwsgi/app/`):
|
|
|
|
|
|
```bash
|
|
|
ssh root@api.db.nomics.world
|
|
|
tail -f /var/log/uwsgi/app/dbnomics-api-uwsgi-v22.log
|
|
|
```
|
|
|
|
|
|
If you find an internal server error (HTTP status code 500): reproduce locally, fix and deploy (see README of dbnomics-api).
|
|
|
|
|
|
# The UI displays "Error loading page"
|
|
|
If you find a connection error to Solr (i.e. `urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8983): Max retries exceeded with url: /solr/dbnomics/query`):
|
|
|
|
|
|
- open the browser developer tools (F12)
|
|
|
- look at the "Console" tab and look for an exception: in this case the bug is in [dbnomics-ui](https://git.nomics.world/dbnomics/dbnomics-ui) source code
|
|
|
- look at the "Network" tab and look for requests failures (400 or 500 HTTP codes): in this case the bug is in [dbnomics-api](https://git.nomics.world/dbnomics/dbnomics-api) source code
|
|
|
- on the [production server](./servers) (`dolos`), check the logs (see section above)
|
|
|
```bash
|
|
|
systemctl restart solr.service
|
|
|
systemctl restart uwsgi.service
|
|
|
```
|
|
|
|
|
|
# I can't see a dataset in the UI
|
|
|
# I can't see a dataset on the website
|
|
|
|
|
|
Example: I open https://db.nomics.world/SCSMICH/MICS and it is "404 not found".
|
|
|
|
... | ... | |