Custom plugins not loading with no LuaRocks module found for `kong.plugins.base_plugin`

Uses: Kong Gateway
TL;DR

Why do my custom plugins fail to load with “No LuaRocks module found for kong.plugins.base_plugin”?

The kong.plugins.base_plugin module was deprecated in Kong v2.4.x and removed in v3.0.x. A custom plugin whose handler still inherits from base_plugin will fail to load with this LuaRocks error on Kong 3.x. Update the plugin to the newer handler pattern that doesn’t extend BasePlugin.

Problem

When starting a Kong EE 3.x instance, custom plugins are causing the startup to fail. There is an error shown for a missing LuaRocks module kong.plugins.base_plugin. For example;


2026/08/27 07:18:53 [error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/kong/tools/module.lua:36: error loading module 'kong.plugins.my-custom-plugin.handler':
/usr/local/share/lua/5.1/kong/plugins/my-custom-plugin/handler.lua:1: module 'kong.plugins.base_plugin' not found:No LuaRocks module found for kong.plugins.base_plugin
no field package.preload['kong.plugins.base_plugin']

Cause

The significant message is:

module 'kong.plugins.base_plugin' not found:No LuaRocks module found for kong.plugins.base_plugin
no field package.preload['kong.plugins.base_plugin']

The code for the custom plugin is inheriting from the base_plugin module. This module has been deprecated from 2.4.1.0 and has been removed in 3.0.0.0.

The BasePlugin class was deprecated in Kong v2.4.x and will be removed in v3.0.x. Plugins that extend base_plugin.lua will continue to work until v3.0.x but should be updated to the newer, simpler pattern.

Solution

You will need to update your plugin to use the newer code format as per the docs.

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!