shiguanghuxian / etcd-manage

一个现代的etcd v3管理ui
http://140.143.234.132:10280/ui/#/key/kv
MIT License
244 stars 61 forks source link

Context deadline exceeded when using with remote etcd which has cert based auth #31

Open raushan2016 opened 5 years ago

raushan2016 commented 5 years ago

I tried running from dev branch. Below is the log.

[[server]] title = "make manager_run" name = "manager_run" address = ["foobar.cosmosdb.com:2379"] key_prefix = "/" desc = "docker way etcd cluster mode" roles = ["admin"] tls_enable = true [server.tls_config] cert_file = "/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/etcdserver.crt" key_file = "/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/etcdserver.key" ca_file = "/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/ca.crt"

{"level":"warn","ts":1571601848.3670743,"caller":"program/http.go:121","msg":"Got etcd as manager_run"} {"level":"info","ts":1571601848.3683703,"caller":"v1/v1.go:522","msg":"Save key","user":"admin","role":"admin"} {"level":"error","ts":1571601856.056904,"caller":"v1/v1.go:202","msg":"Save key error","err":"context deadline exceeded","stacktrace":"github.com/shiguanghuxian/etcd-manage/program/v1.saveEtcdKey.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go:202\ngithub.com/shiguanghuxian/etcd-manage/program/v1.saveEtcdKey\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go:236\ngithub.com/shiguanghuxian/etcd-manage/program/v1.postEtcdKey\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go:154\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/program.(Program).middlewareEtcd.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/http.go:132\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.RecoveryWithWriter.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/recovery.go:48\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.LoggerWithWriter.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/logger.go:84\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(Engine).handleHTTPRequest\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/gin.go:363\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(Engine).ServeHTTP\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/gin.go:328\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2774\nnet/http.(conn).serve\n\t/usr/local/go/src/net/http/server.go:1878"} {"level":"error","ts":1571601858.3689067,"caller":"v1/v1.go:202","msg":"Save key error","err":"context deadline exceeded","stacktrace":"github.com/shiguanghuxian/etcd-manage/program/v1.saveEtcdKey.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go:202\ngithub.com/shiguanghuxian/etcd-manage/program/v1.saveEtcdKey\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go:236\ngithub.com/shiguanghuxian/etcd-manage/program/v1.postEtcdKey\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go:154\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/program.(Program).middlewareEtcd.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/http.go:132\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.RecoveryWithWriter.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/recovery.go:48\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.LoggerWithWriter.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/logger.go:84\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(Engine).handleHTTPRequest\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/gin.go:363\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(Engine).ServeHTTP\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/gin.go:328\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2774\nnet/http.(conn).serve\n\t/usr/local/go/src/net/http/server.go:1878"}

raushan2016 commented 5 years ago

curl -v "foobar.cosmosdb.com:2379" -XPOST --cert /home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/etcdserver.crt --key /home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/etcdserver.key -d '{f1:bar}' -v Note: Unnecessary use of -X or --request, POST is already inferred.