Private PDF Document Generation Service Error

0
Hello, I try to use the pdf generation module using the "private" mode (https://docs.mendix.com/appstore/services/private-document-generation-service/)   I want to test it in localhost to see if it's working. but I get this error in the docker terminal : 2025-10-19T12:46:25.150Z | DOCGEN_NAVIGATION_ERROR: Failed to navigate to page: Error: net::ERR_CONNECTION_REFUSED at http://localhost:8082/docgen/generate?id=fdcd56d8-e279-4276-b497-6e6569937c832025-10-19T12:46:25.150Z | Send error: 20.096ms2025-10-19T12:46:25.171Z | Failed to send error: connect ECONNREFUSED ::1:8082   (and I get timeout error in mendix)   My docker run on port 8085 my mendix app on port 8082   constants are set as follow :  DocumentGeneration.ServiceEndpoint : http://localhost:8085 DocumentGeneration.OverrideServiceType : Private   Does someone have a clue why I have this error?    Thanks!
asked
1 answers
1

The Problem

  • You run Mendix app → port 8082

  • You run DocGen Docker → port 8085

  • Error:

    net::ERR_CONNECTION_REFUSED at http://localhost:8082

  • Inside Docker, localhost ≠ your host machine → container can’t reach the Mendix app.

The Fix (step-by-step)

  1. Keep Mendix running on port 8082.

  2. Start Docker with host access

    1. docker run -p 8085:8085 --add-host=host.docker.internal:host-gateway mendix/docgen:latest

  3. In Mendix constants

    DocumentGeneration.ServiceEndpoint = http://localhost:8085 DocumentGeneration.OverrideServiceType = Private DocumentGeneration.MendixAppUrl = http://host.docker.internal:8082

  4. Why this works

    • host.docker.internal lets the container reach your host’s Mendix runtime.

    • Before, localhost pointed to the container itself → refused connection.

  5. Optional

    • If IPv6 still causes issues, force IPv4: http://127.0.0.1:8082.

    • Ensure both ports (8082 + 8085) are open and not firewalled.

answered