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

Please upgrade "go-hclog" library #6810

Closed
onlyjob opened this issue Dec 5, 2019 · 12 comments
Closed

Please upgrade "go-hclog" library #6810

onlyjob opened this issue Dec 5, 2019 · 12 comments

Comments

@onlyjob
Copy link
Contributor

onlyjob commented Dec 5, 2019

Nomad 0.10.2 FTBFS with github.com/hashicorp/go-hclog >=0.9.2 as follows:

# github.com/hashicorp/nomad/nomad 
src/github.com/hashicorp/nomad/nomad/server.go:1110:29: cannot use logger (type *log.Logger) as type hclog.Logger in assignment: 
        *log.Logger does not implement hclog.Logger (missing Debug method) 

Please consider upgrading vendored library to latest released version.

Thanks.

@nickethier nickethier added this to Needs Triage in Nomad - Community Issues Triage via automation Dec 5, 2019
@nickethier nickethier added this to the 0.11.0 milestone Dec 5, 2019
@endocrimes
Copy link
Contributor

Nomad 0.10.2 vendors go-hclog@234833755cb25ae46996d0ef823326f492f89243, which is the same sha as the latest release v0.10.0. 😄.

It looks like your problem comes from upgrading to a newer version of hashicorp/raft, where it changed from using golang's standard logger to go-hclog in #360.

Nomad - Community Issues Triage automation moved this from Needs Triage to Done Dec 6, 2019
@endocrimes
Copy link
Contributor

It appears that we have not yet tagged a release of hashicorp/raft since the inclusion of that PR however (https://github.com/hashicorp/raft/releases/tag/v1.1.1 is currently the latest)

@onlyjob
Copy link
Contributor Author

onlyjob commented Dec 6, 2019

I first experienced this problem in 0.10.0 but before submitting this bug report I've reproduced it on current release 0.10.2.

It looks like your problem comes from upgrading to a newer version of hashicorp/raft

Yes this is precisely my problem (which is actually a downstream problem in Debian where I maintain Nomad packages) but it is also your problem because eventually you'll have to upgrade the library sooner or later.

Please keep such issues open until the problem is fixed. Denial helps nobody, you know...

With 0.10.1 I used the following patch which no longer applies to 0.10.2:

--- a/nomad/server.go
+++ b/nomad/server.go
@@ -1101,10 +1101,15 @@
                s.config.LogOutput)
        s.raftTransport = trans

        // Make sure we set the Logger.
-       logger := s.logger.StandardLogger(&log.StandardLoggerOptions{InferLevels: true})
-       s.config.RaftConfig.Logger = logger
+       raftLogger := log.New(&log.LoggerOptions{
+               Name:       "raft",
+               Output:     s.config.LogOutput,
+               TimeFormat: `2006/01/02 15:04:05`,
+       })
+       s.config.RaftConfig.Logger = raftLogger
+
        s.config.RaftConfig.LogOutput = nil

        // Our version of Raft protocol 2 requires the LocalID to match the network
        // address of the transport. Raft protocol 3 uses permanent ids.

@endocrimes
Copy link
Contributor

@onlyjob FWIW I was going to upgrade Raft last night before realizing that there is no release with the new logging change yet - I'll make sure we file an issue to do so when a release is cut though.

@onlyjob
Copy link
Contributor Author

onlyjob commented Dec 7, 2019

OK, thanks. This FTBFS is with raft-1.1.1 and go-hclog-0.10.0.

Could you re-open this issue please?

@tgross
Copy link
Member

tgross commented Dec 9, 2019

@endocrimes I'm going to reopen so that we can track that change has been merged for the 0.11.0 release.

@tgross tgross reopened this Dec 9, 2019
Nomad - Community Issues Triage automation moved this from Done to Triaged Dec 9, 2019
@tgross
Copy link
Member

tgross commented Dec 19, 2019

Looks like we needed bugfixes for 0.10.3. Merged in #6872

@tgross tgross closed this as completed Dec 19, 2019
Nomad - Community Issues Triage automation moved this from Triaged to Done Dec 19, 2019
@tgross tgross modified the milestones: 0.11.0, 0.10.3 Dec 19, 2019
@onlyjob
Copy link
Contributor Author

onlyjob commented Dec 19, 2019

Thanks! :)

@onlyjob
Copy link
Contributor Author

onlyjob commented Dec 19, 2019

Which branch nomad/server.go fixes for go-hclog 0.10.2 are committed to? Thanks.

@tgross
Copy link
Member

tgross commented Dec 19, 2019

Currently just master. We'll cut a release branch once we're ready to cut the next release (after the new year).

@onlyjob
Copy link
Contributor Author

onlyjob commented Dec 19, 2019

nomad/server.go (in master) was modified last month so it appears that is has not been adapted for go-hclog v0.10.2 yet... I'm looking forward to backport a proper patch in order to replace my sloppy one. :)

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants