Troubleshooting · Kamailio 5.7 / 5.8

Kamailio won't start after upgrading from 5.7 to 5.8

The official 5.7 → 5.8 upgrade notes are short. There are no database schema changes, no renamed modules and no parameter changes. Two modules were archived. If 5.8 won't start, it's almost always the packaging or something outside the core config.

Production down right now? Call +44 161 820 1210. We answer 24/7.

What you're seeing

journalctl -u kamailio
ERROR: <core> [core/sr_module.c:...]: could not find module <app_sqlang> in </usr/lib/x86_64-linux-gnu/kamailio/modules/>
...
ERROR: bad config file (1 errors) (parsing code: ...)

Other lines you may see: parameter <x> of type <n:str> not found in module <y>, unknown command, missing loadmodule?, or at runtime invalid version 6 for table location found, expected 9. Always fix the first error. The rest are often knock-on effects.

Likely causes

Most common first.

  1. A module that was archived in 5.8. The 5.7 to 5.8 upgrade guide archives app_sqlang and auth_identity. A config that still loads either fails to start. Move app_sqlang scripts to another KEMI language (Lua, Python, JavaScript). Replace auth_identity with secsipid (kamailio-secsipid-modules on Debian) or stirshaken.
  2. Mixed or missing packages. On Debian/Ubuntu most modules ship in separate packages (MySQL, TLS, WebSocket, extra modules). If only the core package was upgraded, or a module package from the old repository is still installed, modules are missing or don't match the core.
  3. Modules loaded from the wrong path. A hard-coded loadpath/mpath, or a source build under /usr/local alongside packages, makes Kamailio load modules from a directory that no longer matches the running version.
  4. Out-of-tree or self-built modules. Yes. Modules built against 5.7 must be rebuilt against the 5.8 source. Don't copy .so files between versions.
  5. Database table versions from an older release. 5.7 to 5.8 has no schema changes, so this means the database is behind 5.7: an earlier upgrade was skipped or only partly applied. Apply the schema changes from each intermediate upgrade guide in order.

How to fix

1. Check the config before restarting

shell
kamailio -c -f /etc/kamailio/kamailio.cfg
# success ends with: config file ok, exiting...

Run this on the upgraded packages before the restart. The first error it prints is the one to fix.

2. Make every Kamailio package the same version

shell
dpkg -l 'kamailio*' | awk '/^ii/ {print $2, $3}'
apt-cache policy kamailio

# the repository line must point at the 5.8 series for your distribution,
# then upgrade everything together
apt-get update && apt-get install --only-upgrade 'kamailio*'

Every kamailio* package should show the same 5.8.x version. Install the module packages your config loads, for example kamailio-mysql-modules, kamailio-tls-modules and kamailio-websocket-modules.

3. Remove archived modules and hard-coded paths

kamailio.cfg
# remove or replace:
# loadmodule "app_sqlang.so"
# loadmodule "auth_identity.so"

# prefer no loadpath at all (the packaged default), or the 5.8 path explicitly:
loadpath "/usr/lib/x86_64-linux-gnu/kamailio/modules/"

4. Check the database versions

MySQL
SELECT table_name, table_version FROM version ORDER BY table_name;

Compare with a fresh 5.8 schema (kamdbctl create on a scratch database). 5.8 has no kamdbctl migrate, so apply each intermediate guide's SQL by hand. For example, the 5.6 → 5.7 guide adds an index on watchers:

MySQL
CREATE INDEX time_status_idx ON watchers (`inserted_time`, `status`);

Stay on the latest point release of the series. At the time of writing that's 5.8.8 (March 2026), and 5.7.7 is the last 5.7 release. Hold the old packages with apt-mark hold until the new version has handled real traffic, so you can roll back.

Still stuck?

Get a Kamailio engineer on it now

Emergency Kamailio support is £120/hour, 24/7. You talk to an engineer who has run Kamailio in production since 2005, not a ticket queue, and we'll sign your NDA before you send configs or traces. See pricing, or how our Kamailio support works.

Call us Email