Error with LetsEncrypt

Hello Friends,

Nice to write here for the first time.

I am trying to install NexcloudPi using the curl command on my Raspberry Pi 4 4GB running Retropie OS 4.7.1.

It appears the NextckoudPi installer has properly finished and I’m able to log into the NCP system panel.
I managed to insert my DuckDNS domain, but I’m unable to finish the LetsEncrypt process due to some error.
Could anyone please help?

This is the error message I’m seeing:

[ letsencrypt ] (Sun May 9 15:15:55 IDT 2021)
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for mjeshurun.duckdns.org
Using the webroot path /var/www/nextcloud for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. mjeshurun.duckdns.org (http-01): urn:ietf:params:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching http://mjeshurun.duckdns.org/.well-known/acme-challenge/hKxDVEnrPi_o4RsESKArG3Sp9TIRyvrUIFuunlDWacQ: Error getting validation data
IMPORTANT NOTES:
- The following errors were reported by the server:

Domain: mjeshurun.duckdns.org
Type: connection
Detail: Fetching
http://mjeshurun.duckdns.org/.well-known/acme-challenge/hKxDVEnrPi_o4RsESKArG3Sp9TIRyvrUIFuunlDWacQ:
Error getting validation data

To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address. Additionally, please check that
your computer has a publicly routable IP address and that no
firewalls are preventing the server from communicating with the
client. If you're using the webroot plugin, you should also verify
that you are serving files from the webroot path you provided

Did you do that?
Does your domain resolve to your WAN IP address?
and have you forwarded (in your ISP router) ports 80/443 to the LAN IP address?

1 Like

Hi @OliverV, thank you for responding to my post.

I have done the following steps so far:

  1. I set my router to forward ports 80 and 443 to my Raspberry Pi 4’s IP address on my network.

  2. I opened a free account on DuckDNS and created a domain. DuckDNA is showing my correct current IP next to my domain name.

  3. In the NextcloudPi Panel, I activated DuckDNS using my DuckDNS domain, the token i got, and I pressed the “apply” button.

  4. I added my DuckDNS domain as a trusted domain in the NextcloudPi Panel.

  5. I then tried to activate LetsEncrypt using my DuckDNS domain address and my personal email, but the process failed giving me the error message.

Hey, are you fowarding http to https? I had a simmilar problem when I was using certbot in webroot mode. I had to disable http–>https redirection and allow http while the cert was being renewed/issued and then reactivate the redirection…

1 Like

Thank you, @asdrip :pray:
This is a good idea. I will try it.

I disabled nc-httpsonly, but I’m currently getting this error message (probably due to the earlier failed attempts):

[ letsencrypt ] (Mon May 10 00:00:58 IDT 2021)
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
An unexpected error occurred:
There were too many requests of a given type :: Error creating new order :: too many failed authorizations recently: see https://letsencrypt.org/docs/rate-limits/
Please see the logfiles in /var/log/letsencrypt for more details.

Hopefully, the process will work ok after the failed validation limit is over.

1 Like

Yeah you’ve got 5 failed attempts per hours Rate Limits - Let's Encrypt :wink:

Unfortunately, disabling Force HTTPS didn’t fix the problem :frowning:
I’m still getting an error message when trying to enable LetsEncrypt.

[ letsencrypt ] (Mon May 10 00:25:49 IDT 2021)
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for mjeshurun.duckdns.org
Using the webroot path /var/www/nextcloud for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. mjeshurun.duckdns.org (http-01): urn:ietf:params:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching http://mjeshurun.duckdns.org/.well-known/acme-challenge/av4YNxzS7U5JzfAggf2Wrs74KB4r9Rooj16zpz8mv8w: Error getting validation data
IMPORTANT NOTES:
- The following errors were reported by the server:

Domain: mjeshurun.duckdns.org
Type: connection
Detail: Fetching
http://mjeshurun.duckdns.org/.well-known/acme-challenge/av4YNxzS7U5JzfAggf2Wrs74KB4r9Rooj16zpz8mv8w:
Error getting validation data

To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address. Additionally, please check that
your computer has a publicly routable IP address and that no
firewalls are preventing the server from communicating with the
client. If you're using the webroot plugin, you should also verify
that you are serving files from the webroot path you provided.

Ok so maybe you should use a DNS challenge ? Here certbot-dns-duckdns · PyPI everything is pretty well explained I believe :grinning_face_with_smiling_eyes:.

1 Like

I wish I knew how to follow the instructions in the link you shared.
I’m quite a noob when it comes to programming, so unless I have a step-by-step guide I can follow (and copy-paste commands from), I most likely won’t know how to proceed.
As with this occasion :frowning:

https://docs.nextcloudpi.com/en/how-to-get-certificate-with-letsencrypt-using-dns-to-verify-domain/

2 Likes

Thank you @OliverV :pray:
I was able to follow the guide you shared and now my NCP panel shows letsencrypt with a checkmark (:heavy_check_mark:) next to it. I assume it’s a good sign :slight_smile:
However, I’m not able to access my NCP at https://mjeshurun.duckdns.org:2443
Any ideas what I should do?

is an alternate port, you’ll have to forward external :2443 to internal:443

Due to the errors I was facing, I decided to re-run the letsencrypt process for DuckDNS within NextCloudPi.
To do that, I started from scratch using NextCloudPi’s webui panel:

  1. used nc-forward-ports to automatically configure my router’s port mapping. Https was set to 443, and Http was set to 80. It worked ok and the mapping is shown on my router’s admin console.

  1. set nc-trusted-domains as follows:
    Trusted Domain #1 was set to my DuckDNS subdomain (mjeshurun.duckdns.org)
    Trusted Domain #3 was set to 192.168.1.2 (my Raspberry Pi 4 internal IP address).

  2. activated duckDNS using the subdomain I created on DuckDNS and the token it gave me.

  3. activated dnsmasq using my DuckDNS domain address, I left DNS server as 8.8.8.8, and I set the cache size to 1000.

  4. ran letsencrypt within NCP and it finished properly showing a green light.

However, I’m still not able to connect to my NCP server using my DuckDNS address.
When I try to open mjeshurun.duckdns.org:443 on my home wifi system or on my phone’s 4G internet cellular system, I’m getting an “Unable to connect” error message.

Any ideas how I can fix this?

https:// uses port 443 by default, so no :443 needed

Maybe your ISP router does not allow UPnP, better log in to your ISP device and check if ports are forwarded.

1 Like

Thanks again, @OliverV, for your help.

My router supports UPnP and the two ports are open and forwarded to my Raspberry Pi’s internal IP address. Both screenshots are from my router’s admin console:

I tried using the duckdns address without the port number (:443), but I’m still seeing the “Unable to connect” message.
Screen Shot 2021-05-11 at 13.49.01

Are you using a custom dns server in your network?

1 Like

Can you reach it using the local IP 192.168.1.2 ?

1 Like

Yes.
Firefox opens the Nextcloud dashboard when using 192.168.1.2, but it showed a “potential security risk” message that I had to manually approve.

Chrome also opens the local address with a security message I needed to manually approve.

Are you sure that the duckns url is updated correctly. Does it point to your actual external IP address?

Hi @szaimen, thank you for taking the time to help me.

That’s a good question.
How do I check that?
From what I checked so far, my router is set to automatically get the DNS settings from my ISP.
Is there a place I can check that the Raspberry Pi’s DNS configuration matches the one on the router?

Also, I don’t know if this is related, but my router’s admin console shows my IP as: 100.100.201.146.

although when I check https://whatismyipaddress.com/ I see a different IP address: 147.236.146.216.

Could this cause the problem?