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

Caddy build fails #2549

Closed
abom opened this issue Apr 2, 2019 · 12 comments
Closed

Caddy build fails #2549

abom opened this issue Apr 2, 2019 · 12 comments

Comments

@abom
Copy link

abom commented Apr 2, 2019

GO version:
go version go1.12.1 linux/amd64

1. Which version of Caddy are you using (caddy -version)?

$GOPATH/pkg/mod/github.com/mholt/caddy@v0.11.5

2. What are you trying to do?

Building caddy from source using the steps provided here.

3. What is your Caddyfile?

None

4. How did you run Caddy (give the full command and describe the execution environment)?

Not yet built.

I only ran the first build step:

go get github.com/mholt/caddy/caddy

5. Please paste any relevant HTTP request(s) here.

6. What did you expect to see?

A successful build with no errors.

7. What did you see instead (give full error messages and/or log)?


go: finding github.com/hashicorp/go-syslog v1.0.0
go: finding github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a
go: finding github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f
go: finding github.com/mholt/caddy v0.11.5
go: finding github.com/naoina/go-stringutil v0.1.0
go: finding github.com/shurcooL/sanitized_anchor_name v1.0.0
go: finding github.com/dustin/go-humanize v1.0.0
go: finding go.etcd.io/bbolt v1.3.2
go: finding golang.org/x/oauth2 v0.0.0-20190319182350-c85d3e98c914
go: finding gopkg.in/yaml.v2 v2.2.2
go: finding github.com/itsyouonline/caddy-integration v0.9.12
go: finding github.com/google/uuid v1.1.1
go: finding github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568
go: finding github.com/dgrijalva/jwt-go v3.2.0+incompatible
go: finding cloud.google.com/go v0.34.0
go: finding github.com/caddyserver/builds v0.0.0-20170910200810-c62e2219460a
go: finding golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e
go: finding gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: finding golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
go: finding github.com/GeertJohan/go.rice v1.0.0
go: finding github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced
go: finding github.com/lucas-clemente/quic-go v0.10.1
go: finding github.com/mholt/certmagic v0.0.0-20190401183034-f1fdb7fe9cd1
go: finding github.com/xenolf/lego v2.4.0+incompatible
go: finding github.com/asdine/storm v2.1.2+incompatible
go: finding github.com/hashicorp/golang-lru v0.5.1
go: finding github.com/davecgh/go-spew v1.1.1
go: finding github.com/filebrowser/caddy v2.0.3+incompatible
go: finding github.com/gorilla/websocket v1.4.0
go: finding github.com/daaku/go.zipexe v1.0.0
go: finding google.golang.org/appengine v1.4.0
go: finding github.com/klauspost/cpuid v1.2.0
go: finding github.com/go-acme/lego v2.3.1-0.20190318164254-3684cc738d37+incompatible
go: finding gopkg.in/square/go-jose.v2 v2.2.2
go: finding golang.org/x/sys v0.0.0-20190124100055-b90733256f2e
go: finding github.com/stretchr/testify v1.3.0
go: finding github.com/akavel/rsrc v0.8.0
go: finding github.com/golang/protobuf v1.2.0
go: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
go: finding golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b
go: finding golang.org/x/net v0.0.0-20180724234803-3673e40ba225
go: finding github.com/davecgh/go-spew v1.1.0
go: finding github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229
go: finding github.com/pmezard/go-difflib v1.0.0
go: finding github.com/cenkalti/backoff v2.1.1+incompatible
go: finding github.com/bifurcation/mint v0.0.0-20190129141059-83ba9bc2ead9
go: finding github.com/GeertJohan/go.incremental v1.0.0
go: finding golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3
go: finding github.com/stretchr/objx v0.1.0
go: finding github.com/jessevdk/go-flags v1.4.0
go: finding github.com/russross/blackfriday v2.0.0+incompatible
go: finding github.com/naoina/toml v0.1.1
go: finding github.com/cheekybits/genny v1.0.0
go: finding github.com/valyala/fasttemplate v1.0.1
go: finding github.com/miekg/dns v1.1.3
go: finding golang.org/x/text v0.3.0
go: finding github.com/valyala/bytebufferpool v1.0.0
go: finding github.com/mholt/caddy/caddy latest                                                                                                                                                          [17/18762]
go: downloading github.com/mholt/caddy v0.11.5
go: extracting github.com/mholt/caddy v0.11.5
go: downloading github.com/xenolf/lego v2.4.0+incompatible
go: downloading github.com/mholt/certmagic v0.0.0-20190401183034-f1fdb7fe9cd1
go: downloading gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: downloading github.com/lucas-clemente/quic-go v0.10.1
go: downloading github.com/hashicorp/go-syslog v1.0.0
go: downloading golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3
go: downloading github.com/dustin/go-humanize v1.0.0
go: extracting github.com/hashicorp/go-syslog v1.0.0
go: downloading github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568
go: extracting gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: extracting github.com/mholt/certmagic v0.0.0-20190401183034-f1fdb7fe9cd1
go: downloading github.com/russross/blackfriday v2.0.0+incompatible
go: extracting github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568
go: downloading golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b
go: downloading github.com/go-acme/lego v2.3.1-0.20190318164254-3684cc738d37+incompatible
go: extracting github.com/dustin/go-humanize v1.0.0
go: extracting github.com/russross/blackfriday v2.0.0+incompatible
go: extracting github.com/lucas-clemente/quic-go v0.10.1
go: downloading github.com/bifurcation/mint v0.0.0-20190129141059-83ba9bc2ead9
go: extracting github.com/bifurcation/mint v0.0.0-20190129141059-83ba9bc2ead9
go: extracting golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3
go: downloading github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a
go: extracting github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a
go: extracting golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b
go: downloading github.com/cheekybits/genny v1.0.0
go: extracting github.com/cheekybits/genny v1.0.0
go: extracting github.com/xenolf/lego v2.4.0+incompatible
go: downloading github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced
go: downloading golang.org/x/text v0.3.0
go: extracting github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced
go: extracting github.com/go-acme/lego v2.3.1-0.20190318164254-3684cc738d37+incompatible
go: downloading github.com/google/uuid v1.1.1
go: extracting github.com/google/uuid v1.1.1
go: downloading github.com/hashicorp/golang-lru v0.5.1
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: downloading github.com/naoina/toml v0.1.1
go: downloading github.com/klauspost/cpuid v1.2.0
go: downloading github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f
go: downloading github.com/gorilla/websocket v1.4.0
go: downloading gopkg.in/square/go-jose.v2 v2.2.2
go: extracting github.com/shurcooL/sanitized_anchor_name v1.0.0
go: downloading gopkg.in/yaml.v2 v2.2.2
go: extracting github.com/hashicorp/golang-lru v0.5.1
go: downloading github.com/cenkalti/backoff v2.1.1+incompatible
go: extracting github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f
go: downloading github.com/miekg/dns v1.1.3
go: extracting github.com/naoina/toml v0.1.1
go: downloading github.com/naoina/go-stringutil v0.1.0
go: extracting github.com/gorilla/websocket v1.4.0
go: extracting github.com/klauspost/cpuid v1.2.0
go: extracting github.com/naoina/go-stringutil v0.1.0
go: extracting github.com/cenkalti/backoff v2.1.1+incompatible
go: extracting gopkg.in/yaml.v2 v2.2.2
go: extracting gopkg.in/square/go-jose.v2 v2.2.2
go: extracting github.com/miekg/dns v1.1.3
go: downloading golang.org/x/sys v0.0.0-20190124100055-b90733256f2e
go: extracting golang.org/x/sys v0.0.0-20190124100055-b90733256f2e
go: extracting golang.org/x/text v0.3.0
# github.com/mholt/caddy/caddyhttp/markdown/summary
../../go/pkg/mod/github.com/mholt/caddy@v0.11.5/caddyhttp/markdown/summary/render.go:24:5: cannot use (*renderer)(nil) (type *renderer) as type blackfriday.Renderer in assignment:
        *renderer does not implement blackfriday.Renderer (missing RenderFooter method)
