Introduction
The MAX_PAGE_RENDERING_TIME configuration option is available for the Private Document Generation service.
Environment
Portable Document Format (PDF) Document Generation (all versions utilizing the private service offering).
Details
The MAX_PAGE_RENDERING_TIME configuration option sets the maximum time to wait for the page to finish loading and rendering. If loading the page exceeds this time, a Wait for Content exception is sent to the module.
There is a common misconception that this configuration option can be used to extend the default network connection limit. This is not true. While the MAX_PAGE_RENDERING_TIME setting is extended, it is still possible to encounter errors like:
Failed to load page: TimeoutError: waiting for selector #content .document-content failed: timeout 30000ms exceeded
This is because the networking limit is a separate, and intentional, timeout.
Internally there are two budgets:
- A fixed thirty second timeout for the initial page navigation (loading the app Uniform Resource Locator (URL)).
- MAX_PAGE_RENDERING_TIME, which covers everything after the page loads (waiting for the content/.document-content to finish rendering).
MAX_PAGE_RENDERING_TIME doesn't extend the navigation step, which is fixed at thirty seconds by design and is not configurable. When encountering timeout errors like the above while MAX_PAGE_RENDERING_TIME is configured, it is recommended to check why navigating to the page takes more than thirty seconds. For context, a standard navigation is typically under one second. This navigation timeout error points at an issue or slowdown regarding the network path between the Document Generation pod and the Mendix application. Common networking timeout troubleshooting steps include:
- The required Enable PDF export design property is not set to Yes for the page you are trying to export to PDF.
- Loading the page failed or took too much time. When this occurs, verify that the page loads successfully within the fixed timeout of 30 seconds and does not trigger any client errors. To verify this, we recommend temporarily adding the page to, for example, the app navigation.
- A widget or add-on is being used in the index.html file that performs long polling network requests. This is not supported, since the document generation service waits until there are no more pending network requests.
- The configured service user does not have the applicable access rights to run the page microflow. In this case, there should be a warning in the logs mentioning User
<username>attempted to run the microflow with action name<page microflow>, but does not have the required permissions. - Make sure that the module role
Useris assigned to the user who is passed in theGenerate as userproperty of theGenerate PDF from pageaction.
Internal information related
- 288894, 281594
- CJZ85RLTA/p1782228565272569
Additional information
Mendix documentation:
- Private PDF Document Generation // Configuration Options | Mendix Documentation
- PDF Document Generation // Troubleshooting Timeout Errors | Mendix Documentation
0 Comments