Skip to content Skip to main navigation Skip to footer

Error: 500 Internal Error

Error Message:
Error: 500. Error description: { “error”: { “code”: 500, “message”: “Internal Error.”, “status”: “INTERNAL”, “domain”: “global”, “reason”: “internalError”} }

Note: If this error begins to happen after performing the required upgrade to version 5.9 or with no changes to configuration, it is happening because there is something in the template that Google no longer supports after the update to the Google Drive API.

Steps to troubleshoot:

  • Verify that you have installed the latest version of Opero Documents and re-authorize the app, especially if performing the required upgrade to 5.9 (see package release notes for version 5.9). Package version is listed in Setup>Installed Packages>Opero Documents.
  • Remove any Drawing from the template and replace with a screenshot (Image) of the drawing. Test document generation.
  • If the error persist or if there is no Drawing in the template, this error is caused by another type of unsupported element within the template. Create a new, blank Google Document template. The new document should be created new and not copied from the existing one. Update the sharing settings on the Google Doc template and paste the new Google Doc Id into the Document Action.
  • Copy/paste one section at a time from the old template into the new template, testing after each new item is added to see if the error returns.
  • If the error returns, there is an issue with that section of the template and you will need to recreate it from scratch rather than copying it over from the old template, and any merge fields should be added using the template editor.

Additional troubleshooting:

  • If you are automating document generation by creating a Document Request record (for example with Flow), Clone your Document Action and using the standard button method try to make the Document Action simpler to remove variables. For example, have it generate a PDF only and download to browser. Do not save the generated document to a Google Folder. Do not change the permission of the Google Document. Do not specify an email action. Once you can get a very basic Document Action to work with a blank template, follow the method above to troubleshoot the template.
  • Check all merge fields within the template in order to ensure proper formatting of the merge field code. For example, check the template for special characters, a missing or extra bracket “}” in one of your merge fields, or merge field code that wasn’t fully copied from the template builder.
  • Check that a Opero Documents permission set has been assigned to Standard and Administrator users.
  • Check Google document and folder permissions.
  • Retry the Document Requests on the same records to see if you get the same error.
    • If it works after retrying, it may have been due to a random internal error from Google or Salesforce.
    • If you can consistently get the same error on the same record, but other records are ok, then it doesn’t seem to be a global issue or a template issue. There might be something about that specific record causing the error. For example, a special character in one of the fields being merged could be causing an issue. Troubleshoot by checking the values of the fields being merged. Or clone the document action and remove merge fields to see when you can get it to work in order to narrow down what is causing the issue.
  • Google Limitations: There is a limit of 400,000 items in a Google Drive folder: Shared Drive Limits in Google Drive. If this limit is exceeded it may cause the 500 error.