[openstreetmap/openstreetmap-website] Unclear API error message when db is unavailable (Issue #3530)

mmd notifications at github.com
Mon Apr 11 17:44:30 UTC 2022


For this issue, I wanted to find out what kind of error message a user would get when calling an API endpoint in case the database is unavailable.

Due to #3529, I changed `api_ability.rb `to include an additional check on status "database_readonly"

```
    if Settings.status != "database_offline" &&   Settings.status != "database_readonly"
```

and added `status: "database_readonly"` to my settings.local.yml

When one of the API endpoints http://localhost:3000/api/0.6/node/5004451611, I was expecting to see to error message about an unavailable database. Instead, I'm getting repeated requests to authenticate, which always fails with a HTTP 401 error.

Eventually, the whole process would return a "Couldn't authenticate you" error message without any additional details.





-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3530
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/3530 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220411/4b414367/attachment-0001.htm>


More information about the rails-dev mailing list