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

ddclient always tries to update even when there's been no change in IP #544

Closed
Tracked by #3
GrantEdwards opened this issue Jun 3, 2023 · 8 comments
Closed
Tracked by #3

Comments

@GrantEdwards
Copy link

How do I get ddclient 3.10 to only update when the IP address changes?

It always tries to update, almost always get's a "nochg" response from api.dynu.org.

The cache file updates every time and seems to indicate that everything's OK:

## ddclient-3.10.0
## last updated at Sat Jun  3 08:34:49 2023 (1685799289)
atime=0,backupmx=0,custom=0,host=xxxxxxxxxxxxxxxxxx.mywire.org,ip=aa.b..cc.dd,mtime=1685799193,mx=,script=/nic/update,static=0,status=good,status-ipv4=noconnect,status-ipv6=noconnect,warned-min-error-interval=1685799289,warned-min-interval=0,wildcard=0,wtime=30 grantstreet.mywire.org

But the next time it runs it will say that the last update failed, try to do an update, and receive a 'nochg' response again.

Is a 'nochg' response considered a failure?

@SuperSandro2000
Copy link
Member

The cache is known to be broken but there is no capacity to fix it. There are other issues about this.

@SuperSandro2000 SuperSandro2000 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2023
@fabian727
Copy link

fabian727 commented Jun 14, 2023

so it seems here was the same problem?
https://askubuntu.com/questions/317662/ddclient-updates-every-time-and-logs-nochg-no-update-required

I have the same problem. (started with upgrading debian from 11.7 to 12)

Running "sudo rm /var/cache/ddclient/ddclient.cache" and service restart does fix it? What's the current workaround?

Edit: because of this problem, my provider blocked me and everything connected is offline. If this service is not running perfectly well (which it did the last years; thanks for your effort), I currently don't know what to do.

@SuperSandro2000
Copy link
Member

so it seems here was the same problem?

that issue is way older. The cache on 3.10.0 is somewhat broken and I am currently do not have time allocated to fix that.

@fabian727
Copy link

fabian727 commented Jun 17, 2023

2023-06-17T16:05:44.764359+02:00 surfer ddclient[1166711]: FAILED:   updating mydomain.de: unexpected status (14)
2023-06-17T16:05:44.768002+02:00 surfer ddclient[1166711]: WARNING:  updating : nochg: No update required; unnecessary attempts to change to the current address are considered abusive
2023-06-17T16:05:44.771118+02:00 surfer ddclient[1166711]: FAILED:   updating : unexpected status (0)
2023-06-17T16:05:44.774015+02:00 surfer ddclient[1166711]: FAILED:    was not updated because protocol <undefined> is not supported.

That's what I get every time ddclient is running. It seems to work though. My domain address is updated and can be reached. But my provider blocks me, as to many requests (nochg) are running. (I call ddclient all 5 minutes

My cache looks like:

`

ddclient-3.10.0

last updated at Sat Jun 17 16:10:44 2023 (1687011044)

atime=1687011044,backupmx=0,custom=0,host=mydomain1.de,mtime=0,mx=,script=/nic/update,static=0,status=14,status-ipv4=noconnect,status-ipv6=noconnect,warned-min-error-interval=0,warned-min-interval=0,wildcard=0,wtime=0 mydomain1.de
atime=0,backupmx=0,custom=0,host=mydomain2.de,ip=000.000.000.000,mtime=1687010442,mx=,script=/nic/update,static=0,status=good,status-ipv4=noconnect,status-ipv6=noconnect,warned-min-error-interval=0,warned-min-interval=0,wildcard=0,wtime=30 mydomain2.de
`

so it is updated, deleting it does not help. Only second domain has an (correct) ip address

@fade2gray
Copy link

Strange.

Capture2

@drodriguez-dev
Copy link

TL;DR: In ddclient-3.11.1 I still had this problem using protocol=dyndns2. This is a patch which solved the issue for me:
ddclient.in.patch.

Hello,

I also had this problem that every time the daemon was executed, the request was made to change the URL in the DDNS. It seems that the program checks the previous IP from the cache using the ip variable instead of ipv4. On the other hand, it never writes the ip variable in the cache. This causes it to not validate the previous IP and forces the update in the DDNS on each run. After reviewing the code and a lot of trial an error, I've realized that creating the variable ip in the cache stops the update on each run. Then the solution (for me) was to store the current IP on the variable ip in the cache (only in sub nic_dyndns2_update).

Log (before)

WARNING:  updating xxx.yyy.zzz: nochg: No update required; unnecessary attempts to change to the current address are considered abusive

Log (after)

SUCCESS:  xxx.yyy.zzz: skipped: IP address was already set to 1.2.3.4.

Config

...
use=web, web=checkip.dynu.com/, web-skip='IP Address'
server=api.dynu.com
protocol=dyndns2
login=username
password='password'
xxx.yyy.zzz

Cache

atime=0,backupmx=0,custom=0,host=xxx.yyy.zzz,ip=1.2.3.4,ipv4=1.2.3.4,mtime=1700401014,mx=,script=/nic/update,static=0,status=good,status-ipv4=good,status-ipv6=noconnect,warned-min-error-interval=0,warned-min-interval=0,wildcard=0,wtime=30 xxx.yyy.zzz

Hope it helps.

(Not a perl programmer, this is not the best solution but I don't know how to find where is the root of the problem)

@protist
Copy link

protist commented Nov 20, 2023

Thanks @drodriguez-dev. I am also using protocol=dyndns2, and I can confirm that I get the same warnings every 5 minutes (which is how frequently the daemon rechecks).

WARNING:  updating foo.dynu.com: nochg: No update required; unnecessary attempts to change to the current address are considered abusive

Your patch prevents these warnings. FWIW there is nothing in my log after patching and restarting, i.e. I don't get the skipped line that you report. I'm not sure why.

@drodriguez-dev
Copy link

Glad it helped.

FWIW there is nothing in my log after patching and restarting, i.e. I don't get the skipped line that you report. I'm not sure why.

Yes, the skipped message is only shown when logs are configured when VERBOSE=1. However, you should see when the IP is changed, I think.

SUCCESS:  updating xxx.yyy.zzz: good: IPv4 address set to 1.2.3.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants