Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish Animation Product - duplic key error #553

Closed
2 tasks done
AlSzab opened this issue May 27, 2024 · 4 comments
Closed
2 tasks done

Publish Animation Product - duplic key error #553

AlSzab opened this issue May 27, 2024 · 4 comments
Labels
type: bug Something isn't working

Comments

@AlSzab
Copy link

AlSzab commented May 27, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior:

When referencing a rigging product into an animation scene the animation product publishing process is failing due to the error:
" a duplicate key value violates unique constraint"
bug_01

Expected Behavior:

It should cache out the animation

Version

1.0.0

What platform you are running on?

Windows

Steps To Reproduce:

  1. Open Animation Task
  2. Reference simple rigging product
  3. Try publishing it

Are there any labels you wish to add?

  • I have added the relevant labels to the bug report.

Relevant log output:

{
                            "type": "error",
                            "is_validation_error": false,
                            "msg": "Operation \"5062bf28-5c00-4c76-9eb3-9d0d006e714f\" failed with data:\n{\n    \"id\": \"5062bf28-5c00-4c76-9eb3-9d0d006e714f\",\n    \"type\": \"create\",\n    \"entityType\": \"representation\",\n    \"entityId\": \"0f6b209d1c0311efa4b4f0a654d1795e\",\n    \"data\": {\n        \"id\": \"0f6b209d1c0311efa4b4f0a654d1795e\",\n        \"versionId\": \"0f6697d41c0311efb6e9f0a654d1795e\",\n        \"files\": [\n            {\n                \"id\": \"0f7bea281c0311ef94ecf0a654d1795e\",\n                \"name\": \"xo01_0040_animationBoxManA_rigMain_01__v007.abc\",\n                \"path\": \"{root[publish]}/x_onboarding_01/03_post/sequences/rnd/0040/animation/animationBoxManA_rigMain_01_/v007/xo01_0040_animationBoxManA_rigMain_01__v007.abc\",\n                \"size\": 21290,\n                \"hash\": \"xo01_0040_animationBoxManA_rigMain_01__v007,abc|1716798493,8599868|21290\",\n                \"hash_type\": \"op3\"\n            }\n        ],\n        \"name\": \"abc\",\n        \"data\": {\n            \"context\": {\n                \"root\": {\n                    \"publish\": \"V:/\"\n                },\n                \"project\": {\n                    \"name\": \"x_onboarding_01\",\n                    \"code\": \"xo01\"\n                },\n                \"hierarchy\": \"03_post/sequences/rnd\",\n                \"folder\": {\n                    \"name\": \"0040\",\n                    \"type\": \"Shot\",\n                    \"path\": \"/03_post/sequences/rnd/0040\"\n                },\n                \"product\": {\n                    \"name\": \"animationBoxManA_rigMain_01_\",\n                    \"type\": \"animation\"\n                },\n                \"version\": 7,\n                \"ext\": \"abc\",\n                \"asset\": \"0040\",\n                \"task\": {\n                    \"name\": \"animation\",\n                    \"type\": \"Animation\",\n                    \"short\": \"anim\"\n                },\n                \"subset\": \"animationBoxManA_rigMain_01_\",\n                \"family\": \"animation\",\n                \"representation\": \"abc\",\n                \"username\": \"alex.szabados\",\n                \"user\": \"alex.szabados\"\n            }\n        },\n        \"attrib\": {\n            \"path\": \"V:\\\\x_onboarding_01\\\\03_post\\\\sequences\\\\rnd\\\\0040\\\\animation\\\\animationBoxManA_rigMain_01_\\\\v007\\\\xo01_0040_animationBoxManA_rigMain_01__v007.abc\",\n            \"template\": \"{root[publish]}/{project[name]}/{hierarchy}/{folder[name]}/{product[type]}/{product[name]}/v{version:0>3}/{project[code]}_{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}><_{udim}>.{ext}\"\n        }\n    }\n}\nDetail: duplicate key value violates unique constraint \"representation_unique_name_on_version\"\nDETAIL:  Key (version_id, name)=(0f6697d4-1c03-11ef-b6e9-f0a654d1795e, abc) already exists..",
                            "filename": "C:\\Users\\alex.szabados\\AppData\\Local\\miniconda3\\envs\\ayon-dev\\lib\\site-packages\\ayon_api\\server_api.py",
                            "lineno": "6580",
                            "func": "send_batch_operations",
                            "traceback": "Traceback (most recent call last):\n  File \"C:\\Users\\alex.szabados\\AppData\\Local\\Ynput\\AYON\\dependency_packages\\ayon_2401161802_windows.zip\\dependencies\\pyblish\\plugin.py\", line 527, in __explicit_process\n    runner(*args)\n  File \"C:\\Users\\alex.szabados\\Documents\\workspace\\trunk\\ayon-core\\client\\ayon_core\\plugins\\publish\\integrate.py\", line 234, in process\n    six.reraise(*sys.exc_info())\n  File \"C:\\Users\\alex.szabados\\AppData\\Local\\miniconda3\\envs\\ayon-dev\\lib\\site-packages\\six.py\", line 719, in reraise\n    raise value\n  File \"C:\\Users\\alex.szabados\\Documents\\workspace\\trunk\\ayon-core\\client\\ayon_core\\plugins\\publish\\integrate.py\", line 221, in process\n    self.register(instance, file_transactions, filtered_repres)\n  File \"C:\\Users\\alex.szabados\\Documents\\workspace\\trunk\\ayon-core\\client\\ayon_core\\plugins\\publish\\integrate.py\", line 414, in register\n    op_session.commit()\n  File \"C:\\Users\\alex.szabados\\AppData\\Local\\miniconda3\\envs\\ayon-dev\\lib\\site-packages\\ayon_api\\operations.py\", line 702, in commit\n    project_name, operations_body, can_fail=False\n  File \"C:\\Users\\alex.szabados\\AppData\\Local\\miniconda3\\envs\\ayon-dev\\lib\\site-packages\\ayon_api\\server_api.py\", line 6580, in send_batch_operations\n    op_result[\"detail\"],\nayon_api.exceptions.FailedOperations: Operation \"5062bf28-5c00-4c76-9eb3-9d0d006e714f\" failed with data:\n{\n    \"id\": \"5062bf28-5c00-4c76-9eb3-9d0d006e714f\",\n    \"type\": \"create\",\n    \"entityType\": \"representation\",\n    \"entityId\": \"0f6b209d1c0311efa4b4f0a654d1795e\",\n    \"data\": {\n        \"id\": \"0f6b209d1c0311efa4b4f0a654d1795e\",\n        \"versionId\": \"0f6697d41c0311efb6e9f0a654d1795e\",\n        \"files\": [\n            {\n                \"id\": \"0f7bea281c0311ef94ecf0a654d1795e\",\n                \"name\": \"xo01_0040_animationBoxManA_rigMain_01__v007.abc\",\n                \"path\": \"{root[publish]}/x_onboarding_01/03_post/sequences/rnd/0040/animation/animationBoxManA_rigMain_01_/v007/xo01_0040_animationBoxManA_rigMain_01__v007.abc\",\n                \"size\": 21290,\n                \"hash\": \"xo01_0040_animationBoxManA_rigMain_01__v007,abc|1716798493,8599868|21290\",\n                \"hash_type\": \"op3\"\n            }\n        ],\n        \"name\": \"abc\",\n        \"data\": {\n            \"context\": {\n                \"root\": {\n                    \"publish\": \"V:/\"\n                },\n                \"project\": {\n                    \"name\": \"x_onboarding_01\",\n                    \"code\": \"xo01\"\n                },\n                \"hierarchy\": \"03_post/sequences/rnd\",\n                \"folder\": {\n                    \"name\": \"0040\",\n                    \"type\": \"Shot\",\n                    \"path\": \"/03_post/sequences/rnd/0040\"\n                },\n                \"product\": {\n                    \"name\": \"animationBoxManA_rigMain_01_\",\n                    \"type\": \"animation\"\n                },\n                \"version\": 7,\n                \"ext\": \"abc\",\n                \"asset\": \"0040\",\n                \"task\": {\n                    \"name\": \"animation\",\n                    \"type\": \"Animation\",\n                    \"short\": \"anim\"\n                },\n                \"subset\": \"animationBoxManA_rigMain_01_\",\n                \"family\": \"animation\",\n                \"representation\": \"abc\",\n                \"username\": \"alex.szabados\",\n                \"user\": \"alex.szabados\"\n            }\n        },\n        \"attrib\": {\n            \"path\": \"V:\\\\x_onboarding_01\\\\03_post\\\\sequences\\\\rnd\\\\0040\\\\animation\\\\animationBoxManA_rigMain_01_\\\\v007\\\\xo01_0040_animationBoxManA_rigMain_01__v007.abc\",\n            \"template\": \"{root[publish]}/{project[name]}/{hierarchy}/{folder[name]}/{product[type]}/{product[name]}/v{version:0>3}/{project[code]}_{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}><_{udim}>.{ext}\"\n        }\n    }\n}\nDetail: duplicate key value violates unique constraint \"representation_unique_name_on_version\"\nDETAIL:  Key (version_id, name)=(0f6697d4-1c03-11ef-b6e9-f0a654d1795e, abc) already exists..\n",
                            "instance_id": "6ec033bc-e895-4fba-8cbb-b657a47fbd6f"
                        }

Additional context:

No response

@AlSzab AlSzab added the type: bug Something isn't working label May 27, 2024
@BigRoy
Copy link
Collaborator

BigRoy commented May 27, 2024

Could you share the full json report file?

It seems to somehow want to integrate the animation instance more than once.

@AlSzab
Copy link
Author

AlSzab commented May 27, 2024

publish-report-240527-10-24.json

here you go

@BigRoy
Copy link
Collaborator

BigRoy commented May 27, 2024

Definitely something fishy going on - it also seems to do the export itself twice:

DEBUG: Running `extract_alembic` with the keyword arguments: {'file': 'C:\\Users\\ALEX~1.SZA\\AppData\\Local\\Temp\\pyblish_tmp_599vn6s3\\animationBoxManA_rigMain_01_.abc', 'attr': ['cbId'], 'attrPrefix': [], 'userAttr': [], 'userAttrPrefix': [], 'dataFormat': 'ogawa', 'endFrame': 1030.0, 'eulerFilter': False, 'preRoll': False, 'preRollStartFrame': 0, 'renderableOnly': False, 'root': ['|BoxManA_rigMain_01_:_GRP', 'BoxManA_rigMain_01_:rigMain_skeletonMesh_SET', 'BoxManA_rigMain_01_:rigMain_controls_SET', 'BoxManA_rigMain_01_:rigMain_skeletonAnim_SET', 'BoxManA_rigMain_01_:rigMain_out_SET'], 'selection': True, 'startFrame': 1001.0, 'step': 1.0, 'stripNamespaces': True, 'uvWrite': False, 'verbose': False, 'wholeFrameGeo': False, 'worldSpace': True, 'writeColorSets': False, 'writeCreases': False, 'writeFaceSets': False, 'writeUVSets': False, 'writeVisibility': False, 'uvsOnly': False, 'melPerFrameCallback': '', 'melPostJobCallback': '', 'pythonPerFrameCallback': '', 'pythonPostJobCallback': '', 'noNormals': False}
DEBUG: Extracted animationBoxManA_rigMain_01_ to C:\Users\ALEX~1.SZA\AppData\Local\Temp\pyblish_tmp_599vn6s3
DEBUG: No proxy nodes found. Skipping proxy extraction.
DEBUG: Extracting pointcache..
DEBUG: Running `extract_alembic` with the keyword arguments: {'file': 'C:\\Users\\ALEX~1.SZA\\AppData\\Local\\Temp\\pyblish_tmp_599vn6s3\\animationBoxManA_rigMain_01_.abc', 'attr': ['cbId'], 'attrPrefix': [], 'userAttr': [], 'userAttrPrefix': [], 'dataFormat': 'ogawa', 'endFrame': 1030.0, 'eulerFilter': False, 'preRoll': False, 'preRollStartFrame': 0, 'renderableOnly': False, 'root': ['BoxManA_rigMain_01_:BoxManA_modelMain_01_:c_boxMan_GEO'], 'selection': True, 'startFrame': 1001.0, 'step': 1.0, 'stripNamespaces': True, 'uvWrite': False, 'verbose': False, 'wholeFrameGeo': False, 'worldSpace': True, 'writeColorSets': False, 'writeCreases': False, 'writeFaceSets': False, 'writeUVSets': False, 'writeVisibility': False, 'uvsOnly': False, 'melPerFrameCallback': '', 'melPostJobCallback': '', 'pythonPerFrameCallback': '', 'pythonPostJobCallback': '', 'noNormals': False}
DEBUG: Extracted animationBoxManA_rigMain_01_ to C:\Users\ALEX~1.SZA\AppData\Local\Temp\pyblish_tmp_599vn6s3
DEBUG: No proxy nodes found. Skipping proxy extraction.

It seems to try running both Extract Animation and Extract Pointcache for your single animation instance.
Did you happen to have added the animation family to ExtractAlembic in your studio or project settings? If so, please remove it since there's a separate ExtractAnimation plug-in specifically for that family.

Also, could you report which ayon_core, and ayon_maya versions you're using in your bundle?

@AlSzab
Copy link
Author

AlSzab commented May 27, 2024

You're absolutely right... Seems like someone override the extract alembic with both pointcache and animation.

Thanks Roy, you saved the day!
Closing out this ticket

@AlSzab AlSzab closed this as completed May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants