nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

cloudflare dns failes due to missing (yet installed) cloudflare pip package/module

Open zaourzag opened this issue 1 year ago • 31 comments
trafficstars

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug since today, the cloudflare dns provider fails to work. certbot is unable to find the CloudFlare module causing it to fail. relevant error code:

Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /tmp/certbot-log-mk3d3cri/log or re-run Certbot with -v for more details.
The 'certbot_dns_cloudflare._internal.dns_cloudflare' plugin errored while loading: No module named 'CloudFlare'. You may need to remove or update this plugin. The Certbot log will contain the full error details and this should be reported to the plugin developer.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /tmp/certbot-log-7a7w849t/log or re-run Certbot with -v for more details.
ERROR: Could not find a version that satisfies the requirement acme== (from versions: 0.0.0.dev20151006, 0.0.0.dev20151008, 0.0.0.dev20151017, 0.0.0.dev20151020, 0.0.0.dev20151021, 0.0.0.dev20151024, 0.0.0.dev20151030, 0.0.0.dev20151104, 0.0.0.dev20151107, 0.0.0.dev20151108, 0.0.0.dev20151114, 0.0.0.dev20151123, 0.0.0.dev20151201, 0.1.0, 0.1.1, 0.2.0, 0.3.0, 0.4.0, 0.4.1, 0.4.2, 0.5.0, 0.6.0, 0.7.0, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.10.0, 0.10.1, 0.10.2, 0.11.0, 0.11.1, 0.12.0, 0.13.0, 0.14.0, 0.14.1, 0.14.2, 0.15.0, 0.16.0, 0.17.0, 0.18.0, 0.18.1, 0.18.2, 0.19.0, 0.20.0, 0.21.0, 0.21.1, 0.22.0, 0.22.1, 0.22.2, 0.23.0, 0.24.0, 0.25.0, 0.25.1, 0.26.0, 0.26.1, 0.27.0, 0.27.1, 0.28.0, 0.29.0, 0.29.1, 0.30.0, 0.30.1, 0.30.2, 0.31.0, 0.32.0, 0.33.0, 0.33.1, 0.34.0, 0.34.1, 0.34.2, 0.35.0, 0.35.1, 0.36.0, 0.37.0, 0.37.1, 0.37.2, 0.38.0, 0.39.0, 0.40.0, 0.40.1, 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0, 1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.14.0, 1.15.0, 1.16.0, 1.17.0, 1.18.0, 1.19.0, 1.20.0, 1.21.0, 1.22.0, 1.23.0, 1.24.0, 1.25.0, 1.26.0, 1.27.0, 1.28.0, 1.29.0, 1.30.0, 1.31.0, 1.32.0, 2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.4.0, 2.5.0, 2.6.0, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0, 2.9.0, 2.10.0, 2.11.0)
ERROR: No matching distribution found for acme==

[notice] A new release of pip is available: 24.0 -> 24.1
[notice] To update, run: pip install --upgrade pip

    at /app/lib/utils.js:16:13
    at ChildProcess.exithandler (node:child_process:430:5)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)

before this i had been using the dns provider with no issues Nginx Proxy Manager Version v2.11.2

To Reproduce Steps to reproduce the behavior: generate a new ssl certificate using the cloudflare dns provider

Expected behavior a certificate gets generated

Screenshots image

Operating System ubuntu 22.04

zaourzag avatar Jun 25 '24 04:06 zaourzag

Same here. Seems rolling back to 2.11.1 doesn't seem to fix it either.

LandonPatmore avatar Jun 25 '24 04:06 LandonPatmore

neither does deleting the local image and restarting it. I have made certs using cloudflare on this yesterday

zaourzag avatar Jun 25 '24 04:06 zaourzag

I wonder if wiping the local storage may fix it? I didn't try that yet.

LandonPatmore avatar Jun 25 '24 04:06 LandonPatmore

That didn't work either on 2.11.1.

LandonPatmore avatar Jun 25 '24 04:06 LandonPatmore

Got a slightly different error:

The 'certbot_dns_cloudflare._internal.dns_cloudflare' plugin errored while loading: No module named 'CloudFlare'. You may need to remove or update this plugin. The Certbot log will contain the full error details and this should be reported to the plugin developer.

with no mention of acme==.

LandonPatmore avatar Jun 25 '24 04:06 LandonPatmore

