octodns / octodns-cloudflare

Cloudflare DNS provider for octoDNS
MIT License
24 stars 18 forks source link

DNS Validation Error #109

Closed troykelly closed 1 month ago

troykelly commented 1 month ago

When trying to sync with cloudflare, I'm getting the below error.

It was caused by a record with two periods in it generated (in error) by our scripts somehow. For example:

server123.sydney.world..sydney.world:
- ttl: 300
  type: A
  value: 192.88.99.1

I'm logging the issue because I guess this could/should be caught by validation, rather than the error coming back from the cloudflare API without context or specificity as to what caused the issue.

Traceback (most recent call last):
  File "/home/vscode/.local/bin/octodns-sync", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/octodns/cmds/sync.py", line 62, in main
    manager.sync(
  File "/home/vscode/.local/lib/python3.11/site-packages/octodns/manager.py", line 856, in sync
    total_changes += target.apply(plan)
                     ^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/octodns/provider/base.py", line 298, in apply
    self._apply(plan)
  File "/home/vscode/.local/lib/python3.11/site-packages/octodns_cloudflare/__init__.py", line 1129, in _apply
    getattr(self, f'_apply_{class_name}')(change)
  File "/home/vscode/.local/lib/python3.11/site-packages/octodns_cloudflare/__init__.py", line 942, in _apply_Create
    self._try_request('POST', path, data=content)
  File "/home/vscode/.local/lib/python3.11/site-packages/octodns_cloudflare/__init__.py", line 131, in _try_request
    return self._request(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/octodns_cloudflare/__init__.py", line 154, in _request
    raise CloudflareError(resp.json())
octodns_cloudflare.CloudflareError: DNS Validation Error
ross commented 1 month ago

Seems like a reasonable thing to have a validation for. You want to give it a go or should I add it to the TODO list?