[GH-ISSUE #747] Internal Error creating SSL #631

Closed
opened 2026-02-26 06:33:45 +03:00 by kerem · 13 comments
Owner

Originally created by @magicman32 on GitHub (Nov 30, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/747

Checklist

When creating a proxy host, I get an internal error and ssl is not created, new to docker, learning as I go

This pic is when I try to create host proxy with ssl.............
npm-ssl-error2

This pic is when I try to create ssl on its own without creating a host proxy...............
npm-error3

Some of the text is cut out....here is full log......
Error: Command failed: /usr/bin/certbot certonly --non-interactive --config "/etc/letsencrypt.ini" --cert-name "npm-12" --agree-tos --email "magicman32.craig@gmail.com" --preferred-challenges "dns,http" --domains "books.beastunraid.me"
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for books.beastunraid.me
Using the webroot path /data/letsencrypt-acme-challenge for all unmatched domains.
Waiting for verification...
Challenge failed for domain books.beastunraid.me
http-01 challenge for books.beastunraid.me
Cleaning up challenges
Some challenges have failed.

at ChildProcess.exithandler (child_process.js:308:12)
at ChildProcess.emit (events.js:314:20)
at maybeClose (internal/child_process.js:1051:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
Originally created by @magicman32 on GitHub (Nov 30, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/747 **Checklist** - Please read the [setup instructions](https://nginxproxymanager.com/setup/) - Please read the [FAQ](https://nginxproxymanager.com/faq/) **When creating a proxy host, I get an internal error and ssl is not created, new to docker, learning as I go** This pic is when I try to create host proxy with ssl............. ![npm-ssl-error2](https://user-images.githubusercontent.com/15340872/100572799-7a64c700-332a-11eb-9c4e-0cbd77138cca.png) This pic is when I try to create ssl on its own without creating a host proxy............... ![npm-error3](https://user-images.githubusercontent.com/15340872/100573174-4f2ea780-332b-11eb-949b-1c815c67e2ae.png) Some of the text is cut out....here is full log...... Error: Command failed: /usr/bin/certbot certonly --non-interactive --config "/etc/letsencrypt.ini" --cert-name "npm-12" --agree-tos --email "magicman32.craig@gmail.com" --preferred-challenges "dns,http" --domains "books.beastunraid.me" Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator webroot, Installer None Obtaining a new certificate Performing the following challenges: http-01 challenge for books.beastunraid.me Using the webroot path /data/letsencrypt-acme-challenge for all unmatched domains. Waiting for verification... Challenge failed for domain books.beastunraid.me http-01 challenge for books.beastunraid.me Cleaning up challenges Some challenges have failed. at ChildProcess.exithandler (child_process.js:308:12) at ChildProcess.emit (events.js:314:20) at maybeClose (internal/child_process.js:1051:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
kerem 2026-02-26 06:33:45 +03:00
Author
Owner

@magicman32 commented on GitHub (Dec 15, 2020):

anyone??

<!-- gh-comment-id:745169983 --> @magicman32 commented on GitHub (Dec 15, 2020): anyone??
Author
Owner

@rmensing commented on GitHub (Dec 15, 2020):

As far as I am aware you must select "Use a DNS challenge" otherwise CertBot tries to use the HTTP-01 challenge which would require NPM to have access to the webroot of the server you are trying to get a cert for and I'm willing to bet that it does not have that access.

Switch on "Use a DNS challenge" then select your DNS provider, if it is on the list, then it will probably need and API token that you will get from your DNS provider. If your DNS provider is not on the list then you may need to switch to one that is. Cloudflare and probably others have free accounts available.

<!-- gh-comment-id:745612288 --> @rmensing commented on GitHub (Dec 15, 2020): As far as I am aware you must select "Use a DNS challenge" otherwise CertBot tries to use the HTTP-01 challenge which would require NPM to have access to the webroot of the server you are trying to get a cert for and I'm willing to bet that it does not have that access. Switch on "Use a DNS challenge" then select your DNS provider, if it is on the list, then it will probably need and API token that you will get from your DNS provider. If your DNS provider is not on the list then you may need to switch to one that is. Cloudflare and probably others have free accounts available.
Author
Owner

@magicman32 commented on GitHub (Dec 16, 2020):

npm-dns-challenge
Im with cloudflare, am I putting in my global api key? sorry noob at this stuff
or do I need to create an api token?

<!-- gh-comment-id:745864657 --> @magicman32 commented on GitHub (Dec 16, 2020): ![npm-dns-challenge](https://user-images.githubusercontent.com/15340872/102320164-0ab03680-3fd0-11eb-82ac-dae58dc719a8.png) Im with cloudflare, am I putting in my global api key? sorry noob at this stuff or do I need to create an api token?
Author
Owner

@rmensing commented on GitHub (Dec 16, 2020):

You will need to create an API token. Use the "edit zone DNS" template. Make note of the created token as once you close it you will not be able to view the token again.

The global API key no longer works for this. Funny thing is that this is why I was here and saw your post. I was using the global key in some of mine and was getting a similar error when trying to renew. Switching to a created token resolved my issue.

<!-- gh-comment-id:746234916 --> @rmensing commented on GitHub (Dec 16, 2020): You will need to create an API token. Use the "edit zone DNS" template. Make note of the created token as once you close it you will not be able to view the token again. The global API key no longer works for this. Funny thing is that this is why I was here and saw your post. I was using the global key in some of mine and was getting a similar error when trying to renew. Switching to a created token resolved my issue.
Author
Owner

@magicman32 commented on GitHub (Dec 17, 2020):

Ok got my edit zone dns api token
What do I need to put in Credentials File content section, im not sure what to add or replace or change there?

<!-- gh-comment-id:747289688 --> @magicman32 commented on GitHub (Dec 17, 2020): Ok got my edit zone dns api token What do I need to put in Credentials File content section, im not sure what to add or replace or change there?
Author
Owner

@chris1668 commented on GitHub (Dec 19, 2020):

I just tried to use Cloudflare DNS Challenge and it seems the Docker Image from JLesage does not have the Cloudflare-DNS module installed, so after running pip3 install certbot-dns-cloudflare==1.8.0
matching the version from the internal error message has now lead me to this Command Failed Error with no obvious reason standing out to me.
`Error: Command failed: /usr/bin/certbot certonly --non-interactive --cert-name "npm-15" --agree-tos --email "" --domains "*.example.com" --authenticator dns-cloudflare --dns-cloudflare-credentials "/etc/letsencrypt/credentials/credentials-15"
Traceback (most recent call last):
File "/usr/bin/certbot", line 11, in
load_entry_point('certbot==1.4.0', 'console_scripts', 'certbot')()
File "/usr/lib/python3.8/site-packages/certbot/main.py", line 15, in main
return internal_main.main(cli_args)
File "/usr/lib/python3.8/site-packages/certbot/_internal/main.py", line 1315, in main
log.pre_arg_parse_setup()
File "/usr/lib/python3.8/site-packages/certbot/_internal/log.py", line 55, in pre_arg_parse_setup
temp_handler = TempHandler()
File "/usr/lib/python3.8/site-packages/certbot/_internal/log.py", line 243, in init
stream = util.safe_open(self.path, mode='w', chmod=0o600)
File "/usr/lib/python3.8/site-packages/certbot/util.py", line 197, in safe_open
fd = filesystem.open(path, os.O_CREAT | os.O_EXCL | os.O_RDWR, *open_args)
File "/usr/lib/python3.8/site-packages/certbot/compat/filesystem.py", line 149, in open
return os.open(file_path, flags, mode)
PermissionError: [Errno 13] Permission denied: '/tmp/tmpyp2bcu3c/log'

at ChildProcess.exithandler (child_process.js:303:12)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)`

dns_challenege_error

<!-- gh-comment-id:748427583 --> @chris1668 commented on GitHub (Dec 19, 2020): I just tried to use Cloudflare DNS Challenge and it seems the Docker Image from JLesage does not have the Cloudflare-DNS module installed, so after running `pip3 install certbot-dns-cloudflare==1.8.0` matching the version from the internal error message has now lead me to this Command Failed Error with no obvious reason standing out to me. `Error: Command failed: /usr/bin/certbot certonly --non-interactive --cert-name "npm-15" --agree-tos --email "" --domains "*.example.com" --authenticator dns-cloudflare --dns-cloudflare-credentials "/etc/letsencrypt/credentials/credentials-15" Traceback (most recent call last): File "/usr/bin/certbot", line 11, in load_entry_point('certbot==1.4.0', 'console_scripts', 'certbot')() File "/usr/lib/python3.8/site-packages/certbot/main.py", line 15, in main return internal_main.main(cli_args) File "/usr/lib/python3.8/site-packages/certbot/_internal/main.py", line 1315, in main log.pre_arg_parse_setup() File "/usr/lib/python3.8/site-packages/certbot/_internal/log.py", line 55, in pre_arg_parse_setup temp_handler = TempHandler() File "/usr/lib/python3.8/site-packages/certbot/_internal/log.py", line 243, in __init__ stream = util.safe_open(self.path, mode='w', chmod=0o600) File "/usr/lib/python3.8/site-packages/certbot/util.py", line 197, in safe_open fd = filesystem.open(path, os.O_CREAT | os.O_EXCL | os.O_RDWR, *open_args) File "/usr/lib/python3.8/site-packages/certbot/compat/filesystem.py", line 149, in open return os.open(file_path, flags, mode) PermissionError: [Errno 13] Permission denied: '/tmp/tmpyp2bcu3c/log' at ChildProcess.exithandler (child_process.js:303:12) at ChildProcess.emit (events.js:315:20) at maybeClose (internal/child_process.js:1021:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)` ![dns_challenege_error](https://user-images.githubusercontent.com/3466448/102682892-bea4f380-4181-11eb-9926-b048e39dba43.png)
Author
Owner

@magicman32 commented on GitHub (Dec 19, 2020):

You will need to create an API token. Use the "edit zone DNS" template. Make note of the created token as once you close it you will not be able to view the token again.

The global API key no longer works for this. Funny thing is that this is why I was here and saw your post. I was using the global key in some of mine and was getting a similar error when trying to renew. Switching to a created token resolved my issue.

Did that, what next?
Ok got my edit zone dns api token
What do I need to put in Credentials File content section, im not sure what to add or replace or change there?

<!-- gh-comment-id:748441261 --> @magicman32 commented on GitHub (Dec 19, 2020): > You will need to create an API token. Use the "edit zone DNS" template. Make note of the created token as once you close it you will not be able to view the token again. > > The global API key no longer works for this. Funny thing is that this is why I was here and saw your post. I was using the global key in some of mine and was getting a similar error when trying to renew. Switching to a created token resolved my issue. Did that, what next? Ok got my edit zone dns api token What do I need to put in Credentials File content section, im not sure what to add or replace or change there?
Author
Owner

@magicman32 commented on GitHub (Dec 22, 2020):

@rmensing

<!-- gh-comment-id:749401105 --> @magicman32 commented on GitHub (Dec 22, 2020): @rmensing
Author
Owner

@rmensing commented on GitHub (Dec 22, 2020):

Sorry for the delay @magicman32 .
Just replace everything after the = sign with the API token. Leave the propagation seconds box empty, the default works fine. Click the I Agree switch and then click save. It should pull a cert without error. I had the NPM log open in a second window so I could watch what it was doing live. I use Portainer which makes watching the log easier.

<!-- gh-comment-id:749804689 --> @rmensing commented on GitHub (Dec 22, 2020): Sorry for the delay @magicman32 . Just replace everything after the = sign with the API token. Leave the **propagation seconds** box empty, the default works fine. Click the **I Agree** switch and then click **save**. It should pull a cert without error. I had the NPM log open in a second window so I could watch what it was doing live. I use Portainer which makes watching the log easier.
Author
Owner

@rmensing commented on GitHub (Dec 22, 2020):

@chris1668
My first suggestion would be to try using the official Docker container jc21/nginx-proxy-manager because it is already setup to run certbot as well as being more current than the other. The official container right now was updated 8 days ago and the one you are using is a month old.

I am not a dev on this, just another user like you :) but, to me, it looks like there is a problem with permissions in the container so the app is unable to write to a file it needs. This is why I suggest trying the official container.

<!-- gh-comment-id:749809362 --> @rmensing commented on GitHub (Dec 22, 2020): @chris1668 My first suggestion would be to try using the official Docker container [jc21/nginx-proxy-manager](https://hub.docker.com/r/jc21/nginx-proxy-manager) because it is already setup to run certbot as well as being more current than the other. The official container right now was updated 8 days ago and the one you are using is a month old. I am not a dev on this, just another user like you :) but, to me, it looks like there is a problem with permissions in the container so the app is unable to write to a file it needs. This is why I suggest trying the official container.
Author
Owner

@magicman32 commented on GitHub (Dec 23, 2020):

Ok, so I was able to create an ssl, but when I goto host address, I get welcome to our sever, confused, not sure if I have missed something

<!-- gh-comment-id:749914872 --> @magicman32 commented on GitHub (Dec 23, 2020): Ok, so I was able to create an ssl, but when I goto host address, I get welcome to our sever, confused, not sure if I have missed something
Author
Owner

@magicman32 commented on GitHub (Dec 28, 2020):

@rmensing

<!-- gh-comment-id:751591654 --> @magicman32 commented on GitHub (Dec 28, 2020): @rmensing
Author
Owner

@rmensing commented on GitHub (Dec 28, 2020):

Not certain but it sounds like you are ending up on the non-ssl (HTTP) page. You should be able to tell by if it has the lock icon before the URL in the address bar.

Why it is doing this is dependent on the server you are proxying and its configuration and possibly other factors.

As a basic example:
I have servers that only server content un-secure on port 80 or some other port so I set the Forward Hostname/IP and Forward Port to those.

I have some that only serve content on a secure port (443) already so I use that port on the Forward Port On some of these I have had the server show the default web server welcome page on port 80 and the actual content on port 443. This is what it seems like it could be to me.

<!-- gh-comment-id:751805180 --> @rmensing commented on GitHub (Dec 28, 2020): Not certain but it sounds like you are ending up on the non-ssl (HTTP) page. You should be able to tell by if it has the lock icon before the URL in the address bar. Why it is doing this is dependent on the server you are proxying and its configuration and possibly other factors. As a basic example: I have servers that only server content un-secure on port 80 or some other port so I set the **Forward Hostname/IP** and **Forward Port** to those. I have some that only serve content on a secure port (443) already so I use that port on the **Forward Port** On some of these I have had the server show the default web server welcome page on port 80 and the actual content on port 443. This is what it seems like it could be to me.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#631
No description provided.