Python deserialization error on temporary webserver


#1

Hi,
I’m trying to configure letsencrypt to run on my server, which is an Ubuntu 14.04 running on a VM on Azure, using Node.js and Express.
I’ve cloned letsencrypt from the repository, and I’m trying to generate a certificate for my domain using the following command:
sudo ./letsencrypt-auto certonly -d my_domain_here --server https://acme-v01.api.letsencrypt.org/directory --renew-by-default --agree-tos
I have already tried several combinations of commands, always ending up with the same error.
when I try to run it from the command-line using the letsencrypt-auto tool, I get the following error:

2016-01-22 07:10:37,823:DEBUG:letsencrypt.cli:Root logging level set at 30
2016-01-22 07:10:37,823:INFO:letsencrypt.cli:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2016-01-22 07:10:37,823:DEBUG:letsencrypt.cli:letsencrypt version: 0.2.0
2016-01-22 07:10:37,823:DEBUG:letsencrypt.cli:Arguments: [’-d’, ‘domain’, ‘–server’, ‘https://acme-v01.api.letsencrypt.org/directory’, ‘–renew-by-default’, ‘–agree-tos’]
2016-01-22 07:10:37,823:DEBUG:letsencrypt.cli:Discovered plugins: PluginsRegistry(PluginEntryPoint#apache,PluginEntryPoint#webroot,PluginEntryPoint#null,PluginEntryPoint#manual,PluginEntryPoint#standalone)
2016-01-22 07:10:37,832:DEBUG:letsencrypt.cli:Requested authenticator None and installer None
2016-01-22 07:10:38,030:DEBUG:letsencrypt.plugins.disco:No installation (PluginEntryPoint#apache):
Traceback (most recent call last):
File “/home/guilherme/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/plugins/disco.py”, line 103, in prepare
self._initialized.prepare()
File “/home/guilherme/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py”, line 149, in prepare
raise errors.NoInstallationError
NoInstallationError
2016-01-22 07:10:38,031:DEBUG:letsencrypt.plugins.disco:Other error:(PluginEntryPoint#webroot): --webroot-path must be set
Traceback (most recent call last):
File “/home/guilherme/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/plugins/disco.py”, line 103, in prepare
self._initialized.prepare()
File “/home/guilherme/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/plugins/webroot.py”, line 53, in prepare
self.option_name(“path”)))
PluginError: --webroot-path must be set
2016-01-22 07:10:38,032:DEBUG:letsencrypt.display.ops:Single candidate plugin: * standalone
Description: Automatically use a temporary webserver
Interfaces: IAuthenticator, IPlugin
Entry point: standalone = letsencrypt.plugins.standalone:Authenticator
Initialized: <letsencrypt.plugins.standalone.Authenticator object at 0x7f0a73f54b10>
Prep: True
2016-01-22 07:10:38,032:DEBUG:letsencrypt.cli:Selected authenticator <letsencrypt.plugins.standalone.Authenticator object at 0x7f0a73f54b10> and installer None
2016-01-22 07:10:38,033:DEBUG:letsencrypt.cli:Exiting abnormally:
Traceback (most recent call last):
File “/home/guilherme/.local/share/letsencrypt/bin/letsencrypt”, line 11, in
sys.exit(main())
File “/home/guilherme/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/cli.py”, line 1398, in main
return args.func(args, config, plugins)
File “/home/guilherme/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/cli.py”, line 589, in obtain_cert
le_client = _init_le_client(args, config, authenticator, installer)
File “/home/guilherme/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/cli.py”, line 176, in _init_le_client
acc, acme = _determine_account(args, config)
File “/home/guilherme/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/cli.py”, line 142, in _determine_account
accounts = account_storage.find_all()
File “/home/guilherme/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/account.py”, line 160, in find_all
accounts.append(self.load(account_id))
File “/home/guilherme/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/account.py”, line 173, in load
regr = messages.RegistrationResource.json_loads(regr_file.read())
File “/home/guilherme/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/interfaces.py”, line 180, in json_loads
return cls.from_json(loads)
File “/home/guilherme/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/json_util.py”, line 297, in from_json
return cls(**cls.fields_from_json(jobj))
File “/home/guilherme/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/json_util.py”, line 280, in fields_from_json
cls._check_required(jobj)
File “/home/guilherme/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/json_util.py”, line 275, in _check_required
’,’.join(missing)))
DeserializationError: Deserialization error: The following field are required: uri,new_authzr_uri

How can I solve this? Why is that happening?


#2

new_authzr_uri is a field that should be included in the regr.json file that’s generated in /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/{random}. My guess is this file is corrupted for some reason (file system corruption, a previously interrupted client run, manual modifications, …).

I would recommend backing up and deleting your /etc/letsencrypt folder and then trying again.


#3

Hi, thanks for your reply.
That’s very odd. Tried what you’ve suggested and it worked. It’s odd because I’ve already tried cleaning it (this is the second clean VM I’m trying to use letsencrypt on).
Thanks!