../../go/pkg/mod/github.com/mholt/caddy@v0.11.5/caddyhttp/markdown/summary/summary.go:26:44: too many arguments to conversion to blackfriday.Markdown: blackfriday.Markdown(input, renderer literal, 0)
# github.com/lucas-clemente/quic-go/internal/crypto
../../go/pkg/mod/github.com/lucas-clemente/quic-go@v0.10.1/internal/crypto/key_derivation.go:46:37: cs.KeyLen undefined (type mint.CipherSuiteParams has no field or method KeyLen)
../../go/pkg/mod/github.com/lucas-clemente/quic-go@v0.10.1/internal/crypto/key_derivation.go:47:35: cs.IvLen undefined (type mint.CipherSuiteParams has no field or method IvLen)
# github.com/mholt/caddy/caddytls
../../go/pkg/mod/github.com/mholt/caddy@v0.11.5/caddytls/setup.go:174:28: cannot use value (type "github.com/xenolf/lego/certcrypto".KeyType) as type "github.com/go-acme/lego/certcrypto".KeyType in assignment
../../go/pkg/mod/github.com/mholt/caddy@v0.11.5/caddytls/setup.go:354:4: cannot use config.Manager.KeyType (type "github.com/go-acme/lego/certcrypto".KeyType) as type "github.com/xenolf/lego/certcrypto".KeyType 
in field value

