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.

HTTPError: 400 Client Error: Bad Request for url: https://api.cloudflare.com/client/v4/zones

See original GitHub issue

I’m configuring dehydrated with CloudFlare but getting following error. I would be very happy if anyone can quick help.

ENV- Python-3.5

+ CloudFlare hook executing: deploy_challenge

Traceback (most recent call last):
 File "/opt/dehydrated/hooks/cloudflare/hook.py", line 206, in <module>
   main(sys.argv[1:])
 File "/opt/dehydrated/hooks/cloudflare/hook.py", line 203, in main
   ops[argv[0]](argv[1:])
 File "/opt/dehydrated/hooks/cloudflare/hook.py", line 167, in create_all_txt_records
   create_txt_record(args[i:i+X])
 File "/opt/dehydrated/hooks/cloudflare/hook.py", line 105, in create_txt_record
   zone_id = _get_zone_id(domain)
 File "/opt/dehydrated/hooks/cloudflare/hook.py", line 82, in _get_zone_id
   r.raise_for_status()
 File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status
   raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.cloudflare.com/client/v4/zones?name=space

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
JohnVillalovoscommented, Nov 16, 2019

The fix for this is to do this.

Change https://github.com/kappataumu/letsencrypt-cloudflare-hook/blob/master/hook.py#L21

To: import tld

And change: https://github.com/kappataumu/letsencrypt-cloudflare-hook/blob/master/hook.py#L79

To: tld = tld.get_fld('http://' + domain)

0reactions
prashntscommented, Jun 4, 2020

Thanks @YasharF for that! It is working fine for me without any changes (just swapped old version with yours).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cloudflare API returns error 400 Bad Request
Hey everyone, I am using the cloudflare API in a nodeJS app I am ... await axios .post( 'https://api.cloudflare.com/client/v4/zones', ...
Read more >
Issues - GitHub
400 Client Error : Bad Request for url: https://api.cloudflare.com/client/v4/zones/... #23. 3dluvr opened this issue on Oct 11 ...
Read more >
Cloudflare API returns error 400 Bad Request - Stack Overflow
I was running into a similar issue with Cloudflare using PHP/cURL to perform a PUT request. I was using: curl_setopt($ch, CURLOPT_PUT, true);.
Read more >
400 Bad Request Error: What It Is and How to Fix It
The 400 Bad Request Error is an HTTP response status code indicating that the server was unable to process the request sent by...
Read more >
Cloudflare API Error: Exceeded 30 tag limit per API request
... error: `DELETE https://api.cloudflare.com/client/v4/zones/1ac7a798951d625d26eb2b4f4c607978/purge_cache` resulted in a `400 Bad Request` ...
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