plugin was built with a different version of package
VM1 and VM2 both have go version 1.11.1.
My Scenario:
VM1:
main.go
package main
func startGin() *gin.Engine {
gin.SetMode(gin.ReleaseMode)
router := gin.New()
v1:= router.Group("/v1")
all_plugins, err := filepath.Glob("plugins/*.so")
if err != nil {
panic(err)
}
for _, filename := range all_plugins {
p, err := plugin.Open(filename)
if err != nil {
panic(err)
}
handler, err := p.Lookup("Handler")
if err != nil {
panic(err)
}
v1.GET("/sample", handler.(func() gin.HandlerFunc)())
}
return router
}
func main() {
router := startGin()
server := &http.Server{Handler: router}
ln, err := net.Listen("tcp4", ":8080")
if err != nil {
log.Error.Printf("error during startup", err)
}
server.Serve(tcpKeepAliveListener{ln.(*net.TCPListener)})
}
go build main.go
VM2:
plugin.go
package main
import (
"fmt"
"github.com/gin-gonic/gin"
)
func Handler() gin.HandlerFunc {
return func(c *gin.Context) {
c.JSON(200, "Success")
}
}
go build -buildmode=plugin plugin.go
Getting Error "plugin was built with a different version of package
go gin-gonic
|
show 1 more comment
VM1 and VM2 both have go version 1.11.1.
My Scenario:
VM1:
main.go
package main
func startGin() *gin.Engine {
gin.SetMode(gin.ReleaseMode)
router := gin.New()
v1:= router.Group("/v1")
all_plugins, err := filepath.Glob("plugins/*.so")
if err != nil {
panic(err)
}
for _, filename := range all_plugins {
p, err := plugin.Open(filename)
if err != nil {
panic(err)
}
handler, err := p.Lookup("Handler")
if err != nil {
panic(err)
}
v1.GET("/sample", handler.(func() gin.HandlerFunc)())
}
return router
}
func main() {
router := startGin()
server := &http.Server{Handler: router}
ln, err := net.Listen("tcp4", ":8080")
if err != nil {
log.Error.Printf("error during startup", err)
}
server.Serve(tcpKeepAliveListener{ln.(*net.TCPListener)})
}
go build main.go
VM2:
plugin.go
package main
import (
"fmt"
"github.com/gin-gonic/gin"
)
func Handler() gin.HandlerFunc {
return func(c *gin.Context) {
c.JSON(200, "Success")
}
}
go build -buildmode=plugin plugin.go
Getting Error "plugin was built with a different version of package
go gin-gonic
You get that error for a reason. Try deleting the plugins and rebuilding them. Also make sure that if they use "shared" packages with your main app, they must also match!
– icza
Nov 22 '18 at 12:15
Yes i have shared package i.e., Go-Gin. So what I have to do to make it work?
– ajeyprasad
Nov 22 '18 at 12:34
You must use the same version of the shared packages. E.g. if you get the shared package, you build your plugin, then you update the shared package and you build your main app, that will cause the error you see. Whenever the shared packages change, you must rebuild both the plugins and the main app.
– icza
Nov 22 '18 at 12:35
Shared package is also having same version and rebuilt. But still same problem
– ajeyprasad
Nov 22 '18 at 12:43
Are you by any chance vendoring the packages? A vendored package is not identical to the non-vendored package, even if the source matches exactly.
– icza
Nov 22 '18 at 12:45
|
show 1 more comment
VM1 and VM2 both have go version 1.11.1.
My Scenario:
VM1:
main.go
package main
func startGin() *gin.Engine {
gin.SetMode(gin.ReleaseMode)
router := gin.New()
v1:= router.Group("/v1")
all_plugins, err := filepath.Glob("plugins/*.so")
if err != nil {
panic(err)
}
for _, filename := range all_plugins {
p, err := plugin.Open(filename)
if err != nil {
panic(err)
}
handler, err := p.Lookup("Handler")
if err != nil {
panic(err)
}
v1.GET("/sample", handler.(func() gin.HandlerFunc)())
}
return router
}
func main() {
router := startGin()
server := &http.Server{Handler: router}
ln, err := net.Listen("tcp4", ":8080")
if err != nil {
log.Error.Printf("error during startup", err)
}
server.Serve(tcpKeepAliveListener{ln.(*net.TCPListener)})
}
go build main.go
VM2:
plugin.go
package main
import (
"fmt"
"github.com/gin-gonic/gin"
)
func Handler() gin.HandlerFunc {
return func(c *gin.Context) {
c.JSON(200, "Success")
}
}
go build -buildmode=plugin plugin.go
Getting Error "plugin was built with a different version of package
go gin-gonic
VM1 and VM2 both have go version 1.11.1.
My Scenario:
VM1:
main.go
package main
func startGin() *gin.Engine {
gin.SetMode(gin.ReleaseMode)
router := gin.New()
v1:= router.Group("/v1")
all_plugins, err := filepath.Glob("plugins/*.so")
if err != nil {
panic(err)
}
for _, filename := range all_plugins {
p, err := plugin.Open(filename)
if err != nil {
panic(err)
}
handler, err := p.Lookup("Handler")
if err != nil {
panic(err)
}
v1.GET("/sample", handler.(func() gin.HandlerFunc)())
}
return router
}
func main() {
router := startGin()
server := &http.Server{Handler: router}
ln, err := net.Listen("tcp4", ":8080")
if err != nil {
log.Error.Printf("error during startup", err)
}
server.Serve(tcpKeepAliveListener{ln.(*net.TCPListener)})
}
go build main.go
VM2:
plugin.go
package main
import (
"fmt"
"github.com/gin-gonic/gin"
)
func Handler() gin.HandlerFunc {
return func(c *gin.Context) {
c.JSON(200, "Success")
}
}
go build -buildmode=plugin plugin.go
Getting Error "plugin was built with a different version of package
go gin-gonic
go gin-gonic
edited Nov 22 '18 at 16:35
vahdet
1,57931130
1,57931130
asked Nov 22 '18 at 12:05
ajeyprasadajeyprasad
11
11
You get that error for a reason. Try deleting the plugins and rebuilding them. Also make sure that if they use "shared" packages with your main app, they must also match!
– icza
Nov 22 '18 at 12:15
Yes i have shared package i.e., Go-Gin. So what I have to do to make it work?
– ajeyprasad
Nov 22 '18 at 12:34
You must use the same version of the shared packages. E.g. if you get the shared package, you build your plugin, then you update the shared package and you build your main app, that will cause the error you see. Whenever the shared packages change, you must rebuild both the plugins and the main app.
– icza
Nov 22 '18 at 12:35
Shared package is also having same version and rebuilt. But still same problem
– ajeyprasad
Nov 22 '18 at 12:43
Are you by any chance vendoring the packages? A vendored package is not identical to the non-vendored package, even if the source matches exactly.
– icza
Nov 22 '18 at 12:45
|
show 1 more comment
You get that error for a reason. Try deleting the plugins and rebuilding them. Also make sure that if they use "shared" packages with your main app, they must also match!
– icza
Nov 22 '18 at 12:15
Yes i have shared package i.e., Go-Gin. So what I have to do to make it work?
– ajeyprasad
Nov 22 '18 at 12:34
You must use the same version of the shared packages. E.g. if you get the shared package, you build your plugin, then you update the shared package and you build your main app, that will cause the error you see. Whenever the shared packages change, you must rebuild both the plugins and the main app.
– icza
Nov 22 '18 at 12:35
Shared package is also having same version and rebuilt. But still same problem
– ajeyprasad
Nov 22 '18 at 12:43
Are you by any chance vendoring the packages? A vendored package is not identical to the non-vendored package, even if the source matches exactly.
– icza
Nov 22 '18 at 12:45
You get that error for a reason. Try deleting the plugins and rebuilding them. Also make sure that if they use "shared" packages with your main app, they must also match!
– icza
Nov 22 '18 at 12:15
You get that error for a reason. Try deleting the plugins and rebuilding them. Also make sure that if they use "shared" packages with your main app, they must also match!
– icza
Nov 22 '18 at 12:15
Yes i have shared package i.e., Go-Gin. So what I have to do to make it work?
– ajeyprasad
Nov 22 '18 at 12:34
Yes i have shared package i.e., Go-Gin. So what I have to do to make it work?
– ajeyprasad
Nov 22 '18 at 12:34
You must use the same version of the shared packages. E.g. if you get the shared package, you build your plugin, then you update the shared package and you build your main app, that will cause the error you see. Whenever the shared packages change, you must rebuild both the plugins and the main app.
– icza
Nov 22 '18 at 12:35
You must use the same version of the shared packages. E.g. if you get the shared package, you build your plugin, then you update the shared package and you build your main app, that will cause the error you see. Whenever the shared packages change, you must rebuild both the plugins and the main app.
– icza
Nov 22 '18 at 12:35
Shared package is also having same version and rebuilt. But still same problem
– ajeyprasad
Nov 22 '18 at 12:43
Shared package is also having same version and rebuilt. But still same problem
– ajeyprasad
Nov 22 '18 at 12:43
Are you by any chance vendoring the packages? A vendored package is not identical to the non-vendored package, even if the source matches exactly.
– icza
Nov 22 '18 at 12:45
Are you by any chance vendoring the packages? A vendored package is not identical to the non-vendored package, even if the source matches exactly.
– icza
Nov 22 '18 at 12:45
|
show 1 more comment
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53430644%2fplugin-was-built-with-a-different-version-of-package%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53430644%2fplugin-was-built-with-a-different-version-of-package%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You get that error for a reason. Try deleting the plugins and rebuilding them. Also make sure that if they use "shared" packages with your main app, they must also match!
– icza
Nov 22 '18 at 12:15
Yes i have shared package i.e., Go-Gin. So what I have to do to make it work?
– ajeyprasad
Nov 22 '18 at 12:34
You must use the same version of the shared packages. E.g. if you get the shared package, you build your plugin, then you update the shared package and you build your main app, that will cause the error you see. Whenever the shared packages change, you must rebuild both the plugins and the main app.
– icza
Nov 22 '18 at 12:35
Shared package is also having same version and rebuilt. But still same problem
– ajeyprasad
Nov 22 '18 at 12:43
Are you by any chance vendoring the packages? A vendored package is not identical to the non-vendored package, even if the source matches exactly.
– icza
Nov 22 '18 at 12:45