KNOWLEDGE BASE

Error "commit failed; nested exception is org.hibernate.TransactionException: commit failed" When Importing a Tableau Server Site


Published: 13 Feb 2020
Last Modified Date: 18 Feb 2020

Issue

When importing a Tableau Server Site, the Iimport fails and the following error message might occur in the command line:

"An error occurred on the server while trying to import site <Site Name>.
This job failed due to an error.
commit failed; nested exception is org.hibernate.TransactionException: commit failed - 'violates foreign key constraint'".

Environment

Tableau Server

Resolution

Option 1

Check the mapping content for any errors or omissions, please note that capitalization must also match.

Option 2

Check in the siteimportexport_<node>.log if there is an error similar to the one described below:
"Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "<table name>" violates foreign key constraint "<key name>"
  Detail: Key <identifier> is not present in table "<table name>"."

The error mentioned above could instead reference different tables, too, such as system_users. If similar error to this are found, it is a strong indication that either users or schedules mappings files contain bad mapping content.
Consider using Tableau Desktop to join to the PostgreSQL repository (as described below) to 100% vet the correctness of the mappings files.

 

Cause

There are errors or omissions in the content in the mapping files.

Additional Information

For more information about this topic, see How to Migrate Tableau Server from Local Authentication to Active Directory by Using Site Migration in the Tableau Community. The document contains full details of the error messages and how to fix them:
"The entire import will fail if even a single ... mapping is invalid. For systems with hundreds or thousands of user mappings that are difficult to accurately verify manually, it is a best practice to leverage Tableau Desktop to machine-verify the accuracy of your mapping file. (For a large site that takes many hours to import, this step can save you hours of wasted time if an import were to fail at the end.) When you think your mappingsSystemUserNameMapper.csv is ready, try connecting to it with Tableau Desktop’s CSV data source method, and join it to your target system’s PostgreSQL repository, specifically the system_users table, which will contain entries for each mapped Active Directory user. Establish a left-outer join between mappingsSystemUserNameMapper.csv and system_users and use this to create a new sheet which then verifies that each incoming Local user’s Target Name column truly has a valid, matching Active Direcotry account Name in system_users."
 
Did this article resolve the issue?