From b1836587f2bf7753a32f373a9cd49b631cdb852a Mon Sep 17 00:00:00 2001 From: Fabian Beuke Date: Wed, 4 Jul 2018 14:20:03 +0200 Subject: [PATCH 1/3] Update keyFile first/last line comment in kv-config.md --- docs/user-guide/kv-config.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user-guide/kv-config.md b/docs/user-guide/kv-config.md index 9a42491d8..7b92b44ff 100644 --- a/docs/user-guide/kv-config.md +++ b/docs/user-guide/kv-config.md @@ -85,9 +85,9 @@ defaultEntryPoints = ["http", "https"] certFile = """-----BEGIN CERTIFICATE----- -----END CERTIFICATE-----""" - keyFile = """-----BEGIN CERTIFICATE----- + keyFile = """-----BEGIN PRIVATE KEY----- - -----END CERTIFICATE-----""" + -----END PRIVATE KEY-----""" [entryPoints.other-https] address = ":4443" [entryPoints.other-https.tls] From f323df466db7c003f161e02b573123b4e123ff30 Mon Sep 17 00:00:00 2001 From: Or Tzabary Date: Thu, 5 Jul 2018 16:12:03 +0300 Subject: [PATCH 2/3] Split the error handling from Consul Catalog (deadlock) --- provider/consulcatalog/consul_catalog.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/provider/consulcatalog/consul_catalog.go b/provider/consulcatalog/consul_catalog.go index 1c9010ccd..36f4860cc 100644 --- a/provider/consulcatalog/consul_catalog.go +++ b/provider/consulcatalog/consul_catalog.go @@ -1,7 +1,6 @@ package consulcatalog import ( - "errors" "fmt" "strconv" "strings" @@ -155,14 +154,8 @@ func (p *Provider) watch(configurationChan chan<- types.ConfigMessage, stop chan defer close(stopCh) defer close(watchCh) - for { - select { - case <-stop: - return nil - case index, ok := <-watchCh: - if !ok { - return errors.New("consul service list nil") - } + safe.Go(func() { + for index := range watchCh { log.Debug("List of services changed") nodes, err := p.getNodes(index) if err != nil { @@ -173,6 +166,13 @@ func (p *Provider) watch(configurationChan chan<- types.ConfigMessage, stop chan ProviderName: "consul_catalog", Configuration: configuration, } + } + }) + + for { + select { + case <-stop: + return nil case err := <-errorCh: return err } From bacd58ed7bc4905d3544fe64de4008d661bd1bfc Mon Sep 17 00:00:00 2001 From: SALLEYRON Julien Date: Fri, 6 Jul 2018 10:32:03 +0200 Subject: [PATCH 3/3] Add logs when error is generated in error handler --- server/errorhandler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/errorhandler.go b/server/errorhandler.go index 80cc9fae6..732b2cc0e 100644 --- a/server/errorhandler.go +++ b/server/errorhandler.go @@ -5,6 +5,7 @@ import ( "net" "net/http" + "github.com/containous/traefik/log" "github.com/containous/traefik/middlewares" ) @@ -37,4 +38,5 @@ func (eh *RecordingErrorHandler) ServeHTTP(w http.ResponseWriter, req *http.Requ w.WriteHeader(statusCode) w.Write([]byte(http.StatusText(statusCode))) + log.Debugf("'%d %s' caused by: %v", statusCode, http.StatusText(statusCode), err) }