Hello And thank you for taking the time to read
I have a domain giladsky.com and a subdomain chat.giladsky.com
everything was working fine, i have a weekly cronjob to renew certificates, yesterday on my subdomain i received an error 429, if i understood correct i did not hit the rate limit
this is from my log file
Create new order error. Le_OrderFinalize not found. {
"type": "urn:ietf:params:acme:error:rateLimited",
"detail": "Error creating new order :: too many failed authorizations recently: see https://letsencrypt.org/docs/rate-limits/",
"status": 429
}
and also i started to see this error
chown: changing ownership of '/var/www/letsencrypt/.well-known/acme-challenge/uTuEg4xH1SJUlb_0h_UN9zvmoFGDQTzNN6IBXEXFc1I':>
chown: changing ownership of '/var/www/letsencrypt/.well-known/acme-challenge': Operation not permitted
chown: changing ownership of '/var/www/letsencrypt/.well-known': Operation not permitted
even though when checking permission all is set like before
Thank you for taking the time if you can please help me
Just to be clear, the problem is renewing chat.giladsky.com right?
You are hitting the rate limit of 5 failures per account, per hostname, per hour.
You didn't say it but I suppose you are using acme.sh. What is the user where you have defined that cron job and what is the command you are executing?
I have another crunjob running on giladsky.com also weekly but had never had issued and renewed the certificate on December 27
and i do not run in manually besides the cronjob
the output is
total 12
drwxrwxr-x 3 www-data www-data 4096 Nov 15 04:18 .
drwxr-x--- 3 www-data www-data 4096 Nov 15 04:18 ..
drwxrwxr-x 3 www-data www-data 4096 Nov 15 04:18 .well-known
/var/www/letsencrypt/.well-known:
total 12
drwxrwxr-x 3 www-data www-data 4096 Nov 15 04:18 .
drwxrwxr-x 3 www-data www-data 4096 Nov 15 04:18 ..
drwxrwxr-x 2 www-data www-data 4096 Jan 17 13:27 acme-challenge
/var/www/letsencrypt/.well-known/acme-challenge:
total 8
drwxrwxr-x 2 www-data www-data 4096 Jan 17 13:27 .
drwxrwxr-x 3 www-data www-data 4096 Nov 15 04:18 ..
As far as I can see, the code in acme.sh that is triggering the chown problem is this:
if [ ! "$usingApache" ]; then
if webroot_owner=$(_stat "$_currentRoot"); then
_debug "Changing owner/group of .well-known to $webroot_owner"
if ! _exec "chown -R \"$webroot_owner\" \"$_currentRoot/.well-known\""; then
_debug "$(cat "$_EXEC_TEMP_ERR")"
_exec_err >/dev/null 2>&1
fi
else
_debug "not changing owner/group of webroot"
fi
fi
You can do nothing, just wait but you just need to wait 1 hour so that limit has gone already.
Regarding the problem, seems acme.sh is writing the challenge file as acmeuser or maybe as root (I tested it on my server and it executes the command as the user but it writes the files as root, I'm trying to know the reason) (forget what I say about files written as root, it was me doing a wrong redirection in current shell instead of spawning a shell) and then it tries to modify the owner to www-data but it can't (chown error) but it continues the process and your nginx server can't serve the challenge and gives a 403 forbidden error to Let's Encrypt so it can't validate the challenge to issue the cert for your domain.
Why is it happening now but it worked before? No idea, are you sure you didn't change anything?
Instead of launching the command as root and using sudo you could try to login as acmeuser and execute the command:
I've simulated your situation, same user, same perms, etc. and I get the same chown errors:
[Tue Jan 19 17:22:26 UTC 2021] chown: changing ownership of '/var/www/letsencrypt/.well-known/acme-challenge': Operation not permitted
chown: changing ownership of '/var/www/letsencrypt/.well-known': Operation not permitted
But I get the certificate so seems the chown error is not preventing that you get the certificate so maybe there is problem in nginx conf.
Using your acmeuser write a test file:
echo "this is a test file" > /var/www/letsencrypt/.well-known/acme-challenge/test-acme
Thank you for taking your time to try to resolve this
i created the test file as acmeuser after testing i receive 404 error
so maybe it worked? in my nginx conf it mentioned that if something not exist to assume it is a chat room
i left it so you can review it yourself at http://chat.giladsky.com/.well-known/acme-challenge/test-acme
Once done, reload nginx and try to get the test file again.
I see you get your certificates but you are not using them in nginx, you must reload your nginx so it can use the new certificates. Tell me what is the command you should use to reload nginx (systemctl reload nginx or service nginx reload or ...) so we can include it in your acme.sh conf and the reload would be performed automatically in every renew.