eprints / eprints3.4

EPrints 3.4 core and releases
http://www.eprints.org/uk/index.php/eprints-3-4/
GNU Lesser General Public License v3.0
31 stars 27 forks source link

Mod-perl handling: HTTP/1.1 404 should be 500 if the document is there and readable but database queries fail #375

Closed UmbrellaDish closed 6 months ago

UmbrellaDish commented 6 months ago

Let's suppose you have prepared for an update of your EPrints archive on a development machine. Everything works and before you switch domains to you productive public IP you go fetch an up-to-date fresh database dump from your productive old machine. Unfortunately you forget to update the database anew with epadmin update. So your refreshed database still is in the schema of version 3.4.2 that lacks a number of fields.

You try to retrieve a document ... 404.

Why the response code is not 500 Internal Server Error / EPrints System Error which I think would be more correct in this situation? It seems database errors are not handled properly. The apache mod-perl handler certainly looks up the database to ensure the requesting client is authenticated and/or authorized to access the (cached) document file that is actually present and readable by the webserver.

I would humbly second for a proper distinction between 404 NOT FOUND and 500 INTERNAL SERVER ERROR i.e. "error retrieving the authorization status of the client: query failed" logged. That distinction would have simplified my search at least.