Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCaddy produces account rate limit errors when compiled with latest certmagic package #2400
Comments
This comment has been minimized.
This comment has been minimized.
@mholt What are your thoughts on the issue? |
This comment has been minimized.
This comment has been minimized.
Hm, this is working fine for me using the latest commit. It doesn't make any sense... the only thing that commit does which is even close to relevant is change How sure are you that the caddy built with the latest commit is using the same $HOME and rest of the environment? |
This comment has been minimized.
This comment has been minimized.
@mholt Thanks for your feedback. I'm not 100% sure that it's using the same $HOME and other environment variables. What would be the easiest way for me to ensure that they're identical for both builds? |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
Ok, I can confirm that $HOME and the other environment variables are identical for both builds. I uploaded my compiled binaries to my Seafile server just now. Would you mind running both of them with the command I provided and posting your results here? Binary compiled against latest commit: https://seafile.datahoarder.xyz/f/a6f0cbd0238342179fdc/ |
This comment has been minimized.
This comment has been minimized.
Thanks for the binaries, but I don't use Linux, so I'd have to spin up a VM. That's doable, but I don't think the build itself is the problem. I suspect there's something more intricate that involves the state of your disk, especially the $CADDYPATH (~/.caddy by default), and some inconsistency or bug in the code. Unreasonable to ask, but a VM that reproduces the issue is most effective here. Since that's probably difficult, could you help debug it? Putting I'd also love to see the path through this function: https://github.com/mholt/certmagic/blob/a3b276a1b44e1c2c3dcab752729976ea04f4839b/user.go#L82 -- which shows the subscriber agreement prompt. If you already have a user from before, it shouldn't reach that branch; so litter that function with prints and find out where it goes. And then put plenty of Prints where ever else you feel might be useful! Feel free to explore beyond what I've suggested, that will speed things up. |
This comment has been minimized.
This comment has been minimized.
@mholt Which software are you using for creating VMs? I could create a VM that reproduces the issue with VirtualBox and share the .ova file with you or with VMware Workstation Player and share the .vmdk file with you. Let me know which option you'd prefer. I'll also try out the steps you suggested to debug the issue and get back to you once I have some results. |
This comment has been minimized.
This comment has been minimized.
It'll probably be easier to just debug on your end, to be honest (my download is 5 Mbps unless I borrow the university connection, haven't had any time for that lately though). And I use Parallels... |
This comment has been minimized.
This comment has been minimized.
@mholt What do you think about me temporarily giving you SSH access to my server for debug purposes? |
This comment has been minimized.
This comment has been minimized.
I'm on holiday for a couple weeks, so I'm kind of taking it easy on the coding front for a bit. Edit: Also, I don't do that as a matter of policy, for liability reasons, without a waiver. |
This comment has been minimized.
This comment has been minimized.
@mholt That's fair. I just took a look at what you wanted me to do for debugging Caddy, but I feel a little bit lost. I have virtually zero programming knowledge so I don't know what you mean when you say that I should put "log.Println statements through select areas of CertMagic." I assume that I'm supposed to fetch the Caddy source code with If you could tell me what exactly I need to insert in those files, it would be really helpful for me. |
This comment has been minimized.
This comment has been minimized.
@mholt I discovered the cause of this issue. You cannot leave the e-mail address field blank when launching Caddy and you're prompted to enter one (even though it says that you can leave it blank). Once I entered an e-mail, I was able to launch Caddy's latest build successfully. |
whalehub
closed this
Dec 21, 2018
This comment has been minimized.
This comment has been minimized.
I see... hmm... can you do |
This comment has been minimized.
This comment has been minimized.
@mholt Here is the output from
I'm afraid I don't have the The e-mail address I entered the first time was simply a blank one, meaning that I just hit the Enter key when prompted to enter an e-mail address. The second time around, I entered "letsencrypt@jadja.eu" as the e-mail address, which allowed Caddy to register a new LetsEncrypt account.. Afterwards, I deleted the .caddy folder and started Caddy with the command line argument |
This comment has been minimized.
This comment has been minimized.
Cool, thanks. Running with a blank email address should cause the subdirectory within So, it seems that Caddy/CertMagic was correctly asking for an email address, since it didn't find an existing user account given a blank email address. There might still be a bug here, but I'm not 100% sure. Are you able to reproduce the behavior more concretely? To try, set the |
whalehub
reopened this
Dec 22, 2018
This comment has been minimized.
This comment has been minimized.
@mholt I was unable to reproduce this behavior again. |
whalehub
closed this
Jan 1, 2019
crvv
referenced this issue
Jan 17, 2019
Merged
caddytls: set certmagic.Config.Email when parsing config file #2432
This comment has been minimized.
This comment has been minimized.
I encountered this today. The rate limit is
https://letsencrypt.org/docs/rate-limits/ In log, there are 10 lines of log:
|
crvv
reopened this
Jan 17, 2019
This comment has been minimized.
This comment has been minimized.
Looks like it might be the same thing as #2432? Edit: haha scratch that, you were the one to open that issue. I was reading from emails and it wasn't obvious it was the same person. |
This comment has been minimized.
This comment has been minimized.
Do you have a reproducible test case? |
mholt
added
the
bug
label
Jan 17, 2019
This comment has been minimized.
This comment has been minimized.
There are three bugs around this issue.
2 only occurs if the email is empty, so #2432 will get rid of the bug if there is an email in Caddyfile. |
This comment has been minimized.
This comment has been minimized.
Great, thanks for the writeup. I'm looking at this now. |
This comment has been minimized.
This comment has been minimized.
Okay, I'm pushing a fix for 1 in just a moment. As for 2, I'm not quite sure it works like you've described. Everything is right until "The previous user is overrided" -- there shouldn't be any previous user (with the same email address, including an empty email), since it would have loaded it from disk. Then In other words, I think that fixing 1 and 3 is sufficient. I will comment in a few minutes when I have pushed my changes. I hope you can help test them! |
mholt
closed this
in
mholt/certmagic@01ffe8b
Jan 18, 2019
added a commit
that referenced
this issue
Jan 18, 2019
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Please see mholt/certmagic#17 for details. |
kingforaday
referenced this issue
Jan 19, 2019
Merged
Calling ObtainCert() should be no-op if certificate already obtained #2
LouisMT
referenced this issue
Jan 20, 2019
Closed
Caddy won't start after upgrade to the 0.11.2 due to the issue with LetsEncrypt #2436
This comment has been minimized.
This comment has been minimized.
Thanks for that PR, @crvv. After spending more time investigating, I can confirm you are right. Merged it in, and will update Caddy soon. |
This comment has been minimized.
This comment has been minimized.
UniverseXXX
commented
Jan 30, 2019
This comment has been minimized.
This comment has been minimized.
Yes very soon, we just need to be able to explain #2407 and finish mholt/certmagic#23. |
This comment has been minimized.
This comment has been minimized.
@crvv @whalehub @UniverseXXX Following up on related issues, could you help test #2452 please? Need to make sure the change is solid before doing a release (but I won't wait long, either). |
This comment has been minimized.
This comment has been minimized.
UniverseXXX
commented
Feb 5, 2019
@mholt Sorry couldn't get back to you earlier. Just downloaded 0.11.3 and it doesn't work, unfortunately. Here is the log:
|
This comment has been minimized.
This comment has been minimized.
It works. Looks like your network is having trouble connecting to Let's Encrypt. |
This comment has been minimized.
This comment has been minimized.
UniverseXXX
commented
Feb 5, 2019
@mholt You are right. Sorry, my bad - got Pi-Hole running in Docker which causing the issue.
|
This comment has been minimized.
This comment has been minimized.
Yeah I recommend running with the |
whalehub commentedDec 20, 2018
•
edited
1. What version of Caddy are you using (
caddy -version
)?Working build: Caddy 0.11.1 (+0684cf8 Wed Dec 19 15:48:39 UTC 2018) (unofficial)
Broken build: Caddy 0.11.1 (+0b83014 Thu Dec 20 10:24:39 UTC 2018) (unofficial)
2. What are you trying to do?
I'm trying to run a build of Caddy that has been compiled against the latest commit.
3. What is your entire Caddyfile?
4. How did you run Caddy (give the full command and describe the execution environment)?
I'm running Caddy on Debian 9.6 with this command:
5. Please paste any relevant HTTP request(s) here.
N/A
6. What did you expect to see?
I expect Caddy to either:
a.) use the existing account in my .caddy folder to fetch certificates or
b.) successfully register a new account in case none exist in the .caddy folder.
7. What did you see instead (give full error messages and/or log)?
Caddy ignores any existing accounts in the .caddy folder and will always try to register a new account. When trying to register a new account, Caddy produces a rate limit error despite it being the the first registration attempt within 24 hours (i.e., it's not actually hitting LetsEncrypt's "10 registrations per 3 hours" rate limit).
Here's the output from the log file:
Note: This problem does not occur when you use a build of Caddy that has been compiled against the second latest commit. That build of Caddy can both use existing accounts in the .caddy folder as well as register a new account in case none are present in the .caddy folder.
8. How can someone who is starting from scratch reproduce the bug as minimally as possible?