Block requests by geoip


(Maciej świć) #1

Hi, I am using Caddy to password protect and reverse proxy into some services on the local network. Is it possible to use Caddy to also block requests from certain countries for increased security?


(Matt Holt) #2

Yes, look at the geoip plugin: https://caddyserver.com/docs/http.geoip


(Maciej świć) #3

Thanks, can this be used as a condition within caddy itself though? It would be a lot easier to block everything directly in Caddy instead of passing this to each service that wont even know what to do with it.


(Matthew Fay) #4

It can, yes. The plugin makes several placeholders available, you can use them to redirect / block / manipulate requests accordingly.


(Maciej świć) #5

I have tried this now and it doesn’t seem to work.

(snippet) {
    redir 302 {
        if {geoip_country_code} is "PL"
        / https://disneyworld.disney.go.com/
    }
}

Of course this was then imported using import snippet.
I am in Poland and i went off the local WiFi when i tried it.


(Matthew Fay) #6

You need to also use the geoip directive to set the placeholder, e.g: geoip /path/to/db/GeoLite2-City.mmdb

https://github.com/kodnaplakal/caddy-geoip/blob/master/README.md


(Maciej świć) #7

Thank you, i cannot believe i missed that! It works now.

(snippet) {
    geoip /usr/local/share/GeoIP/GeoLite2-City.mmdb

    redir 302 {
        if {geoip_country_code} is "CN"
        if_op or
        if {geoip_country_code} is "RU"
        / https://disneyworld.disney.go.com/
    }
}

(Maciej świć) #8

After enabling this the server crashes after roughly 10 minutes of running with the message fatal error: concurrent map writes:

Full trace as it is too long: https://pastebin.com/LEQ9nmEp

