apache / apisix-go-plugin-runner

Go Plugin Runner for APISIX
https://apisix.apache.org/
Apache License 2.0
169 stars 69 forks source link

request help: error reporting when deploying plug-ins in running mode #48

Open Easy-deve opened 2 years ago

Easy-deve commented 2 years ago

Issue description

I use the official documents to deploy the go plug-in and mount the local address of the go runner into the docker. After starting apisix through the docker, I check the log and see that the plug-in execution fails.

My configured docker.yaml: apisix: image: apache/apisix:2.10.0-alpine restart: always privileged: true volumes:

External plug-in configuration in apifix configuration: ext-plugin: cmd: ["/path/to/apisix-go-plugin-runner/go-runner", "run"]

Error.log info: 2021/11/26 02:19:26 [warn] 49#49: 316 [lua] init.lua:592: flush conf token lrucache, context: ngx.timer 2021/11/26 02:19:29 [warn] 53#53: 80 [lua] init.lua:699: respawning new runner..., context: ngx.timer 2021/11/26 02:19:29 [error] 53#61: lua pipe child execvp() failed while executing /path/to/apisix-go-plugin-runner/go-runner (8: Exec format error) 2021/11/26 02:19:29 [warn] 53#53: 80 [lua] init.lua:687: runner exited with reason: exit, status: 1, context: ngx.timer 2021/11/26 02:19:29 [warn] 53#53: 80 [lua] init.lua:592: flush conf token lrucache, context: ngx.timer 2021/11/26 02:19:29 [warn] 53#53: 80 [lua] init.lua:697: respawn runner 3 seconds later with cmd: ["\/path\/to\/apisix-go-plugin-runner\/go-runner","run"], context: ngx.timer 2021/11/26 02:19:29 [warn] 49#49: 501 [lua] init.lua:592: flush conf token lrucache, context: ngx.timer 2021/11/26 02:19:29 [warn] 47#47: 502 [lua] init.lua:592: flush conf token lrucache, context: ngx.timer 2021/11/26 02:19:29 [warn] 50#50: 504 [lua] init.lua:592: flush conf token lrucache, context: ngx.timer 2021/11/26 02:19:29 [warn] 48#48: 503 [lua] init.lua:592: flush conf token lrucache, context: ngx.timer 2021/11/26 02:19:32 [warn] 53#53: 80 [lua] init.lua:699: respawning new runner..., context: ngx.timer

Environment

spacewander commented 2 years ago

execvp() failed while executing /path/to/apisix-go-plugin-runner/go-runner (8: Exec format error)

The go-runner is not a valid executable. Do you compile it for Mac but run it in Linux? What happens when you run it manually?

Easy-deve commented 2 years ago

execvp() failed while executing /path/to/apisix-go-plugin-runner/go-runner (8: Exec format error)

The go-runner is not a valid executable. Do you compile it for Mac but run it in Linux? What happens when you run it manually?

This go-runner is officially provided and has not been changed. I manually compiled and ran main.go, and the error is as follows: % go run main.go command-line-arguments ./main.go:48:25: undefined: longVersion ./main.go:50:42: undefined: shortVersion ./main.go:150:12: undefined: shortVersion

The errors reported by go-runner running in apisix container are as follows: ./go-runner: line 1: ���� 8: not found ./go-runner: line 2: : not found ./go-runner: line 2: �DATA_CONST�-x��-x�rodataDATA_CONST�-� : not found ./go-runner: line 2: �symbol_stub1TEXT��: not found ./go-runner: line 2: ���: not found ./go-runner: line 3: syntax error: unexpected word (expecting ")") /path/to/apisix-go-plugin-runner # ./go-runner: line 1: �: not found line 1: ��: not found ./go-runner: line 2:�rodata__TEXT�: not found

spacewander commented 2 years ago

Try compiling the go-runner in Linux or cross-compile it for Linux.