Comments (12)
I didn't install or set any path for go in my Amazon linux instance, where kong is running.
Okay, will check for this.
Thanks a lot @gszr
from go-plugins.
Hi @jainrocks,
Thanks for posting this question!
Additionally to passing the go_plugins_dir
directive (which simply tells the go-pluginserver where to find Go plugins), you need to enable the Go plugin - as with any custom Kong plugin. See this.
So, do something like
go_plugins_dir = /usr/local/kong/goplugins
plugins = bundled,go-hello
from go-plugins.
Hi @gszr,
Thank you so much for the quick reply. I am getting this:
Kong stopped Error: /usr/local/share/lua/5.1/kong/cmd/start.lua:64: 2020/06/10 15:03:09 stat /usr/local/kong/goplugins/go-hello.so: no such file or directory nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:455: bad argument #1 to 'ipairs' (table expected, got nil) stack traceback: [C]: in function 'ipairs' /usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:455: in function 'get_plugin' /usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:481: in function 'load_plugin' /usr/local/share/lua/5.1/kong/db/dao/plugins.lua:151: in function 'load_plugin_handler' /usr/local/share/lua/5.1/kong/db/dao/plugins.lua:227: in function 'load_plugin' /usr/local/share/lua/5.1/kong/db/dao/plugins.lua:275: in function 'load_plugin_schemas' /usr/local/share/lua/5.1/kong/init.lua:427: in function 'init' init_by_lua:3: in main chunk
I am new to go language, please help.
from go-plugins.
@jackkav did you compile the Go plugin? Take a look at the makefile in this repo.
from go-plugins.
@gszr
No I didn't compile earlier. My bad.
I tried compiling now using make
I get:
go build -buildmode=plugin go-hello.go
make: go: Command not found
make: *** [go-hello.so] Error 127
from go-plugins.
From the error, it looks like you either don't have a Go compiler installed -- or it isn't in the PATH
.
from go-plugins.
@gszr
Still getting the above issue.
After installing the go and setting the path.
go env
is gibing the below result
GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/ec2-user/.cache/go-build" GOENV="/home/ec2-user/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/ec2-user/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/usr/local/kong/goplugins/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build005273170=/tmp/go-build -gno-record-gcc-switches"
But still getting the above issue.
from go-plugins.
@jainrocks please post the entire output - in the same terminal you ran the go env
.
from go-plugins.
@gszr
Below is the output for the same.
from go-plugins.
@gszr Please help here.
from go-plugins.
@jainrocks note that you are doing sudo make
, while the commands before printed the environment for the current user, not root
. Try make
, without sudo.
from go-plugins.
Closing this as resolved. Please post an update if you still need help. Thanks!
from go-plugins.
Related Issues (13)
- how can i set request header? HOT 1
- How to install this plugin? HOT 2
- Testing Go Plugins HOT 3
- Testing Go Plugins
- Unit test framework for go plugins HOT 1
- package management? HOT 1
- Kong is getting stop again and again HOT 1
- Can go plugin has daos/schema structure just like LUA plugin? HOT 2
- Initialization code HOT 1
- Consider moving plugins to separate folders to make valid go module HOT 2
- go-pluginserver terminated: exit 0, context: ngx.timer HOT 1
- go-pluginserver error die loop HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-plugins.