Introduction
This article explains how to resolve the following error when generating a PDF using the Document Generation module in a Mendix Cloud environment:
DOCGEN_NAVIGATION_ERROR: Failed to navigate to page due to an invalid response code: 403.The application may generate documents successfully in a local environment but fail in Mendix Cloud when the Document Generation module cannot access the page used to render the PDF.
Environment
- Studio Pro (all versions)
- Applications hosted in Mendix Cloud
Instructions/Procedure
The Document Generation module accesses the target page through the /p/ path to render the page content before generating the PDF.
Configure the /p/ path to allow access from the Document Generation service by completing the following steps:
- Sign in to the Mendix Portal.
- Navigate to the target environment.
- Go to Network > Path-Based Access Restrictions.
- Locate the
/p/path. - If the
/p/path does not exist, add it. - Set the access level for the
/p/path to Allow all access. - Save the configuration.
- Restart or redeploy the environment if required.
- Generate the PDF again.
If the issue persists, verify the following configuration as per the documentation.
- The environment is registered correctly for Document Generation.
- The required module roles are assigned.
- Scheduled events are enabled when required by the implementation.
- The
/docgen/path is configured correctly. - The
/p/path is configured with Allow all access.
Outcome
The Document Generation module can access the target page through the /p/ path and successfully generate the PDF without the following error:
DOCGEN_NAVIGATION_ERROR: Failed to navigate to page due to an invalid response code: 403.Internal information related
- 278515, 278515
Additional information
Related KBA: PDF Document Generation Troubleshooting
0 Comments