8. Why is this a bug, and how do you think this should be fixed?

I think it's a dependency one.

9. What are you doing to work around the problem in the meantime?

Nothing

10. Please link to any related issues, pull requests, and/or discussion.

Bonus: What do you use Caddy for? Why did you choose Caddy?

@elcore
Copy link
Collaborator

elcore commented Apr 2, 2019

I cannot reproduce your issue. It seems like you are using caddy@v0 11. 5 which does not support modules, please update your local copy.

Caddy build

@elcore elcore closed this as completed Apr 2, 2019
@abom
Copy link
Author

abom commented Apr 2, 2019

Well, i didn't get caddy myself, this is the version that go get grabbed!

@elcore
Copy link
Collaborator

elcore commented Apr 2, 2019

Instead of $GOPATH/pkg/mod/github.com/mholt/caddy@v0.11.5, please use $GOPATH/src/github.com/mholt/caddy, as caddy@v0.11.5 does not support modules - You are in the wrong directory.

@elcore
Copy link
Collaborator

elcore commented Apr 2, 2019

Additionally, you can run this to build Caddy outside of your GOPATH (any directory you like e.g. ~)

  1. git clone https://github.com/mholt/caddy

  2. cd caddy/caddy

  3. go run build.go

@subvillion
Copy link

I'm using doc from main page:

image

and have same error, why go install downloads 0.11.5?


import (
	"github.com/mholt/caddy/caddy/caddymain"
	// plug in plugins here, for example:
	// _ "import/path/here"
)

func main() {
	// optional: disable telemetry
	caddymain.EnableTelemetry = false
	caddymain.Run()
}
 ---> Running in d043e7fbc90d
go: creating new go.mod: module mycaddy_build
go: finding github.com/mholt/caddy/caddy/caddymain latest
go: finding github.com/mholt/caddy/caddy latest
go: finding github.com/mholt/caddy v0.11.5
go: downloading github.com/mholt/caddy v0.11.5
go: extracting github.com/mholt/caddy v0.11.5
go: finding github.com/klauspost/cpuid v1.2.0
go: finding github.com/jimstudt/http-authentication/basic latest
go: finding github.com/hashicorp/go-syslog v1.0.0
go: finding github.com/flynn/go-shlex latest
go: finding github.com/dustin/go-humanize v1.0.0
go: finding github.com/gorilla/websocket v1.4.0
go: finding github.com/xenolf/lego/challenge/tlsalpn01 latest
go: finding github.com/lucas-clemente/quic-go/h2quic latest
go: finding gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: downloading github.com/hashicorp/go-syslog v1.0.0
go: extracting github.com/hashicorp/go-syslog v1.0.0
go: finding github.com/xenolf/lego/certcrypto latest
go: downloading github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568
go: extracting github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568
go: downloading github.com/dustin/go-humanize v1.0.0
go: extracting github.com/dustin/go-humanize v1.0.0
go: finding github.com/xenolf/lego/challenge latest
go: finding github.com/jimstudt/http-authentication latest
go: downloading github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a
go: extracting github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a
go: downloading github.com/klauspost/cpuid v1.2.0
go: downloading github.com/gorilla/websocket v1.4.0
go: extracting github.com/klauspost/cpuid v1.2.0
go: extracting github.com/gorilla/websocket v1.4.0
go: downloading gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: extracting gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: finding github.com/lucas-clemente/quic-go v0.11.1
go: finding github.com/naoina/toml v0.1.1
go: finding golang.org/x/net/http2 latest
go: finding gopkg.in/yaml.v2 v2.2.2
go: finding github.com/google/uuid v1.1.1
go: finding golang.org/x/net latest
go: downloading golang.org/x/net v0.0.0-20190420063019-afa5a82059c6
go: downloading github.com/naoina/toml v0.1.1
go: downloading github.com/lucas-clemente/quic-go v0.11.1
go: extracting github.com/naoina/toml v0.1.1
go: downloading github.com/google/uuid v1.1.1
go: extracting github.com/google/uuid v1.1.1
go: downloading gopkg.in/yaml.v2 v2.2.2
go: extracting gopkg.in/yaml.v2 v2.2.2
go: extracting github.com/lucas-clemente/quic-go v0.11.1
go: finding github.com/russross/blackfriday v2.0.0+incompatible
go: downloading github.com/russross/blackfriday v2.0.0+incompatible
go: extracting github.com/russross/blackfriday v2.0.0+incompatible
go: extracting golang.org/x/net v0.0.0-20190420063019-afa5a82059c6
go: finding github.com/xenolf/lego v2.5.0+incompatible
go: downloading github.com/xenolf/lego v2.5.0+incompatible
go: extracting github.com/xenolf/lego v2.5.0+incompatible
go: finding github.com/mholt/certmagic v0.5.0
go: downloading github.com/mholt/certmagic v0.5.0
go: extracting github.com/mholt/certmagic v0.5.0
go: finding github.com/cheekybits/genny v1.0.0
go: finding golang.org/x/net v0.0.0-20180906233101-161cd47e91fd
go: finding github.com/onsi/gomega v1.4.3
go: finding github.com/onsi/ginkgo v1.7.0
go: finding github.com/marten-seemann/qtls v0.2.3
go: finding github.com/golang/mock v1.2.0
go: finding golang.org/x/text v0.3.0
go: finding golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25
go: finding golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
go: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
go: finding github.com/go-acme/lego v2.5.0+incompatible
go: finding github.com/stretchr/testify v1.3.0
go: finding gopkg.in/yaml.v2 v2.2.1
go: finding golang.org/x/sys v0.0.0-20190124100055-b90733256f2e
go: finding gopkg.in/fsnotify.v1 v1.4.7
go: finding golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e
go: finding golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b
go: finding golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
go: finding golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e
go: finding github.com/cenkalti/backoff v2.1.1+incompatible
go: finding github.com/onsi/ginkgo v1.6.0
go: finding github.com/davecgh/go-spew v1.1.0
go: finding golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3
go: finding github.com/hpcloud/tail v1.0.0
go: finding gopkg.in/square/go-jose.v2 v2.2.2
go: finding github.com/pmezard/go-difflib v1.0.0
go: finding golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a
go: finding golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
go: finding github.com/fsnotify/fsnotify v1.4.7
go: finding github.com/stretchr/objx v0.1.0
go: finding github.com/golang/protobuf v1.2.0
go: finding github.com/miekg/dns v1.1.3
go: finding gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
go: downloading github.com/go-acme/lego v2.5.0+incompatible
go: downloading golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
go: extracting golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
go: extracting github.com/go-acme/lego v2.5.0+incompatible
go: downloading golang.org/x/text v0.3.0
go: downloading github.com/marten-seemann/qtls v0.2.3
go: downloading github.com/cheekybits/genny v1.0.0
go: downloading github.com/cenkalti/backoff v2.1.1+incompatible
go: downloading gopkg.in/square/go-jose.v2 v2.2.2
go: downloading github.com/miekg/dns v1.1.3
go: extracting github.com/cenkalti/backoff v2.1.1+incompatible
go: extracting github.com/cheekybits/genny v1.0.0
go: extracting gopkg.in/square/go-jose.v2 v2.2.2
go: finding github.com/shurcooL/sanitized_anchor_name v1.0.0
go: extracting github.com/marten-seemann/qtls v0.2.3
go: downloading golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e
go: finding github.com/naoina/go-stringutil v0.1.0
go: extracting github.com/miekg/dns v1.1.3
go: extracting golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: extracting github.com/shurcooL/sanitized_anchor_name v1.0.0
go: downloading github.com/naoina/go-stringutil v0.1.0
go: extracting github.com/naoina/go-stringutil v0.1.0
go: extracting golang.org/x/text v0.3.0
# github.com/mholt/caddy/caddyhttp/markdown/summary
/go/pkg/mod/github.com/mholt/caddy@v0.11.5/caddyhttp/markdown/summary/render.go:24:5: cannot use (*renderer)(nil) (type *renderer) as type blackfriday.Renderer in assignment:
        *renderer does not implement blackfriday.Renderer (missing RenderFooter method)
