K0p1-Git / cloudflare-ddns-updater

Dynamic DNS (DDNS) service based on Cloudflare! Access your home network remotely via a custom domain name without a static IP! Written in pure BASH~
MIT License
1.33k stars 370 forks source link

TTL must be a number #95

Closed egpgit closed 3 weeks ago

egpgit commented 1 month ago

Hi, In the first place, I would like to give you tanks for your script.

I have been using it for months but now I get an error: {"result":null,"success":false,"errors":[{"code":9022,"message":"TTL must be a number, not a string."}],"messages":[]}

I have updated de script with your last version that changes 2 lines (record_identifier line and --data line) but the error continues. Could you told me what I am doing wrong?

I have realized that your last version changes the part of "--data" line in this way: :\"$ttl\",\"proxied\":${proxy}}") for :$ttl,\"proxied\":${proxy}}") so ttl isn't a string its a number, isn't?

I have the line: ttl="3600" # Set the DNS TTL (seconds) I changed it for: ttl=3600 # Set the DNS TTL (seconds)

same result

And I tried also change --data line deleting the var and putting the number with: --data "{\"type\":\"A\",\"name\":\"$record_name\",\"content\":\"$ip\",\"ttl\":3600,\"proxied\":${proxy}}")

same result: {"result":null,"success":false,"errors":[{"code":9022,"message":"TTL must be a number, not a string."}],"messages":[]}

Sorry for my poor english.

egpgit commented 1 month ago

Sorry It works now, I had done a backup of the file and I had executing the unchanged one.... Your code is perfect.

flooxo commented 3 weeks ago

Same here

<13>Aug 13 15:06:45 root: DDNS Updater: <ip> <name> DDNS failed for <proxy (ip)>. DUMPING RESULTS:
<13>Aug 13 15:06:45 root: {"result":null,"success":false,"errors":[{"code":9022,"message":"TTL must be a number, not a string."}],"messages":[]}

How to fix this? changing TTL="300" to TTL=300 does not help

KammerlanderMario commented 3 weeks ago

Hey @flooxo , you have to take the updated script. With git pull you can pull the new template and then use that template. I guess there is somewhere a declare in the script that changing the type in the head doesn't fix the problem.

K0p1-Git commented 3 weeks ago

see https://github.com/K0p1-Git/cloudflare-ddns-updater/pull/85