404 response error acme.errors.ClientError: <Response [404]>

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: kaffeegrün.com

I ran this command:
certbot certonly --manual -d kaffeegrün.com -d *.xn--kaffeegrn-x9a.com --agree-tos --no-bootstrap --manual-public-ip-logging-ok --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directorypo

It produced this output:
An unexpected error occurred:
acme.errors.ClientError: <Response [404]>
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

My web server is (include version):
It is deployed in azure app service.

The operating system my web server runs on is (include version):
ubuntu

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don't know): i don't know

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):
azure app service

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):certbot 1.21.0

the log file created is : /var/log/letsencrypt
2023-12-19 10:15:08,913:DEBUG:certbot._internal.main:certbot version: 1.21.0
2023-12-19 10:15:08,913:DEBUG:certbot._internal.main:Location of certbot entry point: /usr/bin/certbot
2023-12-19 10:15:08,913:DEBUG:certbot._internal.main:Arguments: ['--manual', '-d', 'kaffeegrün.com', '-d', '*.xn--kaffeegrn-x9a.com', '--agree-tos', '--no-bootstrap', '--manual-public-ip-logging-ok', '--preferred-challenges', 'dns-01', '--server', 'https://acme-v02.api.letsencrypt.org/directorypo']
2023-12-19 10:15:08,913:DEBUG:certbot._internal.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#manual,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2023-12-19 10:15:08,921:DEBUG:certbot._internal.log:Root logging level set at 30
2023-12-19 10:15:08,922:DEBUG:certbot._internal.plugins.selection:Requested authenticator manual and installer None
2023-12-19 10:15:08,922:DEBUG:certbot._internal.plugins.selection:Single candidate plugin: * manual
Description: Manual configuration or run your own shell scripts
Interfaces: Authenticator, Plugin
Entry point: manual = certbot._internal.plugins.manual:Authenticator
Initialized: <certbot._internal.plugins.manual.Authenticator object at 0xffff81bd77f0>
Prep: True
2023-12-19 10:15:08,923:DEBUG:certbot._internal.plugins.selection:Selected authenticator <certbot._internal.plugins.manual.Authenticator object at 0xffff81bd77f0> and installer None
2023-12-19 10:15:08,923:INFO:certbot._internal.plugins.selection:Plugins selected: Authenticator manual, Installer None
2023-12-19 10:15:22,286:DEBUG:acme.client:Sending GET request to https://acme-v02.api.letsencrypt.org/directorypo.
2023-12-19 10:15:22,288:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org:443
2023-12-19 10:15:22,796:DEBUG:urllib3.connectionpool:https://acme-v02.api.letsencrypt.org:443 "GET /directorypo HTTP/1.1" 404 19
2023-12-19 10:15:22,797:DEBUG:acme.client:Received response:
HTTP 404
Server: nginx
Date: Tue, 19 Dec 2023 10:15:22 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 19
Connection: keep-alive
X-Content-Type-Options: nosniff

404 page not found

