Skip to content Skip to main navigation Skip to footer

Error: 500 Internal Error Encountered

Error Message:
Error while creating new document. Error message: Error: 500. Error description: { “error”: { “code”: 500, “message”: “Internal error encountered.”, “status”: “INTERNAL” } }

Solution: 

  1. Check if this error happening under all users or just non admin users.
  2. Refresh your app authorization with Google Drive under documents configuration tab.
  3. Check Google document and folder permissions.
  4. Retry the Document Requests on the same records to see if you get the same error or if it works.
    1. If it works after retrying, it may have been due to a random internal error from Google or Salesforce.
    2. 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.
  5. 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.
  6. If you uploaded your Google Doc template from a Word document, there may be hidden formatting in the document causing this error message. You can test by creating a blank Google Document (do not copy the original one), update sharing settings, then paste the new Google Doc Id into your Document Action. Next, test the blank document to see if the error comes up. If it does not, then you know it is an issue with your previous template. Add each merge field individually (test after adding each field) and if no error, it may be an issue with hidden formatting. In order to resolve an issue with hidden formatting you would need to recreate your Google Document template from scratch.
  7. 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 in a Google Folder or change the permission of the Google Document. Do not specify an email action. If you can get a very basic Document Action to work, then gradually add additional configurations.
  8. Note that 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.