Aug 05 16:34:09 ubuntu caddy[5489]: 2018/08/05 16:34:09 http: TLS handshake error from 94.254.241.136:34610: tls: client didn't provide a certificate
Aug 05 17:13:03 ubuntu caddy[5489]: 2018/08/05 17:13:03 [INFO] Scanning for stale OCSP staples
Aug 05 17:13:03 ubuntu caddy[5489]: 2018/08/05 17:13:03 [INFO] Done checking OCSP staples
Aug 05 17:26:07 ubuntu caddy[5489]: fatal error: concurrent map writes
Aug 05 17:26:07 ubuntu caddy[5489]: goroutine 137684 [running]:
Aug 05 17:26:07 ubuntu caddy[5489]: runtime.throw(0xc5c8af, 0x15)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/runtime/panic.go:616 +0x81 fp=0xc4202d68c0 sp=0xc4202d68a0 pc=0x42abc1
Aug 05 17:26:07 ubuntu caddy[5489]: runtime.mapassign(0xb6cd40, 0xc4210e8810, 0xc420398930, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/runtime/hashmap.go:519 +0x56e fp=0xc4202d6950 sp=0xc4202d68c0 pc=0x4080ae
Aug 05 17:26:07 ubuntu caddy[5489]: reflect.mapassign(0xb6cd40, 0xc4210e8810, 0xc420398930, 0xc420398920)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/runtime/hashmap.go:1205 +0x3f fp=0xc4202d6980 sp=0xc4202d6950 pc=0x409c2f
Aug 05 17:26:07 ubuntu caddy[5489]: reflect.Value.SetMapIndex(0xb6cd40, 0x10f82e0, 0x195, 0xb31c00, 0xc420398930, 0x98, 0xb31c00, 0xc420398920, 0x198)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/reflect/value.go:1515 +0x1f6 fp=0xc4202d69f0 sp=0xc4202d6980 pc=0x4c1de6
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*decoder).decodeMap(0xc420031c40, 0x8, 0x185031, 0xb6cd40, 0x10f82e0, 0x195, 0x4, 0x10f82f8, 0x198, 0xc420214a00)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/decoder.go:495 +0x1ab fp=0xc4202d6aa8 sp=0xc4202d69f0pc=0xa052ab
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*decoder).unmarshalMap(0xc420031c40, 0x8, 0x185026, 0xb6cd40, 0x10f82e0, 0x195, 0x4,0x7, 0x8, 0x185026)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/decoder.go:320 +0x226 fp=0xc4202d6b90 sp=0xc4202d6aa8pc=0xa03b96
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*decoder).decodeFromType(0xc420031c40, 0x7, 0x8, 0x185026, 0xb6cd40, 0x10f82e0, 0x195, 0x4, 0x0, 0x0, ...)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/decoder.go:123 +0x5e6 fp=0xc4202d6c28 sp=0xc4202d6b90pc=0xa01f46
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*decoder).decode(0xc420031c40, 0x185025, 0xb6cd40, 0x10f82e0, 0x195, 0x3, 0x195, 0x0,0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/decoder.go:54 +0xe7 fp=0xc4202d6ca8 sp=0xc4202d6c28 pc=0xa01397
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*decoder).decodeStruct(0xc420031c40, 0x2, 0x185025, 0xb7cb20, 0x10f82e0, 0x199, 0x3,0x170bf5, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/decoder.go:633 +0x6bf fp=0xc4202d6e38 sp=0xc4202d6ca8pc=0xa05f2f
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*decoder).unmarshalMap(0xc420031c40, 0x2, 0x18501d, 0xb7cb20, 0x10f82e0, 0x199, 0x3,0x7, 0x2, 0x18501d)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/decoder.go:318 +0xde fp=0xc4202d6f20 sp=0xc4202d6e38pc=0xa03a4e
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*decoder).decodeFromType(0xc420031c40, 0x7, 0x2, 0x18501d, 0xb7cb20, 0x10f82e0, 0x199, 0x3, 0x10481c, 0x19fcfe, ...)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/decoder.go:123 +0x5e6 fp=0xc4202d6fb8 sp=0xc4202d6f20pc=0xa01f46
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*decoder).decode(0xc420031c40, 0x18501c, 0xb7cb20, 0x10f82e0, 0x199, 0x2, 0x0, 0x10f82e0, 0xc4201f3ce0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/decoder.go:54 +0xe7 fp=0xc4202d7038 sp=0xc4202d6fb8 pc=0xa01397
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*decoder).unmarshalPointer(0xc420031c40, 0x10, 0x19fcfb, 0xb7cb20, 0x10f82e0, 0x199,0x2, 0x1, 0x10, 0x19fcfb)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/decoder.go:337 +0xcb fp=0xc4202d7098 sp=0xc4202d7038pc=0xa03f0b
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*decoder).decodeFromType(0xc420031c40, 0x1, 0x10, 0x19fcfb, 0xb7cb20, 0x10f82e0, 0x199, 0x2, 0x1, 0x192cf3afe7b8aa01, ...)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/decoder.go:125 +0x664 fp=0xc4202d7130 sp=0xc4202d7098pc=0xa01fc4
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*decoder).decode(0xc420031c40, 0x19fcfa, 0xb7cb20, 0x10f82e0, 0x199, 0x1, 0x199, 0x0,0xc4202ec978)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/decoder.go:54 +0xe7 fp=0xc4202d71b0 sp=0xc4202d7130 pc=0xa01397
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*decoder).decodeStruct(0xc420031c40, 0x7, 0x19fcfa, 0xbbaa40, 0x10f82c0, 0x199, 0x1,0x3f, 0x4101a9, 0x40fca5)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/decoder.go:633 +0x6bf fp=0xc4202d7340 sp=0xc4202d71b0pc=0xa05f2f
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*decoder).unmarshalMap(0xc420031c40, 0x7, 0x19fcf8, 0xbbaa40, 0x10f82c0, 0x199, 0x1,0x7, 0x7, 0x19fcf8)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/decoder.go:318 +0xde fp=0xc4202d7428 sp=0xc4202d7340pc=0xa03a4e
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*decoder).decodeFromType(0xc420031c40, 0x7, 0x7, 0x19fcf8, 0xb1c9a0, 0x10f82c0, 0x16,0x1, 0xc420031c20, 0x179c71, ...)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/decoder.go:123 +0x5e6 fp=0xc4202d74c0 sp=0xc4202d7428pc=0xa01f46
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*decoder).decode(0xc420031c40, 0x19fcf7, 0xb1c9a0, 0x10f82c0, 0x16, 0x0, 0xc420031c20, 0xc4203a846c, 0x4)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/decoder.go:54 +0xe7 fp=0xc4202d7540 sp=0xc4202d74c0 pc=0xa01397
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*Reader).decode(0xc420031c20, 0x19fcf7, 0xb1c9a0, 0x10f82c0, 0x0, 0x10)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/reader.go:165 +0x10d fp=0xc4202d7598 sp=0xc4202d7540pc=0xa074bd
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*Reader).retrieveData(0xc420031c20, 0x51052e, 0xb1c9a0, 0x10f82c0, 0x51052e, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/reader.go:249 +0x88 fp=0xc4202d75d8 sp=0xc4202d7598 pc=0xa07c48
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/oschwald/maxminddb-golang.(*Reader).Lookup(0xc420031c20, 0xc4203a8460, 0x10, 0x10, 0xb1c9a0, 0x10f82c0, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/oschwald/maxminddb-golang/reader.go:117 +0xb1 fp=0xc4202d7620 sp=0xc4202d75d8 pc=0xa07101
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/kodnaplakal/caddy-geoip.GeoIP.lookupLocation(0xce54c0, 0xc420206c80, 0xc420031c20, 0xc420224150, 0x29, 0xceb860,0xc4200989f0, 0xc420333100)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/kodnaplakal/caddy-geoip/setup.go:83 +0xcf fp=0xc4202d76b0 sp=0xc4202d7620 pc=0xa0a7ef
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/kodnaplakal/caddy-geoip.GeoIP.ServeHTTP(0xce54c0, 0xc420206c80, 0xc420031c20, 0xc420224150, 0x29, 0xceb860, 0xc4200989f0, 0xc420333100, 0xc01ee0, 0x1, ...)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/kodnaplakal/caddy-geoip/setup.go:75 +0x70 fp=0xc4202d7700 sp=0xc4202d76b0 pc=0xa0a6a0
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/kodnaplakal/caddy-geoip.(*GeoIP).ServeHTTP(0xc420402150, 0xceb860, 0xc4200989f0, 0xc420333100, 0x1, 0x40ab54, 0xc42022ad40)
Aug 05 17:26:07 ubuntu caddy[5489]:         <autogenerated>:1 +0x81 fp=0xc4202d7768 sp=0xc4202d7700 pc=0xa0b0d1
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy/caddyhttp/gzip.Gzip.ServeHTTP(0xce54a0, 0xc420402150, 0xc420206800, 0x1, 0x1, 0xcec860, 0xc42000c0d0, 0xc420333100, 0x0, 0x0, ...)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddyhttp/gzip/gzip.go:90 +0x34c fp=0xc4202d7878 sp=0xc4202d7768 pc=0x960f8c
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy/caddyhttp/gzip.(*Gzip).ServeHTTP(0xc420402180, 0xcec860, 0xc42000c0d0, 0xc420333100, 0x0, 0xc420398900, 0xced2a0)
Aug 05 17:26:07 ubuntu caddy[5489]:         <autogenerated>:1 +0x81 fp=0xc4202d78e0 sp=0xc4202d7878 pc=0x963cd1
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy/caddyhttp/httpserver.(*Server).serveHTTP(0xc420143260, 0xcec860, 0xc42000c0d0, 0xc420333100, 0x5, 0xc4204283f0, 0xced2a0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddyhttp/httpserver/server.go:445 +0x2e0 fp=0xc4202d7a50 sp=0xc4202d78e0 pc=0x92ce80
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy/caddyhttp/httpserver.(*Server).ServeHTTP(0xc420143260, 0xcec860, 0xc42000c0d0, 0xc420333000)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddyhttp/httpserver/server.go:381 +0x498 fp=0xc4202d7bf8 sp=0xc4202d7a50 pc=0x92ca78
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy/caddyhttp/httpserver.(*tlsHandler).ServeHTTP(0xc420436f20, 0xcec860, 0xc42000c0d0, 0xc420332e00)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddyhttp/httpserver/mitm.go:128 +0x409 fp=0xc4202d7d78 sp=0xc4202d7bf8 pc=0x91e5e9
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.serverHandler.ServeHTTP(0xc4201348f0, 0xcec860, 0xc42000c0d0, 0xc42019bd00)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/server.go:2694 +0xbc fp=0xc4202d7da8 sp=0xc4202d7d78 pc=0x6ca47c
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.initNPNRequest.ServeHTTP(0xc4203dc000, 0xc4201348f0, 0xcec860, 0xc42000c0d0, 0xc42019bd00)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/server.go:3260 +0x9a fp=0xc4202d7f18 sp=0xc4202d7da8 pc=0x6cbc9a
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.(*initNPNRequest).ServeHTTP(0xc42014c7f0, 0xcec860, 0xc42000c0d0, 0xc42019bd00)
Aug 05 17:26:07 ubuntu caddy[5489]:         <autogenerated>:1 +0x63 fp=0xc4202d7f50 sp=0xc4202d7f18 pc=0x6eecb3
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.(Handler).ServeHTTP-fm(0xcec860, 0xc42000c0d0, 0xc42019bd00)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/h2_bundle.go:5475 +0x4d fp=0xc4202d7f80 sp=0xc4202d7f50 pc=0x6e79ad
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.(*http2serverConn).runHandler(0xc42057c000, 0xc42000c0d0, 0xc42019bd00, 0xc420414860)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/h2_bundle.go:5760 +0x89 fp=0xc4202d7fc0 sp=0xc4202d7f80 pc=0x6a31d9
Aug 05 17:26:07 ubuntu caddy[5489]: runtime.goexit()
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4202d7fc8 sp=0xc4202d7fc0 pc=0x459cf1
Aug 05 17:26:07 ubuntu caddy[5489]: created by net/http.(*http2serverConn).processHeaders
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/h2_bundle.go:5494 +0x46b
Aug 05 17:26:07 ubuntu caddy[5489]: goroutine 1 [semacquire, 133 minutes]:
Aug 05 17:26:07 ubuntu caddy[5489]: sync.runtime_Semacquire(0xc42021407c)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/runtime/sema.go:56 +0x39
Aug 05 17:26:07 ubuntu caddy[5489]: sync.(*WaitGroup).Wait(0xc420214070)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/sync/waitgroup.go:129 +0x72
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy.(*Instance).Wait(0xc420282000)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddy.go:440 +0x2f
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy/caddy/caddymain.Run()
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddy/caddymain/run.go:190 +0x65d
Aug 05 17:26:07 ubuntu caddy[5489]: main.main()
Aug 05 17:26:07 ubuntu caddy[5489]:         src/github.com/mholt/caddy/caddy/main.go:27 +0x27
Aug 05 17:26:07 ubuntu caddy[5489]: goroutine 5 [syscall, 133 minutes]:
Aug 05 17:26:07 ubuntu caddy[5489]: os/signal.signal_recv(0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/runtime/sigqueue.go:139 +0xa6
Aug 05 17:26:07 ubuntu caddy[5489]: os/signal.loop()
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/os/signal/signal_unix.go:22 +0x22
Aug 05 17:26:07 ubuntu caddy[5489]: created by os/signal.init.0
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/os/signal/signal_unix.go:28 +0x41
Aug 05 17:26:07 ubuntu caddy[5489]: goroutine 6 [select, 13 minutes]:
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy/caddytls.maintainAssets(0xc420096180)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddytls/maintain.go:68 +0x155
Aug 05 17:26:07 ubuntu caddy[5489]: created by github.com/mholt/caddy/caddytls.init.2
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddytls/maintain.go:32 +0x4e
Aug 05 17:26:07 ubuntu caddy[5489]: goroutine 18 [chan receive, 133 minutes]:
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy.trapSignalsCrossPlatform.func1()
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/sigtrap.go:45 +0x100
Aug 05 17:26:07 ubuntu caddy[5489]: created by github.com/mholt/caddy.trapSignalsCrossPlatform
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/sigtrap.go:40 +0x35
Aug 05 17:26:07 ubuntu caddy[5489]: goroutine 19 [chan receive, 133 minutes]:
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy.trapSignalsPosix.func1()
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/sigtrap_posix.go:34 +0x13f
Aug 05 17:26:07 ubuntu caddy[5489]: created by github.com/mholt/caddy.trapSignalsPosix
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/sigtrap_posix.go:30 +0x35
Aug 05 17:26:07 ubuntu caddy[5489]: goroutine 33 [select, 133 minutes, locked to thread]:
Aug 05 17:26:07 ubuntu caddy[5489]: runtime.gopark(0xc881f8, 0x0, 0xc51601, 0x6, 0x18, 0x1)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/runtime/proc.go:291 +0x11a
Aug 05 17:26:07 ubuntu caddy[5489]: runtime.selectgo(0xc42025c750, 0xc420254060)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/runtime/select.go:392 +0xe50
Aug 05 17:26:07 ubuntu caddy[5489]: runtime.ensureSigM.func1()
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/runtime/signal_unix.go:549 +0x1f4
Aug 05 17:26:07 ubuntu caddy[5489]: runtime.goexit()
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/runtime/asm_amd64.s:2361 +0x1
Aug 05 17:26:07 ubuntu caddy[5489]: goroutine 10 [IO wait]:
Aug 05 17:26:07 ubuntu caddy[5489]: internal/poll.runtime_pollWait(0x7f889b5adf00, 0x72, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/runtime/netpoll.go:173 +0x57
Aug 05 17:26:07 ubuntu caddy[5489]: internal/poll.(*pollDesc).wait(0xc420416698, 0x72, 0xc4201f7200, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/internal/poll/fd_poll_runtime.go:85 +0x9b
Aug 05 17:26:07 ubuntu caddy[5489]: internal/poll.(*pollDesc).waitRead(0xc420416698, 0xffffffffffffff00, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/internal/poll/fd_poll_runtime.go:90 +0x3d
Aug 05 17:26:07 ubuntu caddy[5489]: internal/poll.(*FD).Accept(0xc420416680, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/internal/poll/fd_unix.go:372 +0x1a8
Aug 05 17:26:07 ubuntu caddy[5489]: net.(*netFD).accept(0xc420416680, 0xc42003c000, 0xc4201f7298, 0xc4201f72a0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/fd_unix.go:238 +0x42
Aug 05 17:26:07 ubuntu caddy[5489]: net.(*TCPListener).accept(0xc420148590, 0xc42006bdc8, 0x429fd4, 0xc88330)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/tcpsock_posix.go:136 +0x2e
Aug 05 17:26:07 ubuntu caddy[5489]: net.(*TCPListener).AcceptTCP(0xc420148590, 0x4021f8, 0xc42022cd00, 0xb59c20)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/tcpsock.go:246 +0x49
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy/caddyhttp/httpserver.tcpKeepAliveListener.Accept(0xc420148590, 0xc420436f20, 0xffffffffffffffff, 0x433fa4, 0xc42006be10)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddyhttp/httpserver/server.go:528 +0x2f
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy/caddyhttp/httpserver.(*tlsHelloListener).Accept(0xc4201f7680, 0xc87b80, 0xc42022cc80, 0xced2a0, 0xc4203be600)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddyhttp/httpserver/mitm.go:361 +0x37
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.(*Server).Serve(0xc4201348f0, 0xceb9e0, 0xc4201f7680, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/server.go:2770 +0x1a5
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy/caddyhttp/httpserver.(*Server).Serve(0xc420143260, 0xcecb60, 0xc420148590, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddyhttp/httpserver/server.go:322 +0xa6
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy.startServers.func1.1(0xc420143320, 0xced460, 0xc420143260, 0xcecb60, 0xc420148590, 0xc420282000)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddy.go:788 +0x49
Aug 05 17:26:07 ubuntu caddy[5489]: created by github.com/mholt/caddy.startServers.func1
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddy.go:787 +0xac
Aug 05 17:26:07 ubuntu caddy[5489]: goroutine 25 [chan receive, 133 minutes]:
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy.startServers.func2(0xc420143320)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddy.go:800 +0x41
Aug 05 17:26:07 ubuntu caddy[5489]: created by github.com/mholt/caddy.startServers
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddy.go:799 +0xb27
Aug 05 17:26:07 ubuntu caddy[5489]: goroutine 12 [select, 133 minutes]:
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy/caddytls.standaloneTLSTicketKeyRotation(0xc4203e2300, 0xc4201cbb80, 0xc420209380)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddytls/crypto.go:310 +0x26a
Aug 05 17:26:07 ubuntu caddy[5489]: created by github.com/mholt/caddy/caddytls.RotateSessionTicketKeys
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddytls/crypto.go:269 +0x8d
Aug 05 17:26:07 ubuntu caddy[5489]: goroutine 26 [IO wait, 71 minutes]:
Aug 05 17:26:07 ubuntu caddy[5489]: internal/poll.runtime_pollWait(0x7f889b5ade30, 0x72, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/runtime/netpoll.go:173 +0x57
Aug 05 17:26:07 ubuntu caddy[5489]: internal/poll.(*pollDesc).wait(0xc420416718, 0x72, 0xc420076000, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/internal/poll/fd_poll_runtime.go:85 +0x9b
Aug 05 17:26:07 ubuntu caddy[5489]: internal/poll.(*pollDesc).waitRead(0xc420416718, 0xffffffffffffff00, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/internal/poll/fd_poll_runtime.go:90 +0x3d
Aug 05 17:26:07 ubuntu caddy[5489]: internal/poll.(*FD).Accept(0xc420416700, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/internal/poll/fd_unix.go:372 +0x1a8
Aug 05 17:26:07 ubuntu caddy[5489]: net.(*netFD).accept(0xc420416700, 0xc420466940, 0xc42048fdd8, 0x4021f8)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/fd_unix.go:238 +0x42
Aug 05 17:26:07 ubuntu caddy[5489]: net.(*TCPListener).accept(0xc420148598, 0xc42048fe08, 0x401127, 0xc420466940)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/tcpsock_posix.go:136 +0x2e
Aug 05 17:26:07 ubuntu caddy[5489]: net.(*TCPListener).AcceptTCP(0xc420148598, 0xc42048fe50, 0xc42048fe58, 0x18)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/tcpsock.go:246 +0x49
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy/caddyhttp/httpserver.tcpKeepAliveListener.Accept(0xc420148598, 0xc87b80, 0xc4204668c0, 0xced2a0, 0xc420403ce0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddyhttp/httpserver/server.go:528 +0x2f
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.(*Server).Serve(0xc420404dd0, 0xcecb60, 0xc420148598, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/server.go:2770 +0x1a5
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy/caddyhttp/httpserver.(*Server).Serve(0xc4201432c0, 0xcecb60, 0xc420148598, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddyhttp/httpserver/server.go:322 +0xa6
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy.startServers.func1.1(0xc420143320, 0xced460, 0xc4201432c0, 0xcecb60, 0xc420148598, 0xc420282000)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddy.go:788 +0x49
Aug 05 17:26:07 ubuntu caddy[5489]: created by github.com/mholt/caddy.startServers.func1
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddy.go:787 +0xac
Aug 05 17:26:07 ubuntu caddy[5489]: goroutine 65 [select]:
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.(*http2serverConn).serve(0xc4201c6fc0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/h2_bundle.go:4505 +0x5b6
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.(*http2Server).ServeConn(0xc4201f7740, 0xcf2480, 0xc4203dc700, 0xc420367d60)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/h2_bundle.go:4124 +0x74b
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.http2ConfigureServer.func1(0xc4201348f0, 0xc4203dc700, 0xce75a0, 0xc4203c0af0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/h2_bundle.go:3962 +0x81
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.(*conn).serve(0xc42022cf00, 0xced2a0, 0xc4203beed0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/server.go:1751 +0xe9e
Aug 05 17:26:07 ubuntu caddy[5489]: created by net/http.(*Server).Serve
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/server.go:2795 +0x27b
Aug 05 17:26:07 ubuntu caddy[5489]: goroutine 137683 [semacquire]:
Aug 05 17:26:07 ubuntu caddy[5489]: sync.runtime_notifyListWait(0xc42024ee98, 0xc400000000)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/runtime/sema.go:510 +0x10b
Aug 05 17:26:07 ubuntu caddy[5489]: sync.(*Cond).Wait(0xc42024ee88)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/sync/cond.go:56 +0x80
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.(*http2pipe).Read(0xc42024ee80, 0xc4210e33c7, 0x31, 0xc39, 0x0, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/h2_bundle.go:3641 +0x8f
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.(*http2requestBody).Read(0xc4201f3380, 0xc4210e33c7, 0x31, 0xc39, 0x5, 0xc4207e1a48, 0x4de617)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/h2_bundle.go:5916 +0x9e
Aug 05 17:26:07 ubuntu caddy[5489]: io.(*teeReader).Read(0xc4204146e0, 0xc4210e33c7, 0x31, 0xc39, 0xc4207e1a88, 0x4de6a9, 0xcec7e0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/io/io.go:533 +0x55
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.transferBodyReader.Read(0xc420030dc0, 0xc4210e33c7, 0x31, 0xc39, 0x40d2cd, 0xc42001c000, 0xb7b820)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/transfer.go:60 +0x56
Aug 05 17:26:07 ubuntu caddy[5489]: io.(*LimitedReader).Read(0xc420414840, 0xc4210e33c7, 0xc39, 0xc39, 0xc4204143c0, 0xc4202148d0, 0x462752)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/io/io.go:446 +0x63
Aug 05 17:26:07 ubuntu caddy[5489]: bufio.(*Writer).ReadFrom(0xc420406d00, 0xce5e20, 0xc420414840, 0x7f885e699120, 0xc420406d00, 0xc4207e1d01)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/bufio/bufio.go:703 +0xcd
Aug 05 17:26:07 ubuntu caddy[5489]: io.copyBuffer(0xce5100, 0xc420406d00, 0xce5e20, 0xc420414840, 0x0, 0x0, 0x0, 0xba7d40, 0x1, 0xc420414840)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/io/io.go:386 +0x31a
Aug 05 17:26:07 ubuntu caddy[5489]: io.Copy(0xce5100, 0xc420406d00, 0xce5e20, 0xc420414840, 0xc4210e33c5, 0xc4e751, 0x2)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/io/io.go:362 +0x5a
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.(*transferWriter).WriteBody(0xc420030dc0, 0xce5100, 0xc420406d00, 0x2, 0x2)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/transfer.go:337 +0x5fa
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.(*Request).write(0xc42019bb00, 0xce5100, 0xc420406d00, 0x0, 0x0, 0x0, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/request.go:622 +0x6b2
Aug 05 17:26:07 ubuntu caddy[5489]: net/http.(*persistConn).writeLoop(0xc4203af560)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/transport.go:1825 +0x1ea
Aug 05 17:26:07 ubuntu caddy[5489]: created by net/http.(*Transport).dialConn
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/http/transport.go:1238 +0x97f
Aug 05 17:26:07 ubuntu caddy[5489]: goroutine 36 [IO wait]:
Aug 05 17:26:07 ubuntu caddy[5489]: internal/poll.runtime_pollWait(0x7f889b5add60, 0x72, 0xc4200666a8)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/runtime/netpoll.go:173 +0x57
Aug 05 17:26:07 ubuntu caddy[5489]: internal/poll.(*pollDesc).wait(0xc420229f18, 0x72, 0xffffffffffffff00, 0xce77c0, 0x10754d0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/internal/poll/fd_poll_runtime.go:85 +0x9b
Aug 05 17:26:07 ubuntu caddy[5489]: internal/poll.(*pollDesc).waitRead(0xc420229f18, 0xc42031b400, 0x400, 0x400)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/internal/poll/fd_poll_runtime.go:90 +0x3d
Aug 05 17:26:07 ubuntu caddy[5489]: internal/poll.(*FD).Read(0xc420229f00, 0xc42031b400, 0x400, 0x400, 0x0, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/internal/poll/fd_unix.go:157 +0x17d
Aug 05 17:26:07 ubuntu caddy[5489]: net.(*netFD).Read(0xc420229f00, 0xc42031b400, 0x400, 0x400, 0xc4203b10e0, 0x3c, 0x3c)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/fd_unix.go:202 +0x4f
Aug 05 17:26:07 ubuntu caddy[5489]: net.(*conn).Read(0xc420200390, 0xc42031b400, 0x400, 0x400, 0x0, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/net/net.go:176 +0x6a
Aug 05 17:26:07 ubuntu caddy[5489]: github.com/mholt/caddy/caddyhttp/httpserver.(*clientHelloConn).Read(0xc4203beea0, 0xc42031b400, 0x400, 0x400, 0xbe3c60, 0x0, 0x7f889b5b1fd0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /home/maciekish/work/src/github.com/mholt/caddy/caddyhttp/httpserver/mitm.go:176 +0x77f
Aug 05 17:26:07 ubuntu caddy[5489]: crypto/tls.(*block).readFromUntil(0xc4203befc0, 0x7f889b5b1fd0, 0xc4203beea0, 0x5, 0xc4203beea0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/crypto/tls/conn.go:493 +0x96
Aug 05 17:26:07 ubuntu caddy[5489]: crypto/tls.(*Conn).readRecord(0xc4203dc700, 0xc88317, 0xc4203dc820, 0x455d60)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/crypto/tls/conn.go:595 +0xe0
Aug 05 17:26:07 ubuntu caddy[5489]: crypto/tls.(*Conn).Read(0xc4203dc700, 0xc4200ceab8, 0x9, 0x9, 0x0, 0x0, 0x0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/crypto/tls/conn.go:1156 +0x100
Aug 05 17:26:07 ubuntu caddy[5489]: io.ReadAtLeast(0x7f889b5b2308, 0xc4203dc700, 0xc4200ceab8, 0x9, 0x9, 0x9, 0x30, 0x1, 0x2)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/io/io.go:309 +0x86
Aug 05 17:26:07 ubuntu caddy[5489]: io.ReadFull(0x7f889b5b2308, 0xc4203dc700, 0xc4200ceab8, 0x9, 0x9, 0xc420431800, 0xc420066ee0, 0xc4202094a0)
Aug 05 17:26:07 ubuntu caddy[5489]:         /usr/local/go/src/io/io.go:327 +0x58

(Matthew Fay) #9

Your best bet might be to open an issue on the geoip plugin repository:

https://github.com/kodnaplakal/caddy-geoip/issues


(Maciej świć) #10

Done, thank you.