DOCGEN_NAVIGATION_ERROR: Failed to generate document due to an external redirect to SSO Endpoint
0
I am using DocGen module v1.11.2 with SAML2.0 module v4.0.2 in Studio Pro v10.18.6. I have a microflow where I generate a pdf from a page. In the settings for this activity, I generate as the user $currentUser. After registering my app and attempting to run this microflow in the public cloud, I get this error: Connector: An error has occurred while handling the request. [User 'MxAdmin' with session id '9a0e38b4-XXXX-XXXX-XXXX-XXXXXXXXc190' and roles 'Administrator'] 11:13:28 AMruntime-container/7flfqcom.mendix.webui.WebUIException: Exception while executing runtime operation 11:13:28 AMruntime-container/7flfqat com.mendix.webui.actions.client.RuntimeOperationAction.$anonfun$apply$1(RuntimeOperationAction.scala:59) 11:13:28 AMruntime-container/7flfq2025-08-14T17:13:28.461077318Z 11:13:28 AMruntime-container/7flfq Caused by: com.mendix.modules.microflowengine.MicroflowException: com.mendix.systemwideinterfaces.MendixRuntimeException: documentgeneration.implementation.exceptions.DocGenNavigationException: Failed to generate document for request: 483ef934-0212-4f1b-ae34-0702d09a63be 11:13:28 AMruntime-container/7flfqDOCGEN_NAVIGATION_ERROR: Failed to generate document due to an external redirect to: "https://<sso-site>/SAML2/POST/SSO". 11:13:28 AMruntime-container/7flfqat UniformRequestForm.ACT_GeneratePDF (JavaAction : 'Generate PDF from page') 11:13:28 AMruntime-container/7flfq2025-08-14T17:13:28.461130179Z 11:13:28 AMruntime-container/7flfqAdvanced stacktrace: 11:13:28 AMruntime-container/7flfqat com.mendix.modules.microflowengine.MicroflowUtil$.processException(MicroflowUtil.scala:73) 11:13:28 AMruntime-container/7flfq2025-08-14T17:13:28.461162940Z 11:13:28 AMruntime-container/7flfq Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: documentgeneration.implementation.exceptions.DocGenNavigationException: Failed to generate document for request: 483ef934-0212-4f1b-ae34-0702d09a63be 11:13:28 AMruntime-container/7flfqDOCGEN_NAVIGATION_ERROR: Failed to generate document due to an external redirect to: "https://<sso-site>/SAML2/POST/SSO". 11:13:28 AMruntime-container/7flfqat com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.scala:117) 11:13:28 AMruntime-container/7flfq2025-08-14T17:13:28.461200461Z 11:13:28 AMruntime-container/7flfqCaused by: com.mendix.systemwideinterfaces.MendixRuntimeException: documentgeneration.implementation.exceptions.DocGenNavigationException: Failed to generate document for request: 483ef934-0212-4f1b-ae34-0702d09a63be 11:13:28 AMruntime-container/7flfqDOCGEN_NAVIGATION_ERROR: Failed to generate document due to an external redirect to: "https://<sso-site>/SAML2/POST/SSO". 11:13:28 AMruntime-container/7flfqat com.mendix.util.classloading.Runner$.withContextClassLoader(Runner.scala:23) 11:13:28 AMruntime-container/7flfq2025-08-14T17:13:28.461249482Z 11:13:28 AMruntime-container/7flfqCaused by: documentgeneration.implementation.exceptions.DocGenNavigationException: Failed to generate document for request: 483ef934-0212-4f1b-ae34-0702d09a63be My constants are as such: DocumentGeneration.ServiceEndpoint=https://docgen.home.mendix.com SAML20.DefaultEntity=Administration.Account (I can find nothing in the documentation about whether this should be changed to System.User or my specialized entity Account) SAML20.DisableDecoding_Deeplink_URL=false SAML20.BindingURI_Redirect=false SAML20.DefaultLoginPage= SAML20.DefaultLogoutPage=/SSO/ SAML20.SSOLandingPage= SAML20.SSOLandingPage=index.html Other forum answers such as this one brought up removing <meta http-equiv="refresh" content="0;URL=/SSO/" /> from the index.html, but as you can see, my index.html does not have such a tag <!doctype html> <html> <head> <meta charset="utf-8"> <title>App Name</title> <meta name="viewport" content="width=device-width, initial-scale=1"> {{themecss}} {{appicons}} {{manifest}} {{startupimages}} <script async type="text/javascript" src="https://consent.trustarc.com/v2/notice/3p3tmg?pcookie"></script> <script type="text/javascript" src="https://consent.trustarc.com/v2/autoblockasset/core.min.js?cmId=3p3tmg"></script> <script type="text/javascript" src="https://consent.trustarc.com/v2/autoblock?cmId=3p3tmg"></script> <script> (function () { if (window.location.hostname !== 'localhost' && !sessionStorage.getItem("redirectedOnce") && !window.location.pathname.startsWith("/SSO")) { const target = encodeURIComponent(window.location.search + window.location.hash); sessionStorage.setItem("redirectedOnce", "true"); window.location.replace("/SSO/login?cont=" + target); } })(); </script> </head> <body dir="ltr"> <noscript>To use this application, please enable JavaScript.</noscript> <div id="content"></div> <script> dojoConfig = { isDebug: false, useCustomLogger: true, async: true, baseUrl: "mxclientsystem/dojo/", cacheBust: "{{cachebust}}", rtlRedirect: "index-rtl.html" }; </script> <script> /** * 1. Modify originURI cookie to point to default login URL based on environment. * 2. Add thin colored line above topbar to identify localhost or Acceptance by * adding class env-local or env-acceptance. * * NOTE: even if you change SSOLandingPage constant in SAML20 module to another * file like /index3.html, Mendix ignores it. It uses index.html. **/ var thishost = window.location.hostname; // localhost if (thishost.search(/(?:local)/) > -1 ) { document.querySelector('#content').classList.add('env-local'); if (!document.cookie || !document.cookie.match(/(^|;)originURI=/gi)) document.cookie = "originURI=/login.html" + (window.location.protocol === "https:" ? ";SameSite=None;Secure" : ""); } else // acceptance or production on Mendix Cloud server if (!document.cookie || !document.cookie.match(/(^|;)originURI=/gi)) document.cookie = "originURI=/SSO/" + (window.location.protocol === "https:" ? ";SameSite=None;Secure" : ""); // acceptance if (thishost.search(/(?:accp|dev|stg|stage|acceptance)/) > -1) document.querySelector('#content').classList.add('env-acceptance'); </script> <script src="mxclientsystem/mxui/mxui.js?{{cachebust}}"></script> </body> </html> I'm supposing there must be an issue with <script> (function () { if (window.location.hostname !== 'localhost' && !sessionStorage.getItem("redirectedOnce") && !window.location.pathname.startsWith("/SSO")) { const target = encodeURIComponent(window.location.search + window.location.hash); sessionStorage.setItem("redirectedOnce", "true"); window.location.replace("/SSO/login?cont=" + target); } })(); </script> but I've tested it with and without this tag. Is there an issue with the $currentUser being MxAdmin? It is of type System.User. I've also tried running the microflow as my custom Account entity, which specializes from System.User. Is there an issue with my constants?