Repository navigation
Forge-Addon failed to negotiate the initial go-plugin protocol handshake #7450
|
Hi I'm trying to develop an addon-forge for my simple/small git setup (gitolite ssh). I found the Forge-Addon documentation quite simplistic lacking a bit of details/requirements (i.e. simple list of which methods are required and which can be optional), although Forge interface source provide more insights. Please note this is my first go project, so be kindful please. I also took a look at the original forges source code as well as some repositories I found (although I dind't found already developed/mature addons I could test. I reviewed a lot of WoodPecker discussions/requests, but most of them are previous to #3268 (important effort, thanks). Also https://woodpecker-ci.org/docs/development/addons is quite short/poor on details and the Radicle example pointed in the doc (https://explorer.radicle.gr/nodes/seed.radicle.gr/rad:z39Cf1XzrvCLRZZJRUZnx9D1fj5ws) doesn't load/work. A sample minimalistic-useless forge-addon will be good to have, so I'm try to start here. I started by just trying to develop a useless addon (just returing static data, that at least mimics/emulate/pass what WoodPecker expects. (More questions will probably come in the future): https://github.com/markfqs/gitolite-forge-addon However when woodpecker tries to use my addon, I got the following error: I verified and confirmed:
The binary can be run directly from command line, but (I supose expected) it just outputs: (Although some comments/docs seem to indicate that should sit there listening for RPC calls?) So this leaves me to hashicorp go-plugin protocol handshake, but couldn't find any documentation on that or how to debug exactly what is missing/wrong. Also, comparing with other code I couldn't realize what I making wrong. Any hints/refs please? |
Replies: 3 comments 3 replies
|
Your addon is probably fine. The default Give the addon a writable socket directory. It inherits the server's environment (client.go L656), so on the server container: environment:
- WOODPECKER_ADDON_FORGE=/mnt/gitolite
- PLUGIN_UNIX_SOCKET_DIR=/var/lib/woodpeckerOr give the container a To confirm, look just before the failure in your server log for an error line with I built a stub forge addon against Next thing you'll hit: |
|
also i agree the addon documentation is quite basic ... but we also still polish this feature :) as for forge interface docu, the best luves in code at the interface itselfe https://github.com/woodpecker-ci/woodpecker/blob/main/server/forge/forge.go PS: currently the addon dont carry over errors jet we test against, so you have to implement all interfaces meanwhile till #7428 |
|
Ouch, that was a tricky one I wouldn't figure out. Really thanks much for the quick reply, fix and consideration of the issue. |
Your addon is probably fine. The default
woodpeckerci/woodpecker-server:v3image is builtFROM scratchand has no/tmp(Dockerfile). go-plugin creates the addon's unix socket withos.CreateTemp("", "plugin"), which means$TMPDIRor/tmp(server.go L579). That fails, soplugin.Servelogsplugin init errorand returns before it prints the handshake line (L284-L288). The server then reads an empty stdout and gives you exactly that message.Give the addon a writable socket directory. It inherits the server's environment (client.go L656), so on the server container:
Or give the cont…