Error: An unexpected error occurred: pywintypes.error: (3, 'CreateDirectory', 'Impossibile trovare il percorso specificato.')

Hello i ran Certbot on my windows server with port 80 open.
I get the error: An unexpected error occurred:
pywintypes.error: (3, 'CreateDirectory', 'Impossibile trovare il percorso specificato.') when i run the command: certbot certonly --webroot

This is the log:

2021-11-02 15:26:40,631:DEBUG:certbot._internal.main:certbot version: 1.20.0
2021-11-02 15:26:40,632:DEBUG:certbot._internal.main:Location of certbot entry point: C:\Certbot1\bin\certbot.exe
2021-11-02 15:26:40,632:DEBUG:certbot._internal.main:Arguments: ['--webroot', '-v', '--preconfigured-renewal']
2021-11-02 15:26:40,632:DEBUG:certbot._internal.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#manual,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2021-11-02 15:26:40,689:DEBUG:certbot._internal.log:Exiting abnormally:
Traceback (most recent call last):
File "runpy.py", line 197, in _run_module_as_main
File "runpy.py", line 87, in run_code
File "C:\Certbot1\bin\certbot.exe_main
.py", line 29, in
sys.exit(main())
File "C:\Certbot1\pkgs\certbot\main.py", line 15, in main
return internal_main.main(cli_args)
File "C:\Certbot1\pkgs\certbot_internal\main.py", line 1558, in main
log.post_arg_parse_setup(config)
File "C:\Certbot1\pkgs\certbot_internal\log.py", line 100, in post_arg_parse_setup
file_handler, file_path = setup_log_file_handler(
File "C:\Certbot1\pkgs\certbot_internal\log.py", line 153, in setup_log_file_handler
util.set_up_core_dir(config.logs_dir, 0o700, config.strict_permissions)
File "C:\Certbot1\pkgs\certbot\util.py", line 177, in set_up_core_dir
make_or_verify_dir(directory, mode, strict)
File "C:\Certbot1\pkgs\certbot\util.py", line 200, in make_or_verify_dir
filesystem.makedirs(directory, mode)
File "C:\Certbot1\pkgs\certbot\compat\filesystem.py", line 285, in makedirs
return os.makedirs(file_path, mode)
File "os.py", line 225, in makedirs
File "C:\Certbot1\pkgs\certbot\compat\filesystem.py", line 318, in mkdir
raise err
File "C:\Certbot1\pkgs\certbot\compat\filesystem.py", line 312, in mkdir
win32file.CreateDirectory(file_path, attributes)
pywintypes.error: (3, 'CreateDirectory', 'Impossibile trovare il percorso specificato.')
2021-11-02 15:26:40,690:ERROR:certbot._internal.log:An unexpected error occurred:
2021-11-02 15:26:40,690:ERROR:certbot._internal.log:pywintypes.error: (3, 'CreateDirectory', 'Impossibile trovare il percorso specificato.')

Hi @miclog and welcome to the LE community forum :slight_smile:

Have you tried running certbot from an administrative command prompt?

1 Like

Thank you for your reply, yes I'm using an administrative command prompt

1 Like

Well then...
Q1. What version of certbot are you using?
Q2. Has this ever worked (or is this your first attempt) on this server?
Q3. What permissions are set on the --webroot folder?

1 Like

Is the Cerbot 1.20.0 version
Is the first attempt on this server, this is a windows server.
How can I find where the --webroot folder point?

When you ran:

Did it not prompt you for the webroot path and the domain(s) you want to issue a cert for?

1 Like

Yes when I insert the path after certbot certonly --webroot i get this error:

certbot certonly --webroot

Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: hr.alphateam.it
Type: unauthorized
Detail: Invalid response from http://hr.alphateam.it/.well-known/acme-challenge/ZUuocos_MAeokYcD3sdwxVrwqP7d_1bgUaK-kKHpF6c [37.186.228.38]: "<meta http-equiv="Content-Type" content="text/html;charset=utf-8"><meta name="id" content="siteBlocked">Web S"

Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.

Some challenges have failed.

Please confirm:

  1. that is the correct IP
  2. why it returns "siteBlocked"
  3. you need a functional HTTP site before you can secure it (via HTTP authentication).
  4. the path you entered is the webroot path certbot would need to be able to write the challenge file to.
1 Like

Yes is the correct IP.
I don't know why return site blocked......

I asked 3 questions and you answered one with a question.
I asked you to confirm 4 things and you barely replied to 2 of them.
I guess I will need to spoon feed you one question at a time...

The main problem I see is that you don't have a functional HTTP site:

curl -Ii hr.alphateam.it
HTTP/1.1 403 Forbidden
Content-Type: text/html; charset=utf-8
Window-target: _top
Connection: close

Fix that step and then we'll move on to the next step.

More information for you:


Network Security Appliance

This site has been blocked by the network administrator.

Block reason: Gateway GEO-IP Filter Alert

IP address: [redacted IP]

Connection initiated from country: United States

2 Likes

OK, you're right sorry.
My network admin has blocked the server with ip filter out of Italy.
Now it's ok.
Thank you for all.
Problem solved.

2 Likes

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