Same here. I'm trying with 2.11.x, 2.10.x and 2.9.x and it doesn't work either.

ajunior84 avatar Jun 25 '24 04:06 ajunior84

Got it to work! Using 2.11.1 (may work on latest, but I rolled back to 2.11.1 and it works).

Follow these steps:

  1. docker exec -it <name of container> /bin/bash
  2. Run certbot and see it errors out saying that cloudflare-dns plugin is causing an issue (this is to confirm you have the issue I was seeing that was fixed by this method)
  3. pip uninstall certbot-dns-cloudflare
  4. Run certbot and see it does not error out
  5. pip install certbot-dns-cloudflare
  6. Run certbot and see it does not error out
  7. Try creating a SSL cert and it should work

LandonPatmore avatar Jun 25 '24 04:06 LandonPatmore

ill give that a try!

zaourzag avatar Jun 25 '24 05:06 zaourzag

Got it to work! Using 2.11.1 (may work on latest, but I rolled back to 2.11.1 and it works).

Follow these steps:

  1. docker exec -it <name of container> /bin/bash
  2. Run certbot and see it errors out saying that cloudflare-dns plugin is causing an issue (this is to confirm you have the issue I was seeing that was fixed by this method)
  3. pip uninstall certbot-dns-cloudflare
  4. Run certbot and see it does not error out
  5. pip install certbot-dns-cloudflare
  6. Run certbot and see it does not error out
  7. Try creating a SSL cert and it should work

It works!

ajunior84 avatar Jun 25 '24 05:06 ajunior84

okay, now im going insane, i think. i did not have to do any of that, just went back to my old database.sqlite file and it worked just like that. i hate days like these. becuase you dont know what happened and what fixed it

zaourzag avatar Jun 25 '24 05:06 zaourzag

Got it to work! Using 2.11.1 (may work on latest, but I rolled back to 2.11.1 and it works).

Follow these steps:

1. `docker exec -it <name of container> /bin/bash`

2. Run `certbot` and see it errors out saying that cloudflare-dns plugin is causing an issue (this is to confirm you have the issue I was seeing that was fixed by this method)

3. `pip uninstall certbot-dns-cloudflare`

4. Run `certbot` and see it does not error out

5. `pip install certbot-dns-cloudflare`

6. Run `certbot` and see it does not error out

7. Try creating a SSL cert and it should work

You saved me! It worked! Thanks!

IoSonoPiero avatar Jun 25 '24 13:06 IoSonoPiero

Got it to work! Using 2.11.1 (may work on latest, but I rolled back to 2.11.1 and it works).

Follow these steps:

1. `docker exec -it <name of container> /bin/bash`

2. Run `certbot` and see it errors out saying that cloudflare-dns plugin is causing an issue (this is to confirm you have the issue I was seeing that was fixed by this method)

3. `pip uninstall certbot-dns-cloudflare`

4. Run `certbot` and see it does not error out

5. `pip install certbot-dns-cloudflare`

6. Run `certbot` and see it does not error out

7. Try creating a SSL cert and it should work

Thank you so much, this was driving me nuts!

twilight7345 avatar Jun 25 '24 17:06 twilight7345

Got it to work! Using 2.11.1 (may work on latest, but I rolled back to 2.11.1 and it works).

Follow these steps:

  1. docker exec -it <name of container> /bin/bash
  2. Run certbot and see it errors out saying that cloudflare-dns plugin is causing an issue (this is to confirm you have the issue I was seeing that was fixed by this method)
  3. pip uninstall certbot-dns-cloudflare
  4. Run certbot and see it does not error out
  5. pip install certbot-dns-cloudflare
  6. Run certbot and see it does not error out
  7. Try creating a SSL cert and it should work

Thank you for this fix, helped with my first installation

challgren avatar Jun 25 '24 22:06 challgren

Got it to work! Using 2.11.1 (may work on latest, but I rolled back to 2.11.1 and it works).

Follow these steps:

1. `docker exec -it <name of container> /bin/bash`

2. Run `certbot` and see it errors out saying that cloudflare-dns plugin is causing an issue (this is to confirm you have the issue I was seeing that was fixed by this method)

3. `pip uninstall certbot-dns-cloudflare`

4. Run `certbot` and see it does not error out

5. `pip install certbot-dns-cloudflare`

6. Run `certbot` and see it does not error out

7. Try creating a SSL cert and it should work