/go/pkg/mod/github.com/mholt/caddy@v0.11.5/caddyhttp/markdown/summary/summary.go:26:44: too many arguments to conversion to blackfriday.Markdown: blackfriday.Markdown(input, renderer literal, 0)
# github.com/mholt/caddy/caddytls
/go/pkg/mod/github.com/mholt/caddy@v0.11.5/caddytls/config.go:120:5: undefined: certmagic.DefaultStorage
/go/pkg/mod/github.com/mholt/caddy@v0.11.5/caddytls/config.go:125:34: undefined: certmagic.DefaultStorage
/go/pkg/mod/github.com/mholt/caddy@v0.11.5/caddytls/config.go:135:12: undefined: certmagic.NewWithCache
/go/pkg/mod/github.com/mholt/caddy@v0.11.5/caddytls/handshake.go:45:35: undefined: certmagic.DefaultServerName
/go/pkg/mod/github.com/mholt/caddy@v0.11.5/caddytls/setup.go:66:4: undefined: certmagic.DefaultStorage
/go/pkg/mod/github.com/mholt/caddy@v0.11.5/caddytls/setup.go:174:28: cannot use value (type "github.com/xenolf/lego/certcrypto".KeyType) as type "github.com/go-acme/lego/certcrypto".KeyType in assignment
/go/pkg/mod/github.com/mholt/caddy@v0.11.5/caddytls/setup.go:354:4: cannot use config.Manager.KeyType (type "github.com/go-acme/lego/certcrypto".KeyType) as type "github.com/xenolf/lego/certcrypto".KeyType in field value
The command '/bin/sh -c go mod init mycaddy_build &&     go install' returned a non-zero code: 2```

@elcore
Copy link
Collaborator

elcore commented Apr 21, 2019

@subvillion This is a known issue, and it will be resolved after the release of the v1.0.0 version tag.

@elcore
Copy link
Collaborator

elcore commented Apr 21, 2019

In the meantime, you can run go get github.com/mholt/caddy@master before go build

@abom
Copy link
Author

abom commented Apr 22, 2019

@elcore I did go get github.com/mholt/caddy@master before building, and got the same error as #2549 (comment)

@mholt
Copy link
Member

mholt commented Apr 22, 2019

Are you adding any plugins to your build? (Which ones?)

@abom
Copy link
Author

abom commented Apr 22, 2019

Filebrowser and this one https://github.com/itsyouonline/caddy-integration.

@abiosoft
Copy link

filebrowser is not compatible with Go modules yet AFAICT, it is one of the plugins I haven't been able to build since switching to modules.

@hacdias
Copy link

hacdias commented May 8, 2019

File Browser itself was and is a go module. The caddy specific package wasn't because Caddy didn't support go modules at the time. I'm taking a look at it.

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

6 participants