Namecheap API key not working
-
I was having issues with cloudron creating new domains via the namecheap api so I figured I would try changing the API key and resetting the key for all of my domains. Turns out this was a bad idea because I hit this 400 error when trying to save the new key:
Has anyone else encountered this? For further context I have changed my IP recently, but I made sure to update my whitelisted IP on namecheap and change all of my records for my domains.
-
@atrilahiji reset the API Key? Maybe it's tied to the prior whitelist?
-
@marcusquinn The API key should work with my current whitelist. Just went through and removed the IP from the whitelist, disabled API access, re-enabled it, added my IP, and generated a new key. Same issue.
-
@atrilahiji I think the issue is something else (not cloudron related). It says "API Key is invalid or API access has not been enabled").
Try running a simple curl command like this on the server or your laptop:
curl 'https://api.namecheap.com/xml.response?ApiUser=cloudron&ApiKey=your_api_key&UserName=cloudron&Command=namecheap.domains.getList&ClientIp=1.2.3.4'
You have to substitute ApiUser and UserName with your namecheap username. Client IP is your laptop's IP or the Cloudron IP (depending on where you run the above command). What do you get?
I get something like:
<?xml version="1.0" encoding="utf-8"?> <ApiResponse Status="OK" xmlns="http://api.namecheap.com/xml.response"> <Errors /> <Warnings /> <RequestedCommand>namecheap.domains.getlist</RequestedCommand> <CommandResponse Type="namecheap.domains.getList"> <DomainGetListResult> ... </DomainGetListResult> <Paging> <TotalItems>1</TotalItems> <CurrentPage>1</CurrentPage> <PageSize>20</PageSize> </Paging> </CommandResponse> <Server>PHX01APIEXT03</Server> <GMTTimeDifference>--5:00</GMTTimeDifference> <ExecutionTime>0.082</ExecutionTime> </ApiResponse>
-
I had this issue once, double check if there is a space at the end or front.
-
@girish That works. Still having issues in the UI though.
And also, looks like I can add new domains. I only get this error updating existing domains. Trouble is, I have emails with important info on these domains so I can't remove the domains and re-add them.
-
@atrilahiji That is strange then, can you enable SSH and send a mail to support@cloudron.io ? I can take a look.
-
@girish Sent. Just to let you know (its in the email) but I changed my main domain to the domain I was able to add as a test, but now I get the same error when trying to change my main domain back to lahijiapps.dev.
I suspect this has quite a bit to do with my IP changing when we got a new router.
-
@atrilahiji What I found is that the curl call fails most of the time but works now and then.
<?xml version="1.0" encoding="utf-8" ?> <ApiResponse Status="ERROR"> <Errors> <Error Number="500000">Too many requests</Error> </Errors> <Server/> <GMTTimeDifference/> <ExecutionTime>0</ExecutionTime> </ApiResponse>
Searching for above I see https://whmcs.community/topic/303288-namecheap-domain-sync-error-too-many-requests/ and https://github.com/adamdecaf/terraform-provider-namecheap/issues/9
-
@atrilahiji Yes, correct. The DNS calls are failing . I think as a first step, change the keys to the new key (just give 10 mins between updating each domain, it seems to work). After you have switched them over, then change the dashboard domain. It should work.
Also, per https://www.namecheap.com/support/knowledgebase/article.aspx/9739/63/api--faq#z, it seems
"Our general API calls restriction is 20/min, 700/hour and 8000/day across the whole key."
I don't think we make 20 per min, maybe something on their side is enforcing limits wrongly?
-
This can be resolved. Thanks for the help @girish!
-
@atrilahiji said in Namecheap API key not working:
@girish Lol they just said "fuck it" and doubled my quota. Testing it out.
Classic namecheap support
-
@brutalbirdie Yeah, I tried their Ghost hosting once, until I found how far behind their version updating lagged, which led me to discover Cloudron