Works like a charm! Thank you for this. I hope an update comes out soon to resolve it.

danthonywalker avatar Jun 26 '24 02:06 danthonywalker

Got it to work! Using 2.11.1 (may work on latest, but I rolled back to 2.11.1 and it works).

Follow these steps:

  1. docker exec -it <name of container> /bin/bash
  2. Run certbot and see it errors out saying that cloudflare-dns plugin is causing an issue (this is to confirm you have the issue I was seeing that was fixed by this method)
  3. pip uninstall certbot-dns-cloudflare
  4. Run certbot and see it does not error out
  5. pip install certbot-dns-cloudflare
  6. Run certbot and see it does not error out
  7. Try creating a SSL cert and it should work

For future people, if for some reason this doesn't work try doing

pip uninstall certbot-dns-cloudflare pip install --upgrade pip and the reinstall the plugin but specify the version pip install --force-reinstall "certbot-dns-cloudflare==2.11.0" and restart the container.

For some reason even if you reinstall the plugin after upgrading pip it will always pull the version that it was installed.

Aerglonus avatar Jun 26 '24 07:06 Aerglonus

Got it to work! Using 2.11.1 (may work on latest, but I rolled back to 2.11.1 and it works).

Follow these steps:

  1. docker exec -it <name of container> /bin/bash
  2. Run certbot and see it errors out saying that cloudflare-dns plugin is causing an issue (this is to confirm you have the issue I was seeing that was fixed by this method)
  3. pip uninstall certbot-dns-cloudflare
  4. Run certbot and see it does not error out
  5. pip install certbot-dns-cloudflare
  6. Run certbot and see it does not error out
  7. Try creating a SSL cert and it should work

Got it to work! Using 2.11.1 (may work on latest, but I rolled back to 2.11.1 and it works).

Follow these steps:

  1. docker exec -it <name of container> /bin/bash
  2. Run certbot and see it errors out saying that cloudflare-dns plugin is causing an issue (this is to confirm you have the issue I was seeing that was fixed by this method)
  3. pip uninstall certbot-dns-cloudflare
  4. Run certbot and see it does not error out
  5. pip install certbot-dns-cloudflare
  6. Run certbot and see it does not error out
  7. Try creating a SSL cert and it should work

thank u so much! this really helps

C0RS4 avatar Jun 27 '24 16:06 C0RS4

The issue is the cloudflare-python package, version 3.x.x is incompatible with 2.x.x, ~~which is pinned in certbot upstream, but not here in NPM it seems. Perhaps certbot needs to be bumped in NPM.~~ This has been adressed in #3764, hopefully dev gets merged soon...

A more technically correct fix is only pinning the cloudflare package in the container using pip install --upgrade cloudflare==2.19.*

i.e.

  1. docker exec -it <name of container> /bin/bash
  2. pip install --upgrade cloudflare==2.19.*
  3. Try creating a SSL cert and it should work

thefeli73 avatar Jun 27 '24 16:06 thefeli73

The issue is the cloudflare-python package, version 3.x.x is incompatible with 2.x.x, ~which is pinned in certbot upstream, but not here in NPM it seems. Perhaps certbot needs to be bumped in NPM.~ This has been adressed in #3764, hopefully dev gets merged soon...

A more technically correct fix is only pinning the cloudflare package in the container using pip install --upgrade cloudflare==2.19.*

i.e.

1. `docker exec -it <name of container> /bin/bash`

2. `pip install --upgrade cloudflare==2.19.*`

3. Try creating a SSL cert and it should work

This does NOT work on NPM on v 2.11.1 and running the pip install.

F1zzyD avatar Jun 28 '24 06:06 F1zzyD

5. pip install certbot-dns-cloudflare

Tried on 2.11.2 and works like a charm! thank you so much!

nixielectra avatar Jun 28 '24 09:06 nixielectra

Got it to work! Using 2.11.1 (may work on latest, but I rolled back to 2.11.1 and it works).

Follow these steps:

  1. docker exec -it <name of container> /bin/bash
  2. Run certbot and see it errors out saying that cloudflare-dns plugin is causing an issue (this is to confirm you have the issue I was seeing that was fixed by this method)
  3. pip uninstall certbot-dns-cloudflare
  4. Run certbot and see it does not error out
  5. pip install certbot-dns-cloudflare
  6. Run certbot and see it does not error out
  7. Try creating a SSL cert and it should work

