Domain: files.oshawk.uk
OS: Ubuntu 18.04
Command: nextcloud.enable-https lets-encrypt
Output:
Attempting to obtain certificates... error running certbot:
Saving debug log to /var/snap/nextcloud/current/certs/certbot/logs/letsencrypt.log
Plugins selected: Authenticator nextcloud:webroot, Installer None
An unexpected error occurred:
ConnectionError: HTTPSConnectionPool(host='acme-v02.api.letsencrypt.org', port=443): Max retries exceeded with url: /directory (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fea5805b710>: Failed to establish a new connection: [Errno -2] Name or service not known',))
Log file:
2018-09-29 11:56:37,946:DEBUG:certbot.main:certbot version: 0.26.1
2018-09-29 11:56:37,947:DEBUG:certbot.main:Arguments: ['--text', '--config-dir', '/var/snap/nextcloud/current/certs/certbot/config', '--work-dir', '/var/snap/nextcloud/current/certs/certbot/work', '--logs-dir', '/var/snap/nextcloud/current/certs/certbot/logs', '--authenticator', 'nextcloud:webroot', '--nextcloud:webroot-path', '/var/snap/nextcloud/current/certs/certbot', '--rsa-key-size', '4096', '--email', 'oshawk@protonmail.com', '--non-interactive', '--agree-tos', '--force-renewal', '-d', 'files.oshawk.uk']
2018-09-29 11:56:37,947:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#manual,PluginEntryPoint#nextcloud:webroot,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2018-09-29 11:56:37,988:DEBUG:certbot.log:Root logging level set at 20
2018-09-29 11:56:37,990:INFO:certbot.log:Saving debug log to /var/snap/nextcloud/current/certs/certbot/logs/letsencrypt.log
2018-09-29 11:56:37,991:DEBUG:certbot.plugins.selection:Requested authenticator nextcloud:webroot and installer None
2018-09-29 11:56:38,002:DEBUG:certbot.plugins.selection:Single candidate plugin: * nextcloud:webroot
Description: Place files in webroot directory without running chown
Interfaces: IAuthenticator, IPlugin
Entry point: webroot = certbot_nextcloud_plugin.webroot:Authenticator
Initialized: <certbot_nextcloud_plugin.webroot.Authenticator object at 0x7fc3c2518f50>
Prep: True
2018-09-29 11:56:38,003:DEBUG:certbot.plugins.selection:Selected authenticator <certbot_nextcloud_plugin.webroot.Authenticator object at 0x7fc3c2518f50> and installer None
2018-09-29 11:56:38,003:INFO:certbot.plugins.selection:Plugins selected: Authenticator nextcloud:webroot, Installer None
2018-09-29 11:56:38,690:DEBUG:acme.client:Sending GET request to https://acme-v02.api.letsencrypt.org/directory.
2018-09-29 11:56:38,697:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org:443
2018-09-29 11:56:38,700:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
File "/snap/nextcloud/8971/bin/certbot", line 11, in <module>
sys.exit(main())
File "/snap/nextcloud/8971/lib/python2.7/site-packages/certbot/main.py", line 1364, in main
return config.func(config, plugins)
File "/snap/nextcloud/8971/lib/python2.7/site-packages/certbot/main.py", line 1238, in certonly
le_client = _init_le_client(config, auth, installer)
File "/snap/nextcloud/8971/lib/python2.7/site-packages/certbot/main.py", line 641, in _init_le_client
acc, acme = _determine_account(config)
File "/snap/nextcloud/8971/lib/python2.7/site-packages/certbot/main.py", line 520, in _determine_account
config, account_storage, tos_cb=_tos_cb)
File "/snap/nextcloud/8971/lib/python2.7/site-packages/certbot/client.py", line 180, in register
acme = acme_from_config_key(config, key)
File "/snap/nextcloud/8971/lib/python2.7/site-packages/certbot/client.py", line 50, in acme_from_config_key
return acme_client.BackwardsCompatibleClientV2(net, key, config.server)
File "/snap/nextcloud/8971/lib/python2.7/site-packages/acme/client.py", line 744, in __init__
directory = messages.Directory.from_json(net.get(server).json())
File "/snap/nextcloud/8971/lib/python2.7/site-packages/acme/client.py", line 1078, in get
self._send_request('GET', url, **kwargs), content_type=content_type)
File "/snap/nextcloud/8971/lib/python2.7/site-packages/acme/client.py", line 1027, in _send_request
response = self.session.request(method, url, *args, **kwargs)
File "/snap/nextcloud/8971/lib/python2.7/site-packages/requests/sessions.py", line 512, in request
resp = self.send(prep, **send_kwargs)
File "/snap/nextcloud/8971/lib/python2.7/site-packages/requests/sessions.py", line 622, in send
r = adapter.send(request, **kwargs)
File "/snap/nextcloud/8971/lib/python2.7/site-packages/requests/adapters.py", line 513, in send
raise ConnectionError(e, request=request)
ConnectionError: HTTPSConnectionPool(host='acme-v02.api.letsencrypt.org', port=443): Max retries exceeded with url: /directory (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc3c2512710>: Failed to establish a new connection: [Errno -2] Name or service not known',))
2018-09-29 11:56:38,703:ERROR:certbot.log:An unexpected error occurred:
Attempts to fix:
- Changing dns server to
8.8.8.8
. - Running
curl https://acme-v02.api.letsencrypt.org/directory
(produces expected output of some JSON).
Things to note:
- I have a sucessfully generated cert for blog.oshawk.uk on another server.
Thanks for any help.