# Problem with "register\_publish" method

**URL:** <https://community.shotgridsoftware.com/t/problem-with-register-publish-method/15405>\
**Category:** Pipeline Integrations\
**Created:** [May 19, 2022, 10:41am UTC](https://community.shotgridsoftware.com/t/problem-with-register-publish-method/15405 "2022-05-19T10:41:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kemot](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/kemot/32/2710_2.png) [@Kemot](https://community.shotgridsoftware.com/u/Kemot)\
**Post date:** [May 19, 2022, 10:41am UTC](https://community.shotgridsoftware.com/t/problem-with-register-publish-method/15405/1 "2022-05-19T10:41:56Z")

</div>

Hi, i got a problem with ‘sgtk.util.register\_publish’, I trying to publish file from my script which use sgtk API which was installed using pip. I bootsrap an engine and use “register\_publish” command but it return me an error:

`group_by_storage() takes 2 positional arguments but 3 were given.`

I have made a little investigation and find out that there is a problem inside PIP installed sgtk. When “publish\_util.py” file is calling “group\_by\_storage” method in line 132 (line number can by little diffrent I have made a couple lines of logger). It’s looks like that:

`storage_root_to_paths = group_by_storage(tk, list_of_paths, only_current_project)`

It’s look fine but “group\_by\_storage” in file “publish\_creatiuon.py” dosen’t accept that. Even though declaration looks ok, I understand that “only\_current\_project” is argument with default value here:

`def group_by_storage(tk, list_of_paths, only_current_project=True):...`

I dont understand why it isn’t accept “only\_current\_project” argument from “publish\_util.py” , when I have removed it from there, it’s starts to work fine.

But I’am not sure that i should modify this library like that… maybe it’s some known issue? Or did I made some mistake?

---

<div class="post-metadata">

**Author:** ![mmoshev](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/mmoshev/32/476_2.png) [@mmoshev](https://community.shotgridsoftware.com/u/mmoshev)\
**Post date:** [May 19, 2022, 11:14am UTC](https://community.shotgridsoftware.com/t/problem-with-register-publish-method/15405/2 "2022-05-19T11:14:25Z")

</div>

Seems like two different versions of sgtk in play.  
Just remove the one in pip. If something ever breaks, you will know to install it again.

It is kinda useful to use pdb for stuff like this, because you will see execution jump to the wrong module and say “a-ha!”

---

<div class="post-metadata">

**Author:** ![Kemot](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/kemot/32/2710_2.png) [@Kemot](https://community.shotgridsoftware.com/u/Kemot)\
**Post date:** [May 19, 2022, 12:06pm UTC](https://community.shotgridsoftware.com/t/problem-with-register-publish-method/15405/3 "2022-05-19T12:06:02Z")

</div>

Unfortunately I have tried on different PC, with clean instalation of python and SGTK and still get errors like:

“tank.util.errors.ShotgunPublishError: Unable to complete publishing because of the following error: group\_by\_storage() takes 2 positional arguments but 3 were given, although PublishedFile sh001\_Deadline2020\_Rnd\_v023\_EnvMIDLayer\_beauty.%04d.exr (id: 64305) was created.”
