question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DomainKey semicolon escaping

See original GitHub issue

I’m hitting an issue running octodns-sync (without --do-it FWIW) with it complaining about an unescaped semicolon when the semicolon is in-fact escaped.

Take a record that looks like this for foo.com:

mail._domainkey:
  ttl: 900
  type: TXT
  value: v=DKIM1\;p=iamakey

When attempting to use Route53 and NS1 as the providers (I didn’t test others), you get this nice error message:

Traceback (most recent call last):
  File "<path>/dns/env/bin/octodns-sync", line 11, in <module>
    load_entry_point('octodns', 'console_scripts', 'octodns-sync')()
  File "<path>/dns/env/src/octodns/octodns/cmds/sync.py", line 39, in main
    dry_run=not args.doit, force=args.force)
  File "<path>/dns/env/src/octodns/octodns/manager.py", line 235, in sync
    plans = [p for f in futures for p in f.result()]
  File "<path>/dns/env/lib/python2.7/site-packages/concurrent/futures/_base.py", line 422, in result
    return self.__get_result()
  File "<path>/dns/env/lib/python2.7/site-packages/concurrent/futures/_base.py", line 381, in __get_result
    raise exception_type, self._exception, self._traceback
Exception: Invalid record mail._domainkey.foo.com., unescaped ;

Am I doing something wrong here?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:24 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
rosscommented, Jun 26, 2017

It looks like this might be another semicolon escaping issue? The value shown in the Route53 console is unescaped, then it is escaped by OctoDNS when it is dumped via octodns-dump. An octodns-sync run that specifically targets route53 will show that there are no changes required, but one against nsone will show the above changes as being required.

Cool. That is the expected behavior. It’ll leave the Route53 record along, but if it were to change for any other reason in the future it would go ahead and escape the data sent up. Essentially it normalizes things if it’s otherwise going to touch them.

Going to call this closed, but feel free to open it back up if we run into further problems. This is definitely a confusing area. I’ve improved the error messages around validation in recent commits which will hopefully help a bit in the future.

1reaction
rosscommented, Jun 14, 2017

Just tried it without wrapping the value in " and a single \ worked. I guess i assumed the value needed to be wrapped.

Ah! That’s a yaml quoting thing. None of our values are quoted and I’d recommend avoiding them unless you’re doing things that require them. You are correct that if things are quoted with " yaml will turn \\ into \.

a and b are equivalent here:

foo:
  a: hello\; world
  b: "hello\\; world"
>>> s = "---\nfoo:\n  a: hello\; world\n  b: \"hello\\\\; world\""
>>> print(s)
---
foo:
  a: hello\; world
  b: "hello\\; world"
>>> d['foo']['a'] == d['foo']['b']
True
Read more comments on GitHub >

github_iconTop Results From Across the Web

DomainKey semicolon escaping · Issue #66 · octodns ... - GitHub
I'm hitting an issue running octodns-sync (without --do-it FWIW) with it complaining about an unescaped semicolon when the semicolon is in-fact ...
Read more >
Why do I need to escape ; with \ in a DNS DKIM record?
If you did not have a backslash, text from the semicolon to the end of the line would be ignored by the server....
Read more >
Issue adding Cloud DNS TXT records with semi-colons via ...
Hi: I have an issue: adding TXT records with gCloud which include semi-colons (as required to validate an Apps domain for DKIM) escapes...
Read more >
What's a DKIM Record? - DNSimple Help
DKIM stands for DomainKeys Identified Email. ... handled automatically by our name servers, and the semi-colons will automatically be escaped if necessary.
Read more >
Can't add DKIM TXT record | GoDaddy Community
Getting an error when attempting to add a DKIM record. Message says to contact support - of which there is no obvious mechanism...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found