2023-12-19 10:15:22,798:DEBUG:certbot._internal.log:Exiting abnormally:
Traceback (most recent call last):
File "/usr/bin/certbot", line 33, in
sys.exit(load_entry_point('certbot==1.21.0', 'console_scripts', 'certbot')())
File "/usr/lib/python3/dist-packages/certbot/main.py", line 15, in main
return internal_main.main(cli_args)
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 1574, in main
return config.func(config, plugins)
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 1416, in certonly
le_client = _init_le_client(config, auth, installer)
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 763, in _init_le_client
acc, acme = _determine_account(config)
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 680, in _determine_account
acc, acme = client.register(
File "/usr/lib/python3/dist-packages/certbot/_internal/client.py", line 184, in register
acme = acme_from_config_key(config, key)
File "/usr/lib/python3/dist-packages/certbot/_internal/client.py", line 48, in acme_from_config_key
client = acme_client.BackwardsCompatibleClientV2(net, key, config.server)
File "/usr/lib/python3/dist-packages/acme/client.py", line 875, in init
directory = messages.Directory.from_json(net.get(server).json())
File "/usr/lib/python3/dist-packages/acme/client.py", line 1235, in get
return self._check_response(
File "/usr/lib/python3/dist-packages/acme/client.py", line 1134, in _check_response
raise errors.ClientError(response)
acme.errors.ClientError: <Response [404]>
2023-12-19 10:15:22,799:ERROR:certbot._internal.log:An unexpected error occurred:
2023-12-19 10:15:22,800:ERROR:certbot._internal.log:acme.errors.ClientError: <Response [404]>
2023-12-19 10:21:36,686:DEBUG:certbot._internal.main:certbot version: 1.21.0
2023-12-19 10:21:36,686:DEBUG:certbot._internal.main:Location of certbot entry point: /usr/bin/certbot
2023-12-19 10:21:36,686:DEBUG:certbot._internal.main:Arguments: ['--manual', '-d', 'kaffeegrün.com', '-d', '*.xn--kaffeegrn-x9a.com', '--agree-tos', '--no-bootstrap', '--manual-public-ip-logging-ok', '--preferred-challenges', 'dns-01', '--server', 'https://acme-v02.api.letsencrypt.org/directorypo']
2023-12-19 10:21:36,686:DEBUG:certbot._internal.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#manual,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2023-12-19 10:21:36,694:DEBUG:certbot._internal.log:Root logging level set at 30
2023-12-19 10:21:36,695:DEBUG:certbot._internal.plugins.selection:Requested authenticator manual and installer None
2023-12-19 10:21:36,695:DEBUG:certbot._internal.plugins.selection:Single candidate plugin: * manual
Description: Manual configuration or run your own shell scripts
Interfaces: Authenticator, Plugin
Entry point: manual = certbot._internal.plugins.manual:Authenticator
Initialized: <certbot._internal.plugins.manual.Authenticator object at 0xffffae356800>
Prep: True
2023-12-19 10:21:36,695:DEBUG:certbot._internal.plugins.selection:Selected authenticator <certbot._internal.plugins.manual.Authenticator object at 0xffffae356800> and installer None
2023-12-19 10:21:36,695:INFO:certbot._internal.plugins.selection:Plugins selected: Authenticator manual, Installer None
2023-12-19 10:21:47,832:DEBUG:acme.client:Sending GET request to https://acme-v02.api.letsencrypt.org/directorypo.
2023-12-19 10:21:47,834:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org:443
2023-12-19 10:21:48,242:DEBUG:urllib3.connectionpool:https://acme-v02.api.letsencrypt.org:443 "GET /directorypo HTTP/1.1" 404 19
2023-12-19 10:21:48,243:DEBUG:acme.client:Received response:
HTTP 404
Server: nginx
Date: Tue, 19 Dec 2023 10:21:48 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 19
Connection: keep-alive
X-Content-Type-Options: nosniff

404 page not found

2023-12-19 10:21:48,243:DEBUG:certbot._internal.log:Exiting abnormally:
Traceback (most recent call last):
File "/usr/bin/certbot", line 33, in
sys.exit(load_entry_point('certbot==1.21.0', 'console_scripts', 'certbot')())
File "/usr/lib/python3/dist-packages/certbot/main.py", line 15, in main
return internal_main.main(cli_args)
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 1574, in main
return config.func(config, plugins)
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 1416, in certonly
le_client = _init_le_client(config, auth, installer)
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 763, in _init_le_client
acc, acme = _determine_account(config)
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 680, in _determine_account
acc, acme = client.register(
File "/usr/lib/python3/dist-packages/certbot/_internal/client.py", line 184, in register
acme = acme_from_config_key(config, key)
File "/usr/lib/python3/dist-packages/certbot/_internal/client.py", line 48, in acme_from_config_key
client = acme_client.BackwardsCompatibleClientV2(net, key, config.server)
File "/usr/lib/python3/dist-packages/acme/client.py", line 875, in init
directory = messages.Directory.from_json(net.get(server).json())
File "/usr/lib/python3/dist-packages/acme/client.py", line 1235, in get
return self._check_response(
File "/usr/lib/python3/dist-packages/acme/client.py", line 1134, in _check_response
raise errors.ClientError(response)
acme.errors.ClientError: <Response [404]>

The --server value is incorrect: there's no such endpoint as /directorypo. Where does the po come from? And why are you specifying the default --server option anyway? That's not necessary for Certbot.

3 Likes

thanks for the quick reply. the issue is fixed. Thanks once again for helping me. Also as you suggested i will ignore --server.

1 Like

How was it fixed?

1 Like

It's hard to tell from the discourse formatting...
But it should be spelled:
-d xn--kaffeegrn-x9a.com -d *.xn--kaffeegrn-x9a.com

Also...

Doing anything manually is far from ideal.
You should look into automating the whole process.

4 Likes

As @Osiris mentioned that the endpoint was wrong /directorypo.the correct path was /directory
This whole system is build and designed by another team that we have no clue why they went with such manual approach. So, yes you are right we should do an automate approach and that is why we will soon move to a new system that will do this automatically.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.