DocGen Package downloads return an error

Issue

You may encounter errors when attempting to download the DocGen Package files or access DocGen iFrame URLs. This typically happens when you are not the user who generated the document from the DocGen Package or when the download link is opened in a different browser or session.

Cause

Some older versions of DocGen handled download access differently, and you may encounter an error when trying to replicate the previous behavior. Some previous versions allowed anyone with the download link to download the document.

Download access is limited to:

  • The user who generated the document from the DocGen Package

  • System Administrators

  • Authorized integration user

All downloads must still occur within a valid, active browser session.

You may see these errors if:

  • A standard user other than the document owner attempts to download the file.

  • A DocGen file download or iFrame link is shared with another user.

  • The link is opened in a different browser, private or incognito window, or after the session has expired.

This behavior is expected and helps protect sensitive documents from unauthorized access.

Common scenarios and messages

Access by a Different Profile

If a user who did not generate the document attempts to download a PDF from the DocGen queue, one of the following messages may appear:

  • "An error has occurred. One or more requested documents are missing or inaccessible."

  • " You do not have permission to access this file. You are not the owner of this document request."

Attempting to Use an iFrame Download Link

In some older versions of DocGen, you could locate the iFrame URL using browser tools and open it. This behavior has changed in version 17.43. An iFrame download link now works only within the same logged-in browser session.

If the link is opened outside the original session, the following error may appear:

  • {"status":"error","message":"An error has occurred. (InternalError)"}

Session-Related Errors When Verifying DocGen Execution

In some cases, you may see messages related to session security. These messages appear when a DocGen link is reused after the session expires or a link is opened in another browser or user session.

  • “The included Salesforce Session ID is invalid or has expired.”

Resolution

To avoid these errors and successfully download DocGen files:

  • Download the document within the same browser session where it was generated.

  • Do not share or reuse DocGen download or iFrame links.

  • Ensure you are either:

    • The user who generated the document

    • A System Administrator

    • An authorized integration user