wiltonsr / ldapAuth

An open source Traefik Middleware that enables authentication via LDAP in a similar way to Traefik Enterprise
https://plugins.traefik.io/plugins/628c9eb7ffc0cd18356a979c/ldap-auth
Apache License 2.0
117 stars 10 forks source link

Plugin fails to load /w Traefik 2.9.4 #25

Closed MrNova111 closed 1 year ago

MrNova111 commented 2 years ago

Testing using Traefik docker images. Attempting to load ldapAuth plugin /w 2.9.4 fails with the following error message. Reverting to 2.9.1 resolves.

level=error msg="plugins-local/src/github.com/wiltonsr/ldapAuth/vendor/golang.org/x/crypto/md4/md4.go:18:2: panic" plugin=plugin-ldapAuth module=github.com/wiltonsr/ldapAuth
panic: reflect: Call using *interp.node as type func() hash.Hash [recovered]
        panic: reflect: Call using *interp.node as type func() hash.Hash

goroutine 1 [running]:
github.com/traefik/yaegi/interp.runCfg.func1()
        github.com/traefik/yaegi@v0.14.3/interp/run.go:192 +0x148
panic({0x3a15fc0, 0xc000239e80})
        runtime/panic.go:884 +0x212
reflect.Value.call({0x3a99be0?, 0x4c28f48?, 0x41057f?}, {0x46f126c, 0x4}, {0xc00187c0f0, 0x2, 0xf2ac3357f0?})
        reflect/value.go:440 +0x1abf
reflect.Value.Call({0x3a99be0?, 0x4c28f48?, 0x455252?}, {0xc00187c0f0?, 0x468dba0?, 0xc0005c8790?})
        reflect/value.go:368 +0xbc
github.com/traefik/yaegi/interp.callBin.func2({0x3a99be0?, 0x4c28f48?, 0x4048f4?}, {0xc00187c0f0?, 0xc001b37470?, 0x393d1e0?})
        github.com/traefik/yaegi@v0.14.3/interp/run.go:1483 +0x28
github.com/traefik/yaegi/interp.callBin.func11(0xc0005c8790)
        github.com/traefik/yaegi@v0.14.3/interp/run.go:1658 +0x15f
github.com/traefik/yaegi/interp.runCfg(0xc000852a20, 0xc0005c8790, 0x8?, 0x6?)
        github.com/traefik/yaegi@v0.14.3/interp/run.go:200 +0x29d
github.com/traefik/yaegi/interp.(*Interpreter).run(0xc000d27680, 0xc000852000, 0xc0005c8420?)
        github.com/traefik/yaegi@v0.14.3/interp/run.go:119 +0x38e
github.com/traefik/yaegi/interp.(*Interpreter).importSrc(0xc000d27680, {0xc000828000, 0x3f}, {0xc001bce641, 0x17}, 0x1)
        github.com/traefik/yaegi@v0.14.3/interp/src.go:168 +0xb4f
github.com/traefik/yaegi/interp.(*Interpreter).gta.func1(0xc001c78a20)
        github.com/traefik/yaegi@v0.14.3/interp/gta.go:262 +0x20be
github.com/traefik/yaegi/interp.(*node).Walk(0xc001c78a20, 0xc001d1c580, 0x0)
        github.com/traefik/yaegi@v0.14.3/interp/interp.go:284 +0x34
github.com/traefik/yaegi/interp.(*node).Walk(0xc001c78480, 0xc001d1c580, 0x0)
        github.com/traefik/yaegi@v0.14.3/interp/interp.go:288 +0x75
github.com/traefik/yaegi/interp.(*node).Walk(0xc001c78240, 0xc001d1c580, 0x0)
        github.com/traefik/yaegi@v0.14.3/interp/interp.go:288 +0x75
github.com/traefik/yaegi/interp.(*Interpreter).gta(0xc000d27680, 0xc001c78240, {0xc000828000, 0x3f}, {0xc00124d961, 0x1b}, {0xc001a332e0, 0x7})
        github.com/traefik/yaegi@v0.14.3/interp/gta.go:20 +0x22b
github.com/traefik/yaegi/interp.(*Interpreter).importSrc(0xc000d27680, {0xc001746e40, 0x3e}, {0xc00124d961, 0x1b}, 0x1)
        github.com/traefik/yaegi@v0.14.3/interp/src.go:108 +0x100f
github.com/traefik/yaegi/interp.(*Interpreter).gta.func1(0xc001a4d320)
        github.com/traefik/yaegi@v0.14.3/interp/gta.go:262 +0x20be
github.com/traefik/yaegi/interp.(*node).Walk(0xc001a4d320, 0xc001d1d358, 0x0)
        github.com/traefik/yaegi@v0.14.3/interp/interp.go:284 +0x34
github.com/traefik/yaegi/interp.(*node).Walk(0xc0019e9e60, 0xc001d1d358, 0x0)
        github.com/traefik/yaegi@v0.14.3/interp/interp.go:288 +0x75
github.com/traefik/yaegi/interp.(*node).Walk(0xc0019e9c20, 0xc001d1d358, 0x0)
        github.com/traefik/yaegi@v0.14.3/interp/interp.go:288 +0x75
github.com/traefik/yaegi/interp.(*Interpreter).gta(0xc000d27680, 0xc0019e9c20, {0xc001746e40, 0x3e}, {0xc000293e61, 0x1a}, {0xc001264740, 0x4})
        github.com/traefik/yaegi@v0.14.3/interp/gta.go:20 +0x22b
github.com/traefik/yaegi/interp.(*Interpreter).importSrc(0xc000d27680, {0xc00124c100, 0x1c}, {0xc000293e61, 0x1a}, 0x1)
        github.com/traefik/yaegi@v0.14.3/interp/src.go:108 +0x100f
github.com/traefik/yaegi/interp.(*Interpreter).gta.func1(0xc00126c5a0)
        github.com/traefik/yaegi@v0.14.3/interp/gta.go:262 +0x20be
github.com/traefik/yaegi/interp.(*node).Walk(0xc00126c5a0, 0xc001d1e130, 0x0)
        github.com/traefik/yaegi@v0.14.3/interp/interp.go:284 +0x34
github.com/traefik/yaegi/interp.(*node).Walk(0xc00126a000, 0xc001d1e130, 0x0)
        github.com/traefik/yaegi@v0.14.3/interp/interp.go:288 +0x75
github.com/traefik/yaegi/interp.(*node).Walk(0xc000ecfd40, 0xc001d1e130, 0x0)
        github.com/traefik/yaegi@v0.14.3/interp/interp.go:288 +0x75
github.com/traefik/yaegi/interp.(*Interpreter).gta(0xc000d27680, 0xc000ecfd40, {0xc00124c100, 0x1c}, {0xc000293d81, 0x1c}, {0xc000d2a940, 0x8})
        github.com/traefik/yaegi@v0.14.3/interp/gta.go:20 +0x22b
github.com/traefik/yaegi/interp.(*Interpreter).importSrc(0xc000d27680, {0xc000d2a810, 0x4}, {0xc000293d81, 0x1c}, 0x1)
        github.com/traefik/yaegi@v0.14.3/interp/src.go:108 +0x100f
github.com/traefik/yaegi/interp.(*Interpreter).gta.func1(0xc000ecfb00)
        github.com/traefik/yaegi@v0.14.3/interp/gta.go:262 +0x20be
github.com/traefik/yaegi/interp.(*node).Walk(0xc000ecfb00, 0xc001d1ef08, 0x0)
        github.com/traefik/yaegi@v0.14.3/interp/interp.go:284 +0x34
github.com/traefik/yaegi/interp.(*node).Walk(0xc000ecf9e0, 0xc001d1ef08, 0x0)
        github.com/traefik/yaegi@v0.14.3/interp/interp.go:288 +0x75
github.com/traefik/yaegi/interp.(*node).Walk(0xc000ecf7a0, 0xc001d1ef08, 0x0)
        github.com/traefik/yaegi@v0.14.3/interp/interp.go:288 +0x75
github.com/traefik/yaegi/interp.(*Interpreter).gta(0xc000d27680, 0xc000ecf7a0, {0xc000d2a810, 0x4}, {0xc000d2a810, 0x4}, {0xc000d2a810, 0x4})
        github.com/traefik/yaegi@v0.14.3/interp/gta.go:20 +0x22b
