Closed diizzyy closed 11 months ago
Still busy or is this something you can look into? @TimothyYe It appears to be a simple parsing bug
Same problem on windows. "ip_interface": "wgpia0",
time="2023-09-07T16:09:24-04:00" level=info msg="Creating DNS handler with provider: DuckDNS" time="2023-09-07T16:09:24-04:00" level=info msg="GoDNS started, starting the DNS manager..." time="2023-09-07T16:09:24-04:00" level=error msg="Cannot get IP:Get \"\": unsupported protocol scheme \"\"" time="2023-09-07T16:09:24-04:00" level=error msg="get ip online failed. Fallback to get ip from interface if possible." time="2023-09-07T16:09:24-04:00" level=error msg="get ip from interface failed. There is no more ways to try." time="2023-09-07T16:09:24-04:00" level=error msg="can't get a vaild address from wgpia0" time="2023-09-07T16:09:24-04:00" level=debug msg="DNS update loop finished, will run again in 300 seconds"
@TimothyYe Can you possibly have a look at this?
@diizzyy Thanks, I'll look into this issue.
ERRO[0000] Cannot get IP:Get "": unsupported protocol scheme ""
@diizzyy I've checked the code, this error means GoDNS still tries to get the IP address from the internet.
I think to fix this issue, update your config as:
{
"ip_type": "IPv4",
"ip_interface": "hn0",
"interval": 300,
"debug_info": true,
"run_once": true
}
Just remove ip_urls
from it.
By the way, I've released a new version to fix this problem and filter the empty URLs in the ip_urls
option.
@TimothyYe Hi, still doesn't work unfortunately
"ip_type": "IPv4",
"ip_interface": "hn0",
"interval": 300,
"debug_info": true,
"run_once": true
INFO[0000] GoDNS started, starting the DNS manager... ERRO[0000] get ip from interface failed. There is no more ways to try. ERRO[0000] Error during execution:fail to get current IP
Also the syntax is from the manual, https://github.com/TimothyYe/godns#network-interface-ip-address
Could you please help to run the ifconfig
command, and paste the output for your network interface hn0
here?
I guess the only difference between GoDNS and the code snippet you mentioned is that GoDNS checks if the IP is private:
https://github.com/TimothyYe/godns/blob/master/pkg/lib/ip_helper.go#L122
I use my Oracle cloud to test GoDNS on the FreeBSD system, and the same error shows when the network interface is assigned with a private
IP address:
For the current implementation, GoDNS will ignore the private
IP address while fetching it from the network interface.
Ahh, you're correct! I should've checked the code more carefully but it would be nice if godns where verbose about it especially in debug mode. There seems to be a loop however somewhere in the logic to detect IP?
INFO[0000] Creating DNS handler with provider: Infomaniak
INFO[0000] GoDNS started, starting the DNS manager...
DEBU[0000] get ip success from network intereface by: igb0, IP: NOT PRIVATE
DEBU[0000] get ip success from network intereface by: igb0, IP: NOT PRIVATE
INFO[0002] Update IP success: good NOT PRIVATE
DEBU[0002] Cached IP address: NOT PRIVATE
It's not a loop, it only happens when the GoDNS is launched for the first time, the current_ip
in the IPHelper
is empty, so it tries to fetch the current IP address immediately. In this case, it produces one extra output log:
https://github.com/TimothyYe/godns/blob/master/pkg/lib/ip_helper.go#L71
Another log is produced by the inner goroutine inside the IPHelper
:
https://github.com/TimothyYe/godns/blob/master/pkg/lib/ip_helper.go#L60
So you may see two output logs here.
Thanks for clarifying, I guess we can close this now.
Not sure if it's configuration issue or not (seems like a bug) but trying to use an interface makes godns fail.
Relevant configuration (json):
Using this code works however (standalone)
https://gist.github.com/schwarzeni/f25031a3123f895ff3785970921e962c