New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KrakenD Plugin System - error while loading package file #235
Comments
in order to know the exact deps used at a given version, you can check the go.sum and Makefile from the related tag. krakend 1.1.1 was built with go1.14.0 (https://github.com/devopsfaith/krakend-ce/blob/v1.1.1/Makefile#L21), so building your plugins with that version should fix the problem. on the other hand, notice the plugin interface evolved from the PoC described at that blog post and the final release (https://godoc.org/github.com/devopsfaith/krakend/transport/http/client/plugin). In fact, the only thing you should change is the name of your symbol: from |
Built it with
Since (I understand that this has nothing to do with Kraken directly, but just wanted to know how do you do it while you're testing/developing Kraken or writing your own plugins?) |
as said, the go.sum file contains all the versions used in a given build: https://github.com/devopsfaith/krakend-ce/blob/v1.1.1/go.sum#L1025 |
Tried that out; it's too much work and leads to a very brittle build process. Thanks for the help, regardless! 😄 |
@labsvisual this is why we have it automated on KrakenD Studio through our gRPC plugin generator (available to KrakenD Enterprise users). If you want an evaluation or more information get in touch |
try building the plugin on the same machine type. This helped me along with same go version. |
@labsvisual Not sure if you managed to solve this, I had a similar issue, and I solved it by compiling |
Describe what are you trying to do
We decided to go ahead with KrakenD while evaluating the plethora of choices available for an API gateway. More specifically, the plugin system and its accompanying example of implementing the gRPC gateway as a HTTP-client plugin was what sealed the deal. (Since that is exactly our use-case.)
I followed the exact steps as mentioned in the tutorial and compiled the plugin library using the
golang:latest
image; copied the library over to the plugins folder and started KrakenD.A couple of log lines were more peculiar upon initial inspection:
After some Googling, it was understood that this is a known problem with Go's plugin system since it's very picky about runtime and system library versions.
Your configuration file
The configuration file is the same as picked from the example:
Commands used
The Kraken base image was used (
devopsfaith/krakend:latest
) and the plugin files were copied to the configured location (in this case/opt/krakend/plugins/plugin.so
).The
CMD
parameter was modified to:What all have I tried
Over the last hour or so, I have tried every possible thing which may result in successful runtime precondition validation. To list out all the methods in their detail:
-trimpath
flag as mentioned by this comment; sadly, this didn't work.go1.12
as mentioned in thego.mod
file but that gave me:plugin.Open("/opt/krakend/plugins/plugin.so"): plugin was built with a different version of package errors
;go.mod
and added them as_
imports but still that was of no avail.I am sure I am doing something wrong but can't pinpoint it; any help would be amazing.
The text was updated successfully, but these errors were encountered: