Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON-Error in Backend while generating SSL-Certificates #2796

Open
dravorle opened this issue Apr 2, 2023 · 15 comments
Open

JSON-Error in Backend while generating SSL-Certificates #2796

dravorle opened this issue Apr 2, 2023 · 15 comments

Comments

@dravorle
Copy link

dravorle commented Apr 2, 2023

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)

@dravorle dravorle added the bug label Apr 2, 2023
@andzejsp
Copy link

andzejsp commented Apr 7, 2023

smells like #2713

@crosswick
Copy link

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

@andzejsp
Copy link

Lost cause

@crosswick
Copy link

How do you mean? Is NPM practically abandoned?

@andzejsp
Copy link

andzejsp commented 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 :(

@crosswick
Copy link

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

@andzejsp
Copy link

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.

@crosswick
Copy link

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

@andzejsp
Copy link

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 :(

@crosswick
Copy link

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

@andzejsp
Copy link

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

@crosswick
Copy link

2.10.4

@DartLazer
Copy link

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?

@pr0nstache
Copy link

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.

Copy link

github-actions bot commented Jun 7, 2024

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

@github-actions github-actions bot added the stale label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants