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.

Does lexicon support update? I am trying to update DKIM value but getting requests.exceptions.HTTPError: 404 Client Error: Not Found.

See original GitHub issue

_I wanted to update the existing value of DKIM using a lexicon. But using lexicon update is not working for me. Can you help me with this? Below is the command I am using to update DKIM value.

lexicon Command :-

lexicon digitalocean update sampledomain.com TXT --name='pepi._domainkey.sampledomain.com' --content='k=rsa;
p=AAAAAAAAAAAAAAAAAMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLMMExLiGRqzJkNdNIjUnLX7JL0wjbwwENDoXgJIBisIsrofLPetZM401dioNU8k/Qp6nIyi5oioyZh+1jDXoCPFa4nLGRNj3Nz785N7b76aTtHmy2wTgR2LFS/Yw5/iyzhyrWsIyINyyHs77EoCwSOQjJfhFxb6SmifLN51IIvwIDAQAB'

Below is the output getting after executing the above command. Traceback (most recent call last): File "/usr/bin/lexicon", line 9, in <module> load_entry_point('dns-lexicon==2.7.9', 'console_scripts', 'lexicon')() File "/usr/lib/python2.7/site-packages/lexicon/__main__.py", line 136, in main results = client.execute() File "/usr/lib/python2.7/site-packages/lexicon/client.py", line 47, in execute return self.provider.update_record(self.options.get('identifier'), self.options.get('type'), self.options.get('name'), self.options.get('content')) File "/usr/lib/python2.7/site-packages/lexicon/providers/digitalocean.py", line 94, in update_record payload = self._put('/domains/{0}/records/{1}'.format(self.domain_id, identifier), data) File "/usr/lib/python2.7/site-packages/lexicon/providers/base.py", line 79, in _put return self._request('PUT', url, data=data, query_params=query_params) File "/usr/lib/python2.7/site-packages/lexicon/providers/digitalocean.py", line 136, in _request r.raise_for_status() # if the request fails for any reason, throw an error. File "/usr/lib/python2.7/site-packages/requests/models.py", line 834, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found

I have exported all required parameters and working fine with the list and create commands but not with update one.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
adferrandcommented, Nov 27, 2018

I am saying that because there is two way to update a record: by unique identifier or by matching the given type and name.

But for the latter case, there is a flaw, because several records could match a given type and name. Indeed most of the time, you can insert multiple TXT for a given name.

And if multiple matches are found, some providers will update the first match, other will not update anything, other will throw errors because they do not handle such a case. Cloudflare provider could fall in the second or third category.

1reaction
adferrandcommented, Nov 27, 2018

OK, you have another approach. First, use:

lexicon digitalocean list sampledomain.com TXT --name='pepi._domainkey.sampledomain.com'

That will return a json containing your record, and in particular an identifier field.

Then run:

lexicon digitalocean update sampledomain.com TXT --identifier='IDENTIFIER' --content='k=rsa; p=AAAAAAAAAAAAAAAAAMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLMMExLiGRqzJkNdNIjUnLX7JL0wjbwwENDoXgJIBisIsrofLPetZM401dioNU8k/Qp6nIyi5oioyZh+1jDXoCPFa4nLGRNj3Nz785N7b76aTtHmy2wTgR2LFS/Yw5/iyzhyrWsIyINyyHs77EoCwSOQjJfhFxb6SmifLN51IIvwIDAQAB'

With IDENTIFIER the identifier value you got from the list action.

All of this suppose that you have set correctly the environment variables or the cli arguments to provide the authentification parameters required to access your account, but if you have already managed to use list and create, it is already the case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix “No DKIM record found” ? - PowerDMARC
When you receive a “No DKIM record found” message it simply implies that your domain is not configured with DKIM email authentication ......
Read more >
Turn on DKIM for your domain - Google Workspace Admin Help
Follow the steps in this article to get your DomainKeys Identified Mail (DKIM) key, add the key to your domain provider, and turn...
Read more >
DKIM authentication troubleshooting - Campaign Monitor
Below we've listed the most common issues people have when trying to set up DKIM authentication. While sending from a DKIM authenticated domain...
Read more >
How to set up DKIM and Return-Path - Support : Judge.me
After adding your sender email, you'll see the hostname and values for DKIM and Return-Path. Copy and paste these values and add them...
Read more >
How to use DKIM for email in your custom domain - Office 365
This article lists the steps to use DomainKeys Identified Mail (DKIM) with Microsoft 365 to ensure that destination email systems trust messages ...
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