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

Improve error message for wrong upstream definition #356

Closed
ikarisan opened this issue Dec 7, 2021 · 4 comments
Closed

Improve error message for wrong upstream definition #356

ikarisan opened this issue Dec 7, 2021 · 4 comments
Labels
🔨 enhancement New feature or request
Milestone

Comments

@ikarisan
Copy link

ikarisan commented Dec 7, 2021

Hi!
I am running blocky in a docker container. Today I tried to update the image from 0.16 to 0.17. But after doing this, blocky does not want to start any longer. :(

The error messages are always:

[...]
[2021-12-07 19:21:10] FATAL wrong file structure: can't convert port to number (1 - 65535) strconv.ParseUint: parsing "": invalid syntax
[2021-12-07 19:21:12] FATAL wrong file structure: can't convert port to number (1 - 65535) strconv.ParseUint: parsing "": invalid syntax
[...]

Maybe I am missing the "config.GetConfig().HTTPPort" related entry, referenced in file root.go ("func initConfig()")?! But neither httpPort nor httpsPort is marked as mandatory.

@ikarisan
Copy link
Author

ikarisan commented Dec 7, 2021

Maybe the reason for this is, that in 0.16 the following line was okay:

upstream:
default:
- tls:dns.quad9.net

But within version 0.17 is seems that it must be something like this:

upstream:
default:
- tcp-tls:dns.quad9.net

O.O

@0xERR0R
Copy link
Owner

0xERR0R commented Dec 7, 2021

It should be "tcp-tls", see here: https://0xerr0r.github.io/blocky/configuration/#upstream-configuration

The error message should be more verbose here

@0xERR0R 0xERR0R added the 🔨 enhancement New feature or request label Dec 7, 2021
@0xERR0R 0xERR0R added this to the 0.18 milestone Dec 7, 2021
@ikarisan
Copy link
Author

ikarisan commented Dec 8, 2021

The error message should be more verbose here

Yes. The line number where the error occurs would be nice. ;) ;)

@kwitsch
Copy link
Collaborator

kwitsch commented Dec 10, 2021

The error message should be more verbose here

Yes. The line number where the error occurs would be nice. ;) ;)

The line number seems not be easily available in the conversion methode.

But it should be easy to modify the error message with something like
err = fmt.Errorf("can't convert upstream resolver '%s' -> %w", upstream, err).
This would show the invalid upstream resolver entry in the error message.

@0xERR0R 0xERR0R changed the title "FATAL wrong file structure" after updating from 0.16 to 0.17 Improve error message for wrong upstream definition Dec 11, 2021
@0xERR0R 0xERR0R closed this as completed Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants