From 3656b458ea4b14928f9ae6fa521c62de12dd4cf8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 15:09:20 +0000 Subject: [PATCH 1/4] Bump github.com/go-chi/chi/v5 from 5.0.11 to 5.0.12 Bumps [github.com/go-chi/chi/v5](https://github.com/go-chi/chi) from 5.0.11 to 5.0.12. - [Release notes](https://github.com/go-chi/chi/releases) - [Changelog](https://github.com/go-chi/chi/blob/master/CHANGELOG.md) - [Commits](https://github.com/go-chi/chi/compare/v5.0.11...v5.0.12) --- updated-dependencies: - dependency-name: github.com/go-chi/chi/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 36a3571f..faf8d283 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/dgraph-io/badger v1.6.2 github.com/dgraph-io/badger/v2 v2.2007.4 github.com/fxamacker/cbor/v2 v2.6.0 - github.com/go-chi/chi/v5 v5.0.11 + github.com/go-chi/chi/v5 v5.0.12 github.com/go-jose/go-jose/v3 v3.0.2 github.com/golang/mock v1.6.0 github.com/google/go-cmp v0.6.0 diff --git a/go.sum b/go.sum index 632d8147..f03a8917 100644 --- a/go.sum +++ b/go.sum @@ -136,8 +136,8 @@ github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fxamacker/cbor/v2 v2.6.0 h1:sU6J2usfADwWlYDAFhZBQ6TnLFBHxgesMrQfQgk1tWA= github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= -github.com/go-chi/chi/v5 v5.0.11 h1:BnpYbFZ3T3S1WMpD79r7R5ThWX40TaFB7L31Y8xqSwA= -github.com/go-chi/chi/v5 v5.0.11/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s= +github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= github.com/go-jose/go-jose/v3 v3.0.2 h1:2Edjn8Nrb44UvTdp84KU0bBPs1cO7noRCybtS3eJEUQ= github.com/go-jose/go-jose/v3 v3.0.2/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= From f02d4546a93e62f124860706a16f58a2b9ea26a1 Mon Sep 17 00:00:00 2001 From: Herman Slatman Date: Tue, 5 Mar 2024 11:08:24 +0100 Subject: [PATCH 2/4] Handle CA server startup errors --- ca/ca.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ca/ca.go b/ca/ca.go index ab4a1a9b..23cc85f4 100644 --- a/ca/ca.go +++ b/ca/ca.go @@ -476,6 +476,19 @@ func (ca *CA) Run() error { // wait till error occurs; ensures the servers keep listening err := <-errs + // if the error is not the usual HTTP server closed error, it is + // highly likely that an error occurred when starting one of the + // CA servers, possibly because of a port already being in use or + // some part of the configuration not being correct. This case is + // handled by stopping the CA in its entirety. + if !errors.Is(err, http.ErrServerClosed) { + if stopErr := ca.Stop(); stopErr != nil { + err = fmt.Errorf("failed stopping CA after error occurred: %w: %w", err, stopErr) + } else { + err = fmt.Errorf("stopped CA after error occurred: %w", err) + } + } + wg.Wait() return err From bbb80cde166eea205853835264bdcb3fe9a4e1df Mon Sep 17 00:00:00 2001 From: Herman Slatman Date: Tue, 5 Mar 2024 15:34:13 +0100 Subject: [PATCH 3/4] Add startup error shutdown message to log --- ca/ca.go | 1 + 1 file changed, 1 insertion(+) diff --git a/ca/ca.go b/ca/ca.go index 23cc85f4..6967ede9 100644 --- a/ca/ca.go +++ b/ca/ca.go @@ -482,6 +482,7 @@ func (ca *CA) Run() error { // some part of the configuration not being correct. This case is // handled by stopping the CA in its entirety. if !errors.Is(err, http.ErrServerClosed) { + log.Println("shutting down due to startup error ...") if stopErr := ca.Stop(); stopErr != nil { err = fmt.Errorf("failed stopping CA after error occurred: %w: %w", err, stopErr) } else { From fa5117adaacea8a66e3254514d31af33acfad050 Mon Sep 17 00:00:00 2001 From: Herman Slatman Date: Tue, 5 Mar 2024 23:33:50 +0100 Subject: [PATCH 4/4] Upgrade `google.golang.org/protobuf` to `v1.33.0` --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 022dbddd..e1782a10 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( golang.org/x/net v0.21.0 google.golang.org/api v0.167.0 google.golang.org/grpc v1.62.0 - google.golang.org/protobuf v1.32.0 + google.golang.org/protobuf v1.33.0 ) require ( diff --git a/go.sum b/go.sum index 688e68c8..553aca55 100644 --- a/go.sum +++ b/go.sum @@ -678,6 +678,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=