<p></p>
<p dir="auto">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.</p>
<p dir="auto">Due to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1200306844" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/3529" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/3529/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/3529">#3529</a>, I changed <code>api_ability.rb </code>to include an additional check on status "database_readonly"</p>
<pre><code>    if Settings.status != "database_offline" &&   Settings.status != "database_readonly"
</code></pre>
<p dir="auto">and added <code>status: "database_readonly"</code> to my settings.local.yml</p>
<p dir="auto">When one of the API endpoints <a href="http://localhost:3000/api/0.6/node/5004451611" rel="nofollow">http://localhost:3000/api/0.6/node/5004451611</a>, 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.</p>
<p dir="auto">Eventually, the whole process would return a "Couldn't authenticate you" error message without any additional details.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/3530">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLURZYPH65YT723WSLVERQH5ANCNFSM5TD57O7Q">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLPAVCZSBKL7ZI224BTVERQH5A5CNFSM5TD57O72YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4R4LMX7A.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/issues/3530</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/3530",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/3530",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>