11

SAC Imports and Unique constraint Violated issue

 2 years ago
source link: https://blogs.sap.com/2021/11/11/sac-imports-and-unique-constraint-violated-issue/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
November 11, 2021 1 minute read

SAC Imports and Unique constraint Violated issue

Hello All, here is quick blog on one of the common issues faced during SAC imports and the resolution for the same.

The Preface:

SAP recommends using the Content Network Storage for all your SAC object transports. This blog focuses on a solution to one of the common transport errors if you are compelled to use to ‘File System’ approach. If you want to learn about transports, refer to my blog SAC transports 101.

I want to clarify here that I was forced to use the ‘File System’ option (even though it is not recommended by SAP) since my Content Network Storage won’t respond fine to my exports.

The Error:

Error: dberror(PreparedStatement.executeUpdate): 301 – unique constraint violated: Table(sap.fpa.services.contentlib.catalog::ContentCatalog.PUBLISHED_RESOURCE), Index(_SYS_TREE_RS_#634630_#0_#P0)

Root cause:

For some reason, the system DB (HANA DB in this case) which holds the metadata of these objects, fails to overwrite the primary key of the dashboard being imported. This happens to only the dashboards all the time. Wranglers, connections and dimension come clean during imports.

The Fix:

The .tgz file could be imported through ‘Drop Objects’ import option (in addition to ‘Update Objects’). This would unblock them. It acts like a drop and recreate command on the HANA DB itself forcing the object to be dropped and recreated with the same identifier.

Drop-objects.png

Try the above approach if you encounter the Unique constraint error during your SAC imports in destination. Let me know if any questions / clarifications.

Regards,

Dhyanesh


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK