[GH-ISSUE #2796] JSON-Error in Backend while generating SSL-Certificates #1923

Open
opened 2026-02-26 07:33:15 +03:00 by kerem · 18 comments
Owner

Originally created by @dravorle on GitHub (Apr 2, 2023).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2796

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug

I am unable to create an SSL certificate for my websites. The API simply returns a 502-Error after a while, showing the message "Communication with the API failed, is NPM running correctly?".
In the Docker-Logs I can see that it fails with the following:

[4/2/2023] [8:38:23 PM] [SSL      ] › ℹ  info      Testing http challenge for domain.de
Uncaught SyntaxError: Unexpected token < in JSON at position 5
FROM
bash: line 1:   134 Trace/breakpoint trap   (core dumped) node --abort_on_uncaught_exception --max_old_space_size=250 index.js
❯ Starting backend ...

If I try a subdomain it fails with another JSON-Error:

[4/2/2023] [8:50:06 PM] [SSL      ] › ℹ  info      Testing http challenge for test.domain.de
Uncaught SyntaxError: Unexpected end of JSON input
FROM
bash: line 1:   126 Trace/breakpoint trap   (core dumped) node --abort_on_uncaught_exception --max_old_space_size=250 index.js
❯ Starting backend ...

I am using the following Compose within a Portainer-Stack:

version: '3.8'
services:
  app:
    container_name: NginxProxyManager
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      # These ports are in format <host-port>:<container-port>
      - '80:80' # Public HTTP Port
      - '443:443' # Public HTTPS Port
      - '127.0.0.1:81:81' # Admin Web Port # I have tried exposing the port completely, but thats not the problem.
      # Add any other Stream port you want to expose
      # - '21:21' # FTP

    # Uncomment the next line if you uncomment anything in the section
    # environment:
      # Uncomment this if you want to change the location of
      # the SQLite DB file within the container
      # DB_SQLITE_FILE: "/data/database.sqlite"

      # Uncomment this if IPv6 is not enabled on your host
      # DISABLE_IPV6: 'true'

    volumes:
      - /Docker/nginx-proxy-manager/data:/data
      - /Docker/nginx-proxy-manager/letsencrypt:/etc/letsencrypt

networks:
  default:
    external: true
    name: Nginx-Proxy

I have no idea whats going on, especially because I haven't seen someone have this error before. Everything else works perfectly fine, just anything concerning SSL-Certs is not working. I've also tried previous versions, which result in the same error.

Nginx Proxy Manager Version

2.10.2 (and previous ones)

Originally created by @dravorle on GitHub (Apr 2, 2023). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2796 <!-- Are you in the right place? - If you are looking for support on how to get your upstream server forwarding, please consider asking the community on Reddit. - If you are writing code changes to contribute and need to ask about the internals of the software, Gitter is the best place to ask. - If you think you found a bug with NPM (not Nginx, or your upstream server or MySql) then you are in the *right place.* --> **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - Yes - Are you sure you're not using someone else's docker image? - Yes - Have you searched for similar issues (both open and closed)? - Yes **Describe the bug** <!-- A clear and concise description of what the bug is. --> I am unable to create an SSL certificate for my websites. The API simply returns a 502-Error after a while, showing the message "Communication with the API failed, is NPM running correctly?". In the Docker-Logs I can see that it fails with the following: ``` [4/2/2023] [8:38:23 PM] [SSL ] › ℹ info Testing http challenge for domain.de Uncaught SyntaxError: Unexpected token < in JSON at position 5 FROM bash: line 1: 134 Trace/breakpoint trap (core dumped) node --abort_on_uncaught_exception --max_old_space_size=250 index.js ❯ Starting backend ... ``` If I try a subdomain it fails with another JSON-Error: ``` [4/2/2023] [8:50:06 PM] [SSL ] › ℹ info Testing http challenge for test.domain.de Uncaught SyntaxError: Unexpected end of JSON input FROM bash: line 1: 126 Trace/breakpoint trap (core dumped) node --abort_on_uncaught_exception --max_old_space_size=250 index.js ❯ Starting backend ... ``` I am using the following Compose within a Portainer-Stack: ``` version: '3.8' services: app: container_name: NginxProxyManager image: 'jc21/nginx-proxy-manager:latest' restart: unless-stopped ports: # These ports are in format <host-port>:<container-port> - '80:80' # Public HTTP Port - '443:443' # Public HTTPS Port - '127.0.0.1:81:81' # Admin Web Port # I have tried exposing the port completely, but thats not the problem. # Add any other Stream port you want to expose # - '21:21' # FTP # Uncomment the next line if you uncomment anything in the section # environment: # Uncomment this if you want to change the location of # the SQLite DB file within the container # DB_SQLITE_FILE: "/data/database.sqlite" # Uncomment this if IPv6 is not enabled on your host # DISABLE_IPV6: 'true' volumes: - /Docker/nginx-proxy-manager/data:/data - /Docker/nginx-proxy-manager/letsencrypt:/etc/letsencrypt networks: default: external: true name: Nginx-Proxy ``` I have no idea whats going on, especially because I haven't seen someone have this error before. Everything else works perfectly fine, just anything concerning SSL-Certs is not working. I've also tried previous versions, which result in the same error. **Nginx Proxy Manager Version** <!-- What version of Nginx Proxy Manager is reported on the login page? --> 2.10.2 (and previous ones)
Author
Owner

@andzejsp commented on GitHub (Apr 7, 2023):

smells like #2713

<!-- gh-comment-id:1500054074 --> @andzejsp commented on GitHub (Apr 7, 2023): smells like #2713
Author
Owner

@crosswick commented on GitHub (Sep 13, 2023):

I seemingly have the exact same issue with a completely vanilla and by-the-books default install. Docker hello-world test works, NPM administration panel works, DNS domain works (can reach the Apache2 Ubuntu Default Page), but for the life of me I cannot get Test Server Reachability to work when trying to get an SSL certificate. Please help

<!-- gh-comment-id:1717236137 --> @crosswick commented on GitHub (Sep 13, 2023): I seemingly have the exact same issue with a completely vanilla and by-the-books default install. Docker hello-world test works, NPM administration panel works, DNS domain works (can reach the Apache2 Ubuntu Default Page), but for the life of me I cannot get Test Server Reachability to work when trying to get an SSL certificate. Please help
Author
Owner

@andzejsp commented on GitHub (Sep 13, 2023):

Lost cause

<!-- gh-comment-id:1717239599 --> @andzejsp commented on GitHub (Sep 13, 2023): Lost cause
Author
Owner

@crosswick commented on GitHub (Sep 13, 2023):

How do you mean? Is NPM practically abandoned?

<!-- gh-comment-id:1717241472 --> @crosswick commented on GitHub (Sep 13, 2023): How do you mean? Is NPM practically abandoned?
Author
Owner

@andzejsp commented on GitHub (Sep 13, 2023):

idk what seems to be the problem, but the newer version of nginxproxymanager seems to throw this error, while older ( the one im running in my lab v2.9.18) seems to work fine.

EDIT:

Oh well.. just tested and yes, its not working on my end anymore :(

<!-- gh-comment-id:1717246199 --> @andzejsp commented on GitHub (Sep 13, 2023): idk what seems to be the problem, but the newer version of nginxproxymanager seems to throw this error, while older ( the one im running in my lab v2.9.18) seems to work fine. EDIT: Oh well.. just tested and yes, its not working on my end anymore :(
Author
Owner

@crosswick commented on GitHub (Sep 13, 2023):

I see... and you thought it might have to do with #2713 ?

<!-- gh-comment-id:1717264674 --> @crosswick commented on GitHub (Sep 13, 2023): I see... and you thought it might have to do with #2713 ?
Author
Owner

@andzejsp commented on GitHub (Sep 13, 2023):

I see... and you thought it might have to do with #2713 ?

I just tried the following:
Go to ssl cert tab (stand alone cert tab in the main page), delete old cert, go to Hosts tab, edit your proxy host, in the ssl tab under that proxy host dont force ssl, and just request new ssl cert. this worked for me just now.

Was reading up on #2011 and #3121, the first one helped, havent treid the new PR docker image that is the second one.

<!-- gh-comment-id:1717273663 --> @andzejsp commented on GitHub (Sep 13, 2023): > I see... and you thought it might have to do with #2713 ? I just tried the following: Go to ssl cert tab (stand alone cert tab in the main page), delete old cert, go to Hosts tab, edit your proxy host, in the ssl tab under that proxy host dont force ssl, and just request new ssl cert. this worked for me just now. Was reading up on #2011 and #3121, the first one helped, havent treid the new PR docker image that is the second one.
Author
Owner

@crosswick commented on GitHub (Sep 13, 2023):

that just yields an Internal Error for me - the docker log mentions that 'some challenges have failed' and suggests contacting the letsencrypt community

<!-- gh-comment-id:1717285538 --> @crosswick commented on GitHub (Sep 13, 2023): that just yields an `Internal Error` for me - the docker log mentions that 'some challenges have failed' and suggests contacting the letsencrypt community
Author
Owner

@andzejsp commented on GitHub (Sep 13, 2023):

that just yields an Internal Error for me - the docker log mentions that 'some challenges have failed' and suggests contacting the letsencrypt community

maybe youre on later veresions, than what i am right now, thats why its throwing you something else.

might be worth looking into using caddy

https://caddyserver.com/docs/

im not associated with caddy but seems pretty hassle free. only downside - no frontend :(

<!-- gh-comment-id:1717295023 --> @andzejsp commented on GitHub (Sep 13, 2023): > that just yields an `Internal Error` for me - the docker log mentions that 'some challenges have failed' and suggests contacting the letsencrypt community maybe youre on later veresions, than what i am right now, thats why its throwing you something else. might be worth looking into using caddy https://caddyserver.com/docs/ im not associated with caddy but seems pretty hassle free. only downside - no frontend :(
Author
Owner

@crosswick commented on GitHub (Sep 13, 2023):

I am on the version that was installed automatically by copy-pasting the docker-compose.yml text from the site today.

<!-- gh-comment-id:1717353718 --> @crosswick commented on GitHub (Sep 13, 2023): I am on the version that was installed automatically by copy-pasting the docker-compose.yml text from the site today.
Author
Owner

@andzejsp commented on GitHub (Sep 13, 2023):

I am on the version that was installed automatically by copy-pasting the docker-compose.yml text from the site today.

when you open manager page it should show the version

image

<!-- gh-comment-id:1717375187 --> @andzejsp commented on GitHub (Sep 13, 2023): > I am on the version that was installed automatically by copy-pasting the docker-compose.yml text from the site today. when you open manager page it should show the version ![image](https://github.com/NginxProxyManager/nginx-proxy-manager/assets/80409979/3604b559-c340-460d-8566-f9b25dec79a5)
Author
Owner

@crosswick commented on GitHub (Sep 13, 2023):

2.10.4

<!-- gh-comment-id:1717382874 --> @crosswick commented on GitHub (Sep 13, 2023): 2.10.4
Author
Owner

@DartLazer commented on GitHub (Sep 21, 2023):

I have the same issue. But it only does this for one of my domains, not all of them.

When I try to test the server reachability I get another error
nginx-proxy-manager-app-1 | [9/21/2023] [9:37:25 AM] [SSL ] › ℹ info Testing http challenge for hvcao.nl nginx-proxy-manager-app-1 | Uncaught SyntaxError: Unexpected end of JSON input

And this error on the UI Communication with the API failed, is NPM running correctly?

<!-- gh-comment-id:1729225035 --> @DartLazer commented on GitHub (Sep 21, 2023): I have the same issue. But it only does this for one of my domains, not all of them. When I try to test the server reachability I get another error `nginx-proxy-manager-app-1 | [9/21/2023] [9:37:25 AM] [SSL ] › ℹ info Testing http challenge for hvcao.nl nginx-proxy-manager-app-1 | Uncaught SyntaxError: Unexpected end of JSON input ` And this error on the UI `Communication with the API failed, is NPM running correctly?`
Author
Owner

@pr0nstache commented on GitHub (Oct 20, 2023):

I see... and you thought it might have to do with #2713 ?

I just tried the following: Go to ssl cert tab (stand alone cert tab in the main page), delete old cert, go to Hosts tab, edit your proxy host, in the ssl tab under that proxy host dont force ssl, and just request new ssl cert. this worked for me just now.

Was reading up on #2011 and #3121, the first one helped, havent treid the new PR docker image that is the second one.

Thanks for this! Same error for me as everyone else from the "SSL tab" but from the Hosts tab> ssl tab> request new...
worked for me without error.

<!-- gh-comment-id:1771903040 --> @pr0nstache commented on GitHub (Oct 20, 2023): > > I see... and you thought it might have to do with #2713 ? > > I just tried the following: Go to ssl cert tab (stand alone cert tab in the main page), delete old cert, go to Hosts tab, edit your proxy host, in the ssl tab under that proxy host dont force ssl, and just request new ssl cert. this worked for me just now. > > Was reading up on #2011 and #3121, the first one helped, havent treid the new PR docker image that is the second one. Thanks for this! Same error for me as everyone else from the "SSL tab" but from the Hosts tab> ssl tab> request new... worked for me without error.
Author
Owner

@github-actions[bot] commented on GitHub (Jun 7, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:2153712126 --> @github-actions[bot] commented on GitHub (Jun 7, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@sgeerish commented on GitHub (Jul 29, 2024):

Happens if one of the proxy host destination is not reachable.
Delete the unreachable host and you won't get the error.

<!-- gh-comment-id:2256077438 --> @sgeerish commented on GitHub (Jul 29, 2024): Happens if one of the proxy host destination is not reachable. Delete the unreachable host and you won't get the error.
Author
Owner

@dravorle commented on GitHub (Jul 29, 2024):

Happens if one of the proxy host destination is not reachable. Delete the unreachable host and you won't get the error.

Not sure if it also happens when that condition is true but back when I created this issue it happened on a blank install while creating a first certificate for a route from within the creation form of said route.

So there were no proxy hosts even active or created

<!-- gh-comment-id:2256759198 --> @dravorle commented on GitHub (Jul 29, 2024): > Happens if one of the proxy host destination is not reachable. Delete the unreachable host and you won't get the error. Not sure if it also happens when that condition is true but back when I created this issue it happened on a blank install while creating a first certificate for a route from within the creation form of said route. So there were no proxy hosts even active or created
Author
Owner

@github-actions[bot] commented on GitHub (Jun 10, 2025):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:2957492331 --> @github-actions[bot] commented on GitHub (Jun 10, 2025): Issue is now considered stale. If you want to keep it open, please comment :+1:
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#1923
No description provided.