PDF Document Generation — Do I need to register it again after deployment?

0
Hi everyone, I’m using the PDF Document Generation module in my Mendix app and encountered a strange issue. After deploying the app to the environment, I tried downloading a PDF, but got a system error. When I checked the logs, it showed: Timeout while waiting for document To troubleshoot, I revoked the PDF generation service registration and then registered it again, and everything started working fine after that. This made me wonder: Is the PDF Document Generation registration required every time I redeploy to the same environment? Or is it supposed to be a one-time setup per environment? Is there a way to prevent this issue without needing to re-register manually each time? Would really appreciate insights from anyone who's dealt with this! Thanks in advance. 🙏
asked
1 answers
0

hi,



Do I have to re-register the PDF Document Generation service every time I redeploy?

No. You do not need to re-register the PDF Document Generation service on every deployment to the same environment. The registration is intended to be done once per environment as part of the initial setup.

What the registration actually does

  • When you register an environment using the Snip_AppRegistration snippet, it stores the PDF service configuration (App ID + token).
  • This registration ties your app environment to the Mendix public document generation service.
  • Once registered, that environment can generate PDFs without needing to re-register after each deploy.

Why it sometimes fails after redeploy

Even though you shouldn’t have to re-register, there are a few common real-world scenarios where you might see errors until you refresh the registration:

  1. Environment URL changed
  2. If you change the environment URL (e.g., restore DB to another environment), the stored registration no longer matches, and you must re-register.
  3. Token expired / not auto-refreshed
  4. The PDF service uses short-lived tokens to talk to your app. The module includes a scheduled event (SE_AccessToken_Refresh) to automatically refresh this token — but if that scheduled event never ran (e.g., app was idle), the token may expire, requiring re-registration.
  5. Network access restrictions
  6. If your environment has path-based restrictions (e.g., /docgen/) or IP restrictions, the document service may not reach your app during PDF generation. You may need to configure those in the environment first.

Does a normal deploy break the registration?

No. Standard redeployments (builds to the same environment) do not expire or remove the registration token — the registration is preserved in your app database and configuration.

How to avoid needing to re-register manually

To prevent manual re-registration in the future:

  • Make sure you have the scheduled event SE_AccessToken_Refresh enabled — this ensures the PDF service token is kept valid automatically.
  • Make sure the environment does not block the DocGen path (/docgen/) — if access restrictions exist, allow bidirectional communication.
  • Do not restore database backups from another environment to this one without re-registering — because the stored app ID/token may no longer match.


answered