Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distributedstek.go:144:16: not enough arguments in call to s.storage.Lock #3464

Closed
htfy96 opened this issue May 31, 2020 · 5 comments
Closed

Comments

@htfy96
Copy link

htfy96 commented May 31, 2020

Hi,

I'm trying to develop a plugin for Caddy 2 based on v2.0.0 tag, but all xcaddy command returned error when I tried to build caddy:

➜  caddy2-filter xcaddy --help
2020/05/31 16:04:14 [INFO] Temporary folder: /tmp/buildenv_2020-05-31-1604.286380283
2020/05/31 16:04:14 [INFO] Writing main module: /tmp/buildenv_2020-05-31-1604.286380283/main.go
2020/05/31 16:04:14 [INFO] Initializing Go module
2020/05/31 16:04:14 [INFO] exec (timeout=10s): /usr/bin/go mod init caddy 
go: creating new go.mod: module caddy
2020/05/31 16:04:14 [INFO] Replace github.com/sjtug/caddy2-filter => /home/lz/code/git/caddy2-filter
2020/05/31 16:04:14 [INFO] exec (timeout=10s): /usr/bin/go mod edit -replace github.com/sjtug/caddy2-filter=/home/lz/code/git/caddy2-filter 
2020/05/31 16:04:15 [INFO] Pinning versions
2020/05/31 16:04:15 [INFO] exec (timeout=0s): /usr/bin/go get -d -v github.com/caddyserver/caddy/v2 
go: github.com/caddyserver/caddy/v2 upgrade => v2.0.0
2020/05/31 16:04:15 [INFO] Build environment ready
2020/05/31 16:04:15 [INFO] Building Caddy
2020/05/31 16:04:15 [INFO] exec (timeout=0s): /usr/bin/go build -o /home/lz/code/git/caddy2-filter/caddy -ldflags -w -s -trimpath 
go: found github.com/sjtug/caddy2-filter in github.com/sjtug/caddy2-filter v0.0.0-00010101000000-000000000000
# github.com/caddyserver/caddy/v2/modules/caddytls/distributedstek
/home/lz/code/gopath/pkg/mod/github.com/caddyserver/caddy/v2@v2.0.0/modules/caddytls/distributedstek/distributedstek.go:144:16: not enough arguments in call to s.storage.Lock
	have (string)
	want (context.Context, string)
2020/05/31 16:04:16 [INFO] Cleaning up temporary folder: /tmp/buildenv_2020-05-31-1604.286380283
2020/05/31 16:04:16 [ERROR] exit status 2
@mholt
Copy link
Member

mholt commented May 31, 2020

Hmm, what is your Go module's go.mod file?

@htfy96
Copy link
Author

htfy96 commented May 31, 2020

go.mod can be found here

@mholt
Copy link
Member

mholt commented May 31, 2020

@htfy96 Thanks, so that's the problem:

github.com/caddyserver/certmagic v0.11.0 // indirect

Caddy is not yet compatible with v0.11.0 (but probably will be this week, once I have a little time.)

Run go mod tidy and that might even fix the problem for you; if not, just use v0.10.13 in your go.mod instead.

@mholt mholt closed this as completed May 31, 2020
@mholt
Copy link
Member

mholt commented May 31, 2020

PS. I'm excited to see the finished plugin! A lot of people will find filtering features useful.

Bonus points if it can someday work with a stream (i.e. without having to buffer the entire response body) -- that is left as an academic exercise, however. 😉

@htfy96
Copy link
Author

htfy96 commented May 31, 2020

Thanks for your help! Currently it works with a bounded-cap buffer, which only buffers first 2MB and once the body exceeds that, it abandons buffering and filtering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants