Koha Solutions

Configuration & operations

Koha internal server error: finding the line that caused it

A 500 page is Koha telling you nothing on purpose. The real message is in that instance's error log — here is which file to read, and the two causes that produce most of them.

Updated 2026-08-12 · Tested against Koha 26.05

The browser shows nothing useful by design — the actual Perl error is written to that instance's error log. Tail /var/log/koha/<instance>/opac-error.log for an OPAC error or intranet-error.log for a staff one, reload the page that failed, and read the first line that appears. Everything else on this page is what to do with it.

Step 1Watch the logs while you reproduce it

Do not read the log from the top. Open it live, then trigger the error in the browser, so the only new lines are yours:

Terminal
sudo tail -f /var/log/koha/library/*.log

Replace library with your instance name (sudo koha-list prints it). Reload the failing page. A typical first line names the file, the line and the reason:

intranet-error.log
[Wed Aug 12 09:14:22 2026] [error] DBIx::Class::Storage::DBI::_dbh_execute(): Unknown column  'me.new_column' in 'field list' at /usr/share/koha/lib/Koha/Objects.pm line 197

Which file to read

Where the error appearedThe log that has the message
The public catalog/var/log/koha/<instance>/opac-error.log
The staff interface/var/log/koha/<instance>/intranet-error.log
Either, when Plack is enabled/var/log/koha/<instance>/plack-error.log — check this first if Plack is on
A background job or the worker/var/log/koha/<instance>/worker-error.log
Nothing in any of themApache never reached Koha — read /var/log/apache2/error.log instead

An empty log is information too

If reloading the page adds nothing to any of those files, the request never got as far as Koha's Perl. That points at Apache, the virtual host or Plack rather than at Koha, and it is a different investigation.

If it started right after a system update

This is the single most common version of the question — everything worked, apt upgrade ran, and now the OPAC 500s while the staff interface is fine, or the reverse. Two things cause almost all of it.

The database schema was not upgraded

Upgrading the koha-common package upgrades the code. The database is upgraded separately, and until it is, the new code queries columns that do not exist yet — which is exactly the Unknown column error above.

Terminal
sudo koha-upgrade-schema library

The old code is still resident in memory

Plack keeps Koha loaded between requests, so new files on disk change nothing until it restarts. Memcached can also still be handing out objects built by the old code. Restart the three of them in this order:

Terminal
sudo systemctl restart memcachedsudo koha-plack --restart librarysudo systemctl restart apache2

If the site returns 502 or 503 rather than 500 after that, Plack did not come back up — see Koha returns 502 or 503 after enabling Plack, which is a different failure with a different log.

Reading the message you found

The line in the logWhat it means
<code>Unknown column '…' in 'field list'</code>Code is newer than the database. Run koha-upgrade-schema.
<code>Can't locate Foo/Bar.pm in @INC</code>A Perl dependency is missing — usually after a distribution upgrade. sudo apt install --reinstall koha-common pulls the dependency set back in.
<code>DBI connect … failed</code>The database is down, or the credentials in koha-conf.xml no longer match. During a first install this is the web installer's database step.
<code>unable to locate Koha configuration file</code>Not a runtime error at all — see Koha cannot locate koha-conf.xml.
<code>Permission denied</code> on a path under <code>/var/</code>Ownership changed under the instance user, commonly after restoring files as root.
Nothing, but Apache logs <code>End of script output before headers</code>The process died before printing anything — check plack-error.log, and check free memory.

Why the page tells you nothing

Koha runs as CGI or under Plack, and in both cases an uncaught error means the process dies before it has printed a valid response. Apache has no way to describe what happened, so it emits its own generic 500. Showing the Perl error to the visitor instead would be a security problem — the trace names file paths, module versions and often the shape of a query.

So the detail is written where only the server administrator can read it, one pair of files per instance. That per-instance split is worth knowing on a server with several libraries on it: one library's errors never appear in another's log, and reading /var/log/apache2/error.log — the file most guides send you to — usually shows nothing at all.

Logs rotate, so a fault from last week may already be in a .gz beside the live file. zgrep reads those without unpacking them.

Share this article

Would rather not do this yourself? We do it as a service — and if you would rather it were already done, it is on Koha Cloud before you log in.