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

Not working with newly created records #6

Closed
maicol07 opened this issue Apr 19, 2021 · 7 comments
Closed

Not working with newly created records #6

maicol07 opened this issue Apr 19, 2021 · 7 comments
Milestone

Comments

@maicol07
Copy link

maicol07 commented Apr 19, 2021

It seems that records deleted and then recreated with the same name are not working with cloudflare-dyndns:

@kissgyorgy
Copy link
Owner

kissgyorgy commented Apr 19, 2021

It's because I save the zone record ID in the cache, so when you delete and recreate the same record, it will have a different record ID in Cloudflare database, so the one in the cache will not exist anymore.

As a workaround, you can delete the cache before running, or use the --force flag which will delete it automatically.

As a fix in code, it should be checked if the cached zone record still exists.

@maicol07
Copy link
Author

maicol07 commented Apr 19, 2021

How can I check if the cached zone record exists? Do I have to check in the cache file?
I've also noticed there is a small typo in the cache path (note from the image above: /.cache/cloudflare-dynds/...)

@kissgyorgy
Copy link
Owner

It's not really important to check the cache file, it's only for making things faster and not having to hit the Cloudflare API when IP didn't change, but you can delete it any time, and it will set the records, no problem.

I never noticed the typo, thanks! 😄

@kissgyorgy
Copy link
Owner

How can I check if the cached zone record exists? Do I have to check in the cache file?

Oh, we misunderstood each other, for you, the only thing to do is to delete the cache file and run the script again.

For me, it's to catch this error and handle it in code.

@kissgyorgy
Copy link
Owner

Hey, I was thinking about this, and you are not supposed to change manually and use dyndns at the same time, because that will lead all kinds of conflicts and problems like this. You either should give it exclusive access, or update the records manually.

I'm thinking about changing the error message or just a warning about this in the README.
I don't really want to overwrite manually created records without notice.

What's your use-case?

@maicol07
Copy link
Author

No use-case. That was only a test. I had changed manually the record to test a CDN service. Then I've switched back to the original one

@kissgyorgy
Copy link
Owner

kissgyorgy commented Apr 28, 2021

Thanks, I will definitely document this, not sure about the proper fix. I mean, I know how to fix this, but should I? Might be a good precaution to not update manually changed records.

@kissgyorgy kissgyorgy added this to the 4.0 milestone Apr 28, 2021
@kissgyorgy kissgyorgy reopened this May 22, 2021
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

2 participants