Confirmed, this works on v2.11.2.

akapsch avatar Jun 29 '24 23:06 akapsch

The issue is the cloudflare-python package, version 3.x.x is incompatible with 2.x.x, ~which is pinned in certbot upstream, but not here in NPM it seems. Perhaps certbot needs to be bumped in NPM.~ This has been adressed in #3764, hopefully dev gets merged soon...

A more technically correct fix is only pinning the cloudflare package in the container using pip install --upgrade cloudflare==2.19.*

i.e.

  1. docker exec -it <name of container> /bin/bash
  2. pip install --upgrade cloudflare==2.19.*
  3. Try creating a SSL cert and it should work

Finally succeeded!!

cccalm1222 avatar Jul 26 '24 13:07 cccalm1222

worked for me too :-)) thank you very much buddy @LandonPatmore

Greatz08 avatar Oct 29 '24 03:10 Greatz08

Got it to work! Using 2.11.1 (may work on latest, but I rolled back to 2.11.1 and it works).

Follow these steps:

  1. docker exec -it <name of container> /bin/bash
  2. Run certbot and see it errors out saying that cloudflare-dns plugin is causing an issue (this is to confirm you have the issue I was seeing that was fixed by this method)
  3. pip uninstall certbot-dns-cloudflare
  4. Run certbot and see it does not error out
  5. pip install certbot-dns-cloudflare
  6. Run certbot and see it does not error out
  7. Try creating a SSL cert and it should work

For me, this doesn't work on the latest version. I might try rolling back to the version you mentioned.

zFlxw avatar Nov 10 '24 11:11 zFlxw

It's end of 2024,and not fix this yet,using @LandonPatmore,and works fine !

wander555 avatar Nov 26 '24 00:11 wander555

It's end of 2024,and not fix this yet,using @LandonPatmore,and works fine !

Worked for me as well after re-installing the latest version (didn't need to rollback but I had to reinstall the image).

zFlxw avatar Nov 26 '24 08:11 zFlxw

NPM worked fine for me for years then It is totally stopped few weeks ago. Okay, no problem, let's start from scratch. Still struggling.

Can't install with pip as it cannot reach anything outside the container.

[root@docker-f97854f704cd:/app]# pip install --upgrade cloudflare==2.19.*
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f2a2f2302d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/cloudflare/

I tried to use host as network but in this case I cannot login to the npm. I'm totally lost. I'm using this compose.yml:

version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    container_name: nginx-proxy-manager
    restart: unless-stopped
#    network_mode: "host"
    ports:
      - '80:80' # Public HTTP Port
      - '443:443' # Public HTTPS Port
      - '81:81' # Admin Web Port
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

Tamas92 avatar Dec 12 '24 16:12 Tamas92

@Tamas92 Encountered the same problem and it's not solved yet

tzzzzzzzzzzz avatar Dec 30 '24 08:12 tzzzzzzzzzzz

@Tamas92 Encountered the same problem and it's not solved yet

I solved it. I installed a Traefik and it had the same issue, no cert, no internet from the container so I just tried to think and search on the internet.

I'm using local DNS entries via PiHole. The solution was that I had to add the server IP before the ports for the pihole's compose file. More details here: https://stackoverflow.com/questions/64007727/docker-compose-internal-dns-server-127-0-0-11-connection-refused

After I did that I could login immediately and it could refresh the cert as well and everything works again as before. I hope it solves the issue for you as well.

Tamas92 avatar Jan 28 '25 14:01 Tamas92

Just encountered the same problem after years of working fine, so still not fixed Feb 2025. Uninstall and re-install of certbot-dns-cloudflare fixes it, but restarting the container breaks it again.

michaelblight avatar Feb 27 '25 01:02 michaelblight

So, there's a chance that you have my case: both piHole and NPM as docker containers. Due to some weird behavior of DNS resolver NPM container do not have access to internet so cannot request for cert. For me it log errors like Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/cloudflare/ Also I have error Failed to check the reachability due to a communication error with site24x7.com nginx proxy when in version 2.12.3 I use option "Test Server Reachability" from tab SSL Certificates. How to solve it? add following to your NPM docker compose:

dns:
  - 172.19.0.4 <<pihole IP adress>>
  - 1.1.1.1
  - 8.8.8.8

Silicon51 avatar May 21 '25 23:05 Silicon51