lexicon icon indicating copy to clipboard operation
lexicon copied to clipboard

NameCheap Create Error

Open laserjet25 opened this issue 2 years ago • 3 comments

When trying to add a TXT record to the NameCheap sandbox I receive the following error:

Remote: 3 To set: 4 Traceback (most recent call last): File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Python310\Scripts\lexicon.exe\__main__.py", line 7, in <module> File "C:\Python310\lib\site-packages\lexicon\cli.py", line 131, in main results = client.execute() File "C:\Python310\lib\site-packages\lexicon\client.py", line 90, in execute return self.provider.create_record(record_type, name, content) File "C:\Python310\lib\site-packages\lexicon\providers\base.py", line 79, in create_record return self._create_record(rtype, name, content) File "C:\Python310\lib\site-packages\lexicon\providers\namecheap.py", line 207, in _create_record self.client.domains_dns_add_host(self.domain, record) File "C:\Python310\lib\site-packages\lexicon\providers\namecheap.py", line 423, in domains_dns_add_host self.call("namecheap.domains.dns.setHosts", extra_payload) File "C:\Python310\lib\site-packages\lexicon\providers\namecheap.py", line 354, in call xml = self._fetch_xml(payload, extra_payload) File "C:\Python310\lib\site-packages\lexicon\providers\namecheap.py", line 390, in _fetch_xml raise _ApiError(0, "Unknown exception") lexicon.providers.namecheap._ApiError: 0 - Unknown exception

This is the command I ran: lexicon namecheap create mydomain.com TXT --name Test2 --content ITWORKS --auth-token MyToken --auth-username MyUsername --auth-client-ip WhitelistedIP --auth-sandbox

laserjet25 avatar Jul 01 '22 02:07 laserjet25

@laserjet25 - did you ever figure this out? @AnalogJ - any ideas?

kaysond avatar Sep 30 '23 21:09 kaysond

Wow, its already been a year.... I haven't tried this again since but had no luck in getting this to work with Namecheap. I'll probably try again sometime this week and see if it magically got fixed.

laserjet25 avatar Sep 30 '23 23:09 laserjet25

@laserjet25 so it turns out there's a bug in the code for reporting errors. If you fix the code as in https://github.com/AnalogJ/lexicon/pull/1743 (you can edit the file path mentioned in your stack trace), you should be able to see the real error.

In my case it was:

lexicon._private.providers.namecheap._ApiError: 2030288 - Cannot complete this command as this domain is not using proper DNS servers

kaysond avatar Oct 01 '23 02:10 kaysond