Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On deploy_challenge "IndexError: list index out of range" #28

Open
aijanai opened this issue Jan 2, 2017 · 12 comments
Open

On deploy_challenge "IndexError: list index out of range" #28

aijanai opened this issue Jan 2, 2017 · 12 comments

Comments

@aijanai
Copy link

aijanai commented Jan 2, 2017

When I try to renew a certificate, the following happens:

Processing vpn.staging-wanderio.com

  • Checking domain name(s) of existing cert... unchanged.
  • Checking expire date of existing cert...
  • Valid till Jan 10 15:19:00 2017 GMT (Less than 30 days). Renewing!
  • Signing domains...
  • Generating private key...
  • Generating signing request...
  • Requesting challenge for vpn.staging-wanderio.com...
  • CloudFlare hook executing: deploy_challenge
    Traceback (most recent call last):
    File "cloudflare_hook/hook.py", line 196, in
    main(sys.argv[1:])
    File "cloudflare_hook/hook.py", line 192, in main
    opsargv[0]
    File "cloudflare_hook/hook.py", line 165, in create_all_txt_records
    create_txt_record(args[i:i+X])
    File "cloudflare_hook/hook.py", line 103, in create_txt_record
    zone_id = _get_zone_id(domain)
    File "cloudflare_hook/hook.py", line 81, in _get_zone_id
    return r.json()['result'][0]['id']
    IndexError: list index out of range

This has worked in the past, but all of a sudden in broke (a change in CF API?).

CF_EMAIL and CF_KEY are exported in the environment in which the script runs

@aijanai
Copy link
Author

aijanai commented Jan 2, 2017

Ok, after manually replaying the request with PostMan I got it: the domain was actually not in CloudFlare, but still on Route53.
Maybe a more detailed error handling message would help.

@kappataumu
Copy link
Owner

Agreed, I'll push an update in the coming days.

@niieani
Copy link

niieani commented Nov 1, 2017

Yup, encountered the same bug, was scratching my head for a better while.

@gwillem
Copy link

gwillem commented Oct 30, 2018

  File "hooks/cloudflare/hook.py", line 84, in _get_zone_id
    return r.json()['result'][0]['id']
IndexError: list index out of range

Same. Resulting json from CF is:

{
  "messages": [],
  "result_info": {
    "page": 1,
    "count": 0,
    "per_page": 20,
    "total_pages": 0,
    "total_count": 0
  },
  "errors": [],
  "success": true,
  "result": []
}

@aijanai
Copy link
Author

aijanai commented Oct 30, 2018

Is this still an unaddressed issue @kappataumu ?

@13223qweesadk
Copy link

Ran into this issue on Ubuntu 18.04.
Installing python 2 requirements resolved it for me even though the system uses python2 and 3 (and I think requirements.txt downgraded two python packages).

@thoraxe
Copy link

thoraxe commented Apr 7, 2019

Appears to be related to #53

@thoraxe
Copy link

thoraxe commented Apr 7, 2019

Looks like cloudflare deleted my site :(

@sonywork
Copy link

sonywork commented Apr 8, 2019

Because the get_tld changed:

tld = get_tld('http://' + domain)

res = get_tld('http://' + domain, as_object=True)
sub_domain, tld = res.subdomain, res.fld

@dynek
Copy link

dynek commented Apr 8, 2019

I have the same problem and I confirm that what @kuleyang says is correct. It fixes the problem.
Thanks!

@YasharF
Copy link

YasharF commented May 18, 2019

Try https://github.com/SeattleDevs/letsencrypt-cloudflare-hook to see if that has resolved an issue. That fork is actively maintained and PRs are welcome.

@rafiks
Copy link

rafiks commented May 19, 2019

Try https://github.com/walcony/letsencrypt-cloudflare-hook to see if that has resolved an issue. That fork is actively maintained and PRs are welcome.

this other fork works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants