<-- Back

How to resolve PDF Document Generation 403 errors caused by path-based access restrictions

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:

  1. Sign in to the Mendix Portal.
  2. Navigate to the target environment.
  3. Go to Network > Path-Based Access Restrictions.
  4. Locate the /p/ path.
  5. If the /p/ path does not exist, add it.
  6. Set the access level for the /p/ path to Allow all access.
  7. Save the configuration.
  8. Restart or redeploy the environment if required.
  9. 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

Have more questions? Submit a request

0 Comments

Article is closed for comments.

To provide feedback, please open a ticket here. Don't forget to include the article's URL along with the feedback you would like to provide.