github.com/traefik/yaegi/interp.(*Interpreter).gtaRetry(0xc000d27680?, {0xc0014fb0e8?, 0xc001114080?, 0xc0014fb030?}, {0xc000d2a810, 0x4}, {0xc000d2a810, 0x4})
        github.com/traefik/yaegi@v0.14.3/interp/gta.go:384 +0x154
github.com/traefik/yaegi/interp.(*Interpreter).CompileAST(0xc000d27680, {0x5287508?, 0xc001114080?})
        github.com/traefik/yaegi@v0.14.3/interp/program.go:87 +0x17f
github.com/traefik/yaegi/interp.(*Interpreter).compileSrc(0xc000d27680, {0xc00062bf50?, 0x1?}, {0x0?, 0xc00062bf50?}, 0xe0?)
        github.com/traefik/yaegi@v0.14.3/interp/program.go:59 +0xb8
github.com/traefik/yaegi/interp.(*Interpreter).eval(0xc000d27680, {0xc00062bf50?, 0xc0014fb358?}, {0x0?, 0x1?}, 0x0?)
        github.com/traefik/yaegi@v0.14.3/interp/interp.go:552 +0x28
github.com/traefik/yaegi/interp.(*Interpreter).Eval(...)
        github.com/traefik/yaegi@v0.14.3/interp/interp.go:494
github.com/traefik/traefik/v2/pkg/plugins.NewBuilder(0x0, 0x0?, 0xc000b36898?)
        github.com/traefik/traefik/v2/pkg/plugins/builder.go:104 +0xdc6
main.createPluginBuilder(0xc000582cf0?)
        github.com/traefik/traefik/v2/cmd/traefik/plugins.go:18 +0x35
main.setupServer(0xc000582cf0)
        github.com/traefik/traefik/v2/cmd/traefik/traefik.go:211 +0x538
main.runCmd(0xc000582cf0)
        github.com/traefik/traefik/v2/cmd/traefik/traefik.go:118 +0x3df
main.main.func1({0xc00111a320?, 0xc00013a020?, 0x8?})
        github.com/traefik/traefik/v2/cmd/traefik/traefik.go:63 +0x1f
github.com/traefik/paerser/cli.run(0xc000655780, {0xc00013a020?, 0xa?, 0xa?})
        github.com/traefik/paerser@v0.1.9/cli/commands.go:133 +0x193
github.com/traefik/paerser/cli.execute(0xc000655780, {0xc00013a000?, 0xc, 0xc}, 0x78?)
        github.com/traefik/paerser@v0.1.9/cli/commands.go:76 +0x74a
github.com/traefik/paerser/cli.Execute(...)
        github.com/traefik/paerser@v0.1.9/cli/commands.go:51
main.main()
        github.com/traefik/traefik/v2/cmd/traefik/traefik.go:79 +0x405
wiltonsr commented 2 years ago

Hi, @MrNova111

This problem came from yaegi/v0.14.3.

I will open an issue on their repo.

wiltonsr commented 2 years ago

I opened issue yaegi/#1484.

xraver commented 2 years ago

same here thanks

wiltonsr commented 2 years ago

The yaegi's maintainers already confirmed that it's a bug. Just waiting for a fix.

DandrewsDev commented 1 year ago

Has this been fixed with the newest version of yaegi?

wiltonsr commented 1 year ago

The gorilla/sessions is working, but the go-ldap is broken.

The yaegi's maintainers already have a fix for the problem. Just waiting for a new release.

azamatgizzatullin commented 1 year ago

Bug is still there on traefik 2.9.4, 2.9.5, 2.9.8, 2.9.9

wiltonsr commented 1 year ago

yaegi v0.15.1 now works as expected.

We are still waiting for traefik to release a new version using this yaegi version.

wiltonsr commented 1 year ago

The v2.10.0-rc2 has the yaegi fixed version.

@MrNova111 @xraver @ogmueller @djacomy could you try this new version?

Mantrain commented 1 year ago

using ldapauth v0.0.21 with traefik v2.10.0-rc2 works for me.

wiltonsr commented 1 year ago

Fixed in v2.10.0.