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

Unable to update account message #95

Closed
adamtg opened this issue Feb 24, 2021 · 6 comments
Closed

Unable to update account message #95

adamtg opened this issue Feb 24, 2021 · 6 comments

Comments

@adamtg
Copy link

adamtg commented Feb 24, 2021

All of the sudden, i started getting this error:

org.shredzone.acme4j.exception.AcmeServerException: Unable to update account :: too many/too long contact(s). Please use shorter or fewer email addresses

But using the same email and domain name, i am able to get a certificate using certbot. I haven't changed the code in months, and this is the first time i have seen this error.

thank you

@shred
Copy link
Owner

shred commented Feb 24, 2021

The error is reported by the server, so it really seems that there are either too many or too long contacts.

You can read the list of contacts by getting an Account object of your account, and then invoking getContacts() and check the result. I guess that you have a large number of identical addresses. 😄 If so, you can modify the contact list like described here to remove all unused or duplicate addresses.

The next step would be to find out where the duplicate addresses come from.

@adamtg
Copy link
Author

adamtg commented Feb 24, 2021

Why would the same exact email address and domain work with certbot, and not with the code using acme4j?

@shred
Copy link
Owner

shred commented Feb 25, 2021

I can only guess from the few information you have given me so far.

acme4j just passes your email addresses to the server, but does not apply any constrains on it. The server limits the entire contact JSON structure to a size of 191 bytes. The error occurs if that limit is exceeded on the server. It is the same behavior for acme4j and certbot.

According to the error message, you are trying to modify your account via acme4j. Before you invoke commit(), can you invoke getContacts() and check if the result is as expected?

Account.EditableAccount edit = account.modify();

// Now you do all your usual account modifications...

System.out.println(edit.getContacts());
edit.commit();  // your commit that throws the exception

If the list of contacts looks unsuspicious, you can also enable the debug log level. acme4j will then log the JSON structure that is sent to the server and triggers the error. You can enable debug log e.g. with passing -Dorg.slf4j.simpleLogger.log.org.shredzone.acme4j=debug as Java parameter, unless you use another slf4j log target.

Please understand that it is hard for me to help you if I don't know your source code, or the problematic email address.

@adamtg
Copy link
Author

adamtg commented Feb 25, 2021

Thank you very much for the diagnostic help. I will add them in and see what is going on.

@adamtg
Copy link
Author

adamtg commented Feb 25, 2021

The debugging showed exactly what was happening, and it was definitely my mistake. Every time i requested a certificate, i was calling:

Account.EditableAccount edit = account.modify();
edit.addEmail(email).commit(); 

and the email list would keep on growing. All i do now is clear the list before it is called, and everything works as expected.

Thank you very much for your time and help.

@adamtg adamtg closed this as completed Feb 25, 2021
@shred
Copy link
Owner

shred commented Feb 25, 2021

This was what I was suspecting. 😃 I'm glad you could fix it.

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

2 participants