Modify

Opened 3 years ago

Closed 3 years ago

#18411 closed defect (fixed)

DDNS script not working

Reported by: anonymous Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: packages Version: Trunk
Keywords: DDNS Cc:

Description

I'm using the latest DDNS scripts (2.1.0-2) and luci app-dns (git-14.328.38244-91532de-1) and it is not working, this is my log (i replaced the personal info with xxxx):

 161249       : ************ ************** ************** **************
 161249  note : PID '2437' started at 2014-11-26 16:12
 161249       : uci configuraion:
ddns.myddns_ipv4.domain=xxxx.no-ip.org
ddns.myddns_ipv4.enabled=1
ddns.myddns_ipv4.ip_interface=pppoe-wan
ddns.myddns_ipv4.ip_source=interface
ddns.myddns_ipv4.password=xxxx
ddns.myddns_ipv4.service_name=no-ip.com
ddns.myddns_ipv4.username=xxxx
ddns.myddns_ipv4=service
 161249       : verbose mode  : 0 - run normal, NO console output
 161250       : check interval: 600 seconds
 161250       : force interval: 259200 seconds
 161250       : retry interval: 60 seconds
 161250       : retry counter : 5 times
 161250       : No old process
 161250       : last update: never
 161250       : Waiting 10 seconds for interfaces to fully come up
 161324       : Detect registered/public IP
 161324       : #> /usr/bin/nslookup xxxx.no-ip.org  >/tmp/ddns_2437.dat 2>/tmp/ddns_2437.err
 161324       : Registered IP '127.0.0.1' detected
 161324  info : Starting main loop at 2014-11-26 16:13
 161324       : Detect local IP
 161324       : #> ifconfig pppoe-wan >/tmp/ddns_2437.dat 2>/tmp/ddns_2437.err
 161324       : Local IP '95.20.xx.xx' detected on interface 'pppoe-wan'
 161324       : Update needed - L: '95.20.xx.xx' <> R: '127.0.0.1'
 161324       : parsing script '/usr/lib/ddns/update_no-ip.sh'
 161324       : sending dummy IP to 'no-ip.com'
 161324       : #> /usr/bin/wget -q -O /tmp/ddns_2437.dat -Y off http://xxxx:xxxx@dynupdate.no-ip.com/nic/update?hostname=xxxx.no-ip.org&myip=127.0.0.1 2>/tmp/ddns_2437.err
 161325 ERROR : Busybox Wget Error: '1'
 161325       : 
 161325  WARN : Transfer failed - retry 1/5 in 60 seconds

Attachments (0)

Change History (9)

comment:1 Changed 3 years ago by chris5560

There is a wget communication error

try #> ping dynupdate.no-ip.com
try #> nslookup dynupdate.no-ip.com
try #> wget -O - http://checkip.dyndns.org

from console. Might be you get more information, where to search for the error.

comment:2 Changed 3 years ago by anonymous

wget is working fine if u run the command wget manually i dont get any error:

/usr/bin/wget -q -O /tmp/ddns_2437.dat -Y off http://xxxx:xxxx@dynupdate.no-ip.com/nic/update?hostname=xxxx.no-ip.org&myip=127.0.0.1 2>/tmp/ddns_2437.err

Also, why is it trying to update with the IP '127.0.0.1' but it detects the WAN IP correctly...

Here is the log from another instance:

173604       : ************ ************** ************** **************
 173604  note : PID '8307' started at 2014-11-26 17:36
 173604       : uci configuraion:
ddns.myddns_ipv4.domain=xxxx.no-ip.org
ddns.myddns_ipv4.enabled=1
ddns.myddns_ipv4.ip_interface=pppoe-wan
ddns.myddns_ipv4.ip_source=interface
ddns.myddns_ipv4.password=xxxx
ddns.myddns_ipv4.service_name=no-ip.com
ddns.myddns_ipv4.username=xxxx
ddns.myddns_ipv4=service
 173604       : verbose mode  : 0 - run normal, NO console output
 173605       : check interval: 600 seconds
 173605       : force interval: 259200 seconds
 173605       : retry interval: 60 seconds
 173605       : retry counter : 5 times
 173605       : No old process
 173605       : last update: never
 173605       : Waiting 10 seconds for interfaces to fully come up
 173615       : Detect registered/public IP
 173615       : #> /usr/bin/nslookup xxxx.no-ip.org  >/tmp/ddns_8307.dat 2>/tmp/ddns_8307.err
 173615       : Registered IP '95.20.xx.xx' detected
 173615  info : Starting main loop at 2014-11-26 17:36
 173615       : Detect local IP
 173615       : #> ifconfig pppoe-wan >/tmp/ddns_8307.dat 2>/tmp/ddns_8307.err
 173615       : Local IP '95.20.xx.xx' detected on interface 'pppoe-wan'
 173615       : Forced Update - L: '95.20.xx.xx' == R: '95.20.xx.xx'
 173615       : parsing script '/usr/lib/ddns/update_no-ip.sh'
 173615       : sending dummy IP to 'no-ip.com'
 173615       : #> /usr/bin/wget -q -O /tmp/ddns_8307.dat -Y off http://xxxx:xxxx@dynupdate.no-ip.com/nic/update?hostname=xxxx.no-ip.org&myip=127.0.0.1 2>/tmp/ddns_8307.err
 173616 ERROR : Busybox Wget Error: '1'
 173616       : 
 173616  WARN : Transfer failed - retry 1/5 in 60 seconds
 173716       : #> /usr/bin/wget -q -O /tmp/ddns_8307.dat -Y off http://xxxx:xxxx@dynupdate.no-ip.com/nic/update?hostname=xxxx.no-ip.org&myip=127.0.0.1 2>/tmp/ddns_8307.err
 173717 ERROR : Busybox Wget Error: '1'
 173717       : 
 173717  WARN : Transfer failed - retry 2/5 in 60 seconds
 173817       : #> /usr/bin/wget -q -O /tmp/ddns_8307.dat -Y off http://xxxx:xxxx@dynupdate.no-ip.com/nic/update?hostname=xxxx.no-ip.org&myip=127.0.0.1 2>/tmp/ddns_8307.err
 173818 ERROR : Busybox Wget Error: '1'

You can see

173615       : Local IP '95.20.xx.xx' detected on interface 'pppoe-wan'
173615       : Forced Update - L: '95.20.xx.xx' == R: '95.20.xx.xx'

So the IP is detected correctly but it tries to update with the IP 127.0.0.1 for some reason.

root@Principal:~# ping dynupdate.no-ip.com
PING dynupdate.no-ip.com (8.23.224.120): 56 data bytes
64 bytes from 8.23.224.120: seq=0 ttl=55 time=177.637 ms
64 bytes from 8.23.224.120: seq=1 ttl=55 time=177.546 ms
64 bytes from 8.23.224.120: seq=2 ttl=55 time=177.501 ms
64 bytes from 8.23.224.120: seq=3 ttl=55 time=177.526 ms
^C
--- dynupdate.no-ip.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 177.501/177.552/177.637 ms
root@Principal:~# nslookup dynupdate.no-ip.com
Server:    127.0.0.1
Address 1: 127.0.0.1 localhost

Name:      dynupdate.no-ip.com
Address 1: 8.23.224.120 dynupdate.no-ip.com
root@Principal:~# wget -O - http://checkip.dyndns.org
Connecting to checkip.dyndns.org (216.146.38.70:80)
<html><head><title>Current IP Check</title></head><body>Current IP Address: 95.20.228.74</body></html>
-                    100% |************************************************************************************************************************|   104   0:00:00 ETA

comment:3 Changed 3 years ago by chris5560

no-ip.com needs a special handling
have a look at https://forum.openwrt.org/viewtopic.php?id=29061

inside /usr/lib/dynamic_dns_functions.sh on line 689 do the following changes
OLD: _RUNPROG=$_PROG $_URL 2>$ERRFILE" # build final command
NEW: _RUNPROG="$_PROG $_URL" # build final command
!!! variables are with double "_". TRAC will otherwise underline the text!!!
will be fixed in next patch
busybox wget did not support to redirect stderr output (my fault)

It's recommended to use https: transport, because you are sending user and password
Install wget package and ca-certificates
and set option use_https '1'

P.S. what do you think about the luci-app-ddns ?

Last edited 3 years ago by chris5560 (previous) (diff)

comment:4 Changed 3 years ago by anonymous

Thanks!, after changing that line it is working fine now.

P.S: I like the new look for the luci-app-ddns, it also makes it a lot easier to check if the DDNS process is running (like showing the PID) together with the start/stop button.

comment:5 Changed 3 years ago by anonymous

other anon here, @chris, anything new about 2.1.0-3 (or newer?) Im still waiting for retry_count = 0 implementation. also will you include duckdns into list of presupported? thanks

comment:6 Changed 3 years ago by Sascha Zorn

Hi Chris,

I've just stumbled across the same issue. Actually its not wget's fault! You actually using ash wrong.

If $VAR contains "echo test >/tmp/test", echo will be called with "test >/tmp/test" as argument! What you are looking for is "eval $VAR" which will interpret the > as redirect!

So actually the error is in line 700:
$__RUNPROG # DO transfer

which must be:
eval $__RUNPROG # DO transfer

This fixes the error for me, while still having a working redirect of errors.

Best regrads,
Sascha

comment:7 Changed 3 years ago by chris5560

Thanks Sascha,

if using eval (good idea( it's nessessary to put single quotes ' around $__URL
at the lines 640, 674 and 689 so they look like:
__RUNPROG="$__PROG '$__URL'" # build final command
because otherwise eval will think the "&" inside update url will be the "go to background" command.

I will put the changes into next patch of ddns-scripts.

Christian

comment:8 Changed 3 years ago by ambrosa

NO-IP.COM same problem here.

Changing

inside /usr/lib/dynamic_dns_functions.sh on line 689 do the following changes
OLD: _RUNPROG=$_PROG $_URL 2>$ERRFILE" # build final command
NEW: _RUNPROG="$_PROG $_URL" # build final command

works fine ! Problem solved

Thanks

comment:9 Changed 3 years ago by nbd

  • Resolution set to fixed
  • Status changed from new to closed

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.