octodns / octodns-ns1

Ns1Provider provider for octoDNS
MIT License
4 stars 13 forks source link

KeyError: 'short_answers' - octodns-dump #57

Closed asinha3-chwy closed 10 months ago

asinha3-chwy commented 1 year ago
[8036670976] INFO  Manager dump: using custom YamlProvider
Traceback (most recent call last):
  File "../venv/bin/octodns-dump", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "../venv/lib/python3.11/site-packages/octodns/cmds/dump.py", line 48, in main
    manager.dump(
  File "../venv/lib/python3.11/site-packages/octodns/manager.py", line 805, in dump
    source.populate(zone, lenient=lenient)
  File "../venv/lib/python3.11/site-packages/octodns_ns1/__init__.py", line 905, in populate
    data = data_for(_type, record)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "../venv/lib/python3.11/site-packages/octodns_ns1/__init__.py", line 740, in _data_for_SPF
    values = [v.replace(';', '\\;') for v in record['short_answers']]
                                             ~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'short_answers'

Hello,

Getting KeyError when using octodns-dump to import records from NS1

Dependency Version
ns1-python 0.18.0
octodns 1.0.0rc0
octodns-ns1 0.0.4
ross commented 1 year ago

Hrm. Must be something non-standard/expected in the record that's tripping things up, or NS1 has changed something. It's likely going to require a bit of manual poking around to figure out what's up with the record.

Can you try adding the following around line 739 of ../venv/lib/python3.11/site-packages/octodns_ns1/__init__.py, just before the exception:

from pprint import pprint
pprint(record)

That dump of the record details (feel free to replace any sensitive names) should help to figure out what's up and what needs changed.

asinha3-chwy commented 1 year ago

This is what the short answer look like. Data is randomly generated

'short_answers': ['k=rsa; '
                   'p=crcv8e0nsqwghckdsqjimxse0557s4zv86i9y37m0jrof77czjoi4tsnf2q68ulnjz36gegabn4c5o9i5qqlnqfe3skrsahn9q1w1ropq0vh0pbx8y0qd03ucmwidn4uo4yn9bjqcf6yoyo69zo2i1bpfc6kfgvdsnkdzkoim3nyvu01dqolywethpp1wo429p0g70zg5n9ezzi1y8g234j1;']
ross commented 1 year ago

Hrm. Was that the last one printed right before the exception? Since that's a short_answers key and value I'm guessing it's not the one causing the exception. Sorry wasn't explicit about the last one part. Will also need the other data from the record dump as it may provide clues as to what's up.

github-actions[bot] commented 10 months ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.