-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
cfg: fail startup on flags.Error parsing error #8822
cfg: fail startup on flags.Error parsing error #8822
Conversation
Important Review skippedAuto reviews are limited to specific labels. Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Wow, amazingly fast @michael1011 🚀 With this change applied, the daemon prints the error message and refuses to proceed the booting sequence, right? |
Exactly
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, thanks for the fix!
d037dfb
to
1f45e10
Compare
config.go
Outdated
@@ -771,7 +772,7 @@ func LoadConfig(interceptor signal.Interceptor) (*Config, error) { | |||
// If it's a parsing related error, then we'll return | |||
// immediately, otherwise we can proceed as possibly the config | |||
// file doesn't exist which is OK. | |||
if _, ok := err.(*flags.IniError); ok { | |||
if lnutils.ErrorAs[*flags.IniError](err) || lnutils.ErrorAs[*flags.Error](err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess one thing that needs to be tested is if the comment above still stands true? Meaning, do we still ignore a non-existing file? Or is that returned as a *flags.Error
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file not existing returns a *fs.PathError
1f45e10
to
2c9cef6
Compare
Now the linter should be happy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK, LGTM 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the Fix, LGTM 🤝
EDIT: Missing Release-Notes for LND 18.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 🚀
2c9cef6
to
58f5698
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last nit, otherwise LGTM 🎉
b9d37e2
to
373a573
Compare
@michael1011 - can you rebase onto latest master pls? 🙏 |
373a573
to
01f5af0
Compare
Rebased @ellemouton |
Change Description
Fixes the issue of @theborakompanioni when updating to LND v0.18.0-beta: #7867 (comment)
Having removed option groups in the config caused the config file parser to throw an error, but that error is
flags.Error
which only printed a warning but did not prevent starting the node.Steps to Test
Steps for reviewers to follow to test the change.
Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]
in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.