Skip to content

Plugin Compatibility Issue: Redis integration in Krakend Go Plugin for Rate Limiting Fails to Load Due to xxhash Mismatch. #1012

@Somu-1511-gif

Description

@Somu-1511-gif

Environment
KrakenD Version: 2.7.2

Go Version: 1.22.7

glibc Version: 2.31 (Debian 11)

Deployment: KrakenD and Redis are deployed on separate VMs on the same internal network (not containerized).

What We're Trying to Do
We’re compiling a Go plugin using:

github.com/redis/go-redis/v9

A global rate-limiting logic that stores counts per second in Redis

Loaded via krakend.json under the plugin.handler section

The Problem
When restarting KrakenD after compiling the plugin as a .so file, we get the following log output:
KRAKEND DEBUG: [SERVICE: Plugin Loader] Starting loading process
KRAKEND DEBUG: [SERVICE: Executor Plugin] plugin #0 (plugins/ratelimiterplugin.so): plugin.Open("plugins/ratelimiterplugin"): plugin was built with a different version of package github.com/cespare/xxhash/v2
KRAKEND DEBUG: [SERVICE: Handler Plugin] plugin #0 (plugins/ratelimiterplugin.so): plugin.Open("plugins/ratelimiterplugin.so"): plugin was built with a different version of package github.com/cespare/xxhash/v2 (previous failure)
KRAKEND DEBUG: [SERVICE: Modifier Plugin] plugin #0 (plugins/ratelimiterplugin.so): plugin.Open("plugins/ratelimiterplugin.so"): plugin was built with a different version of package github.com/cespare/xxhash/v2 (previous failure)

I understand that Go plugins must be built with identical dependency versions but ensuring this is difficult when working outside KrakenD’s vendor tree. Even explicitly setting the xxhash/v2 version to match doesn’t resolve the issue due to internal linking behavior.

I’d appreciate:

Clear guidance on the recommended way to build plugins compatible with KrakenD CE, especially when external packages like Redis are involved.

Whether Redis integration in plugins is officially supported or discouraged.

Optionally, an official Redis rate-limiting plugin or template to extend cleanly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions