PDF Document Generation local-only issue

0
When attempting to generate a file on localhost, I receive the following error:"Failed to generate document for request: 3512aeb7-9687-4434-98c4-d2870a532eedDOCGEN_NAVIGATION_ERROR: Failed to navigate to page due to an error: net::ERR_BLOCKED_BY_CLIENT at http://localhost/docgen/generate?id=3512aeb7-9687-4434-98c4-d2870a532eed."This does not occur when deployed to Mendix Cloud.I have attempted to debug using guidance online, but there are no adblockers installed and tried on both company and non-company devices with the same result, so also inclined to eliminate security policies as the cause.
asked
2 answers
0

Hi Owen,

ERR_BLOCKED_BY_CLIENT doesn’t come from adblockers here. The PDF module runs its own headless Chrome with a clean profile, so your extensions are never involved. The error means the request was blocked by the module’s browser itself before it was sent, so the module decided not to open that URL.

The clue is the URL in your error:

http://localhost/docgen/generate?id=...

There’s no port in it. When you run locally, your app is normally at http://localhost:8080 (or another port). The module builds this URL from the app’s Application root URL, so if that setting doesn’t match the address your app actually runs on, the module ends up with a URL it won’t open, and its browser blocks the request. In Mendix Cloud the root URL is always set correctly, which would explain why it only happens locally.

What to check:

  1. In Studio Pro, go to App > Settings > Configurations, edit your active configuration, and check Application root URL. It should match exactly the URL you open the app with, including the port, for example http://localhost:8080.
  2. On the Custom tab of the same configuration, check that there’s no ApplicationRootUrl runtime setting overriding it.
  3. Restart the app and try again.

If your app really does run on port 80 and the root URL already matches, set the log node DocumentGeneration to Trace in the Console and try again. It shows exactly which URL the module tries to open, which should point straight to the cause. Feel free to share that output here.

If this helps, please mark it as the accepted answer.

answered
0

Hi Owen,


Since PDF generation works in Mendix Cloud but fails locally, I would first check the Application Root URL in your local Studio Pro configuration.


The error shows:

http://localhost/docgen/generate?id=...

Notice that the URL has no port number. If your local Mendix runtime runs on port 8080, for example, the expected URL would normally include :8080.

Try these steps:

  1. Open Studio Pro and go to App → Settings → Configurations.
  2. Edit the active configuration and check the Application root URL.
  3. Ensure it matches the exact URL you use to open the application locally. For example, if the runtime is running on port 8080, use http://localhost:8080/.
  4. Check the configuration's Custom tab for a runtime setting named ApplicationRootUrl that might override the configured value.
  5. Restart the local application and test PDF generation again.


If the root URL is already correct, set the DocumentGeneration log node to Trace in the Studio Pro Console, reproduce the error, and inspect the URL the module attempts to open.


Also verify that the local PDF generation prerequisites are configured correctly, including the Chrome or Chromium executable if it is installed in a custom location.


References:


Hope this helps! If you find this answer helpful, please mark it as the accepted answer.

answered