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:
$ sudo tail -f /var/log/koha/library/*.logReplace 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:
[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 197Which file to read
| Where the error appeared | The 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 them | Apache never reached Koha — read /var/log/apache2/error.log instead |
An empty log is information too
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.
$ sudo koha-upgrade-schema libraryThe 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:
$ sudo systemctl restart memcached$ sudo koha-plack --restart library$ sudo systemctl restart apache2If 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 log | What 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.
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.
Related
More on configuration & operations
Answers to the questions that usually arrive with this one.
Rebuilding the Zebra index when Koha search results go stale
A record you can open by its number but cannot find by searching means the index is behind, not that the record is missing. Here is how to rebuild it properly.
Backing up Koha with koha-dump — and restoring it
A package install already backs itself up nightly, keeps two days, and writes to a disk that dies with the server. Here is how to check it, and how to restore.
Koha cron jobs: which ones matter, and what breaks silently without each
A package install schedules about fifteen jobs. This is what each one does, when it runs, and the exact symptom a library sees when it stops.
Using a Gmail account as Koha’s SMTP server
Gmail works as Koha’s mail server, but only with an app password and two-step verification on. Here are the exact settings, and the limits worth knowing before you rely on it.

