# "+ New File" Maya action error

**URL:** <https://community.shotgridsoftware.com/t/new-file-maya-action-error/8225>\
**Category:** Pipeline Integrations\
**Created:** [April 16, 2020, 9:30pm UTC](https://community.shotgridsoftware.com/t/new-file-maya-action-error/8225 "2020-04-16T21:30:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gvalderramos](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/gvalderramos/32/2268_2.png) [@gvalderramos](https://community.shotgridsoftware.com/u/gvalderramos)\
**Post date:** [April 16, 2020, 9:30pm UTC](https://community.shotgridsoftware.com/t/new-file-maya-action-error/8225/1 "2020-04-16T21:30:57Z")

</div>

Hi everyone,

I started to create a new special pipeline configuration for freelancers. Those people, don’t have access to our network, so I created a new root name and pointed it to C:\VetorZero\work. The production pipeline configuration has the roots paths pointed to our file server.

When I try to create a new file with tk-multi-workfiles on Maya, It raises the following error:

> Failed to change work area - Error during execution of MEL script: file: C:/Program files/Autodesk/Maya2019/scripts/others/setProject.mel line 332: New project location C:\VetorZero\work\Shotgun-workflow\_completo\sequences\Seq\_001\SH\_010\ANIM\maya is not a valid directory, project not created.  
> Calling Procedure: setProject, in file “C:\Program Files\Shotgun\c” set project(“C:\Vetorzero\work\SHOTGUN-workflow\_completo\sequences\Seq\_001\SH\_010\ANIM\maya”)

I realized that it created the folder C:\Vetorzero\work\SHOTGUN-workflow\_completo\sequences\Seq\_001\SH\_010\ANIM, but it isn’t created the folder “maya” on the folder “ANIM”, so because it, that raise this error.

I was debugging the code and realized that file\_action.py realized that, by context, that needed to create the “maya” directory, but the function FileAction.create\_folders (ctx) created only up to the folder ANIM, as the following images show.

[error.zip](https://community.shotgridsoftware.com/uploads/short-url/sahph0cHBZupJCnPjLcjMy9hwNE.zip) (1.4 MB)

After this error, if I try to create a new file again, that doesn’t result in any error, because the Shotgun was set the task context assuming that all folders have already been created, but those weren’t.

Have any of you ever had a similar error? What can I do to solve or help to solve that?

Thanks!

---

<div class="post-metadata">

**Author:** ![gvalderramos](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/gvalderramos/32/2268_2.png) [@gvalderramos](https://community.shotgridsoftware.com/u/gvalderramos)\
**Post date:** [April 27, 2020, 10:02pm UTC](https://community.shotgridsoftware.com/t/new-file-maya-action-error/8225/3 "2020-04-27T22:02:11Z")

</div>

Hey, guys, how are you?

Did anyone have any ideas that could help me, please?

Thank you!

---

<div class="post-metadata">

**Author:** ![Sreenathan\_Nair](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/sreenathan_nair/32/2144_2.png) [@Sreenathan\_Nair](https://community.shotgridsoftware.com/u/Sreenathan_Nair)\
**Post date:** [April 28, 2020, 12:55am UTC](https://community.shotgridsoftware.com/t/new-file-maya-action-error/8225/4 "2020-04-28T00:55:02Z")

</div>

Hi @gvalderramos,

If the issue is only that the static directory i.e `maya` is not getting created, you could try:

```python
from sgtk.util.filesystem import ensure_folder_exists
...
ensure_folder_exists(os.path.dirname(scene_file_path))
...

```

Personally we run `register_folders` beforehand on all task entities though, which might be why we are able to get away with using `ensure_folder_exists` but ymmv.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![philip.scadding](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/philip.scadding/32/30_2.png) [@philip.scadding](https://community.shotgridsoftware.com/u/philip.scadding)\
**Post date:** [April 28, 2020, 8:21am UTC](https://community.shotgridsoftware.com/t/new-file-maya-action-error/8225/5 "2020-04-28T08:21:03Z")

</div>

Please could you attach your schema to this thread so we can take a look at what is going on here?

In the default setup, the maya folder is a static folder as @Sreenathan_Nair mentions that has deferred creation until folder creation is run inside Maya.

---

<div class="post-metadata">

**Author:** ![gvalderramos](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/gvalderramos/32/2268_2.png) [@gvalderramos](https://community.shotgridsoftware.com/u/gvalderramos)\
**Post date:** [April 28, 2020, 7:04pm UTC](https://community.shotgridsoftware.com/t/new-file-maya-action-error/8225/6 "2020-04-28T19:04:58Z")

</div>

Hi @philip.scadding and @Sreenathan_Nair,

Thank you for all, I’ve checked the schema again and you are right, the folder “maya” was deleted by mistake. After that, I’ve tested again and this worked!

Thanks.

---

<div class="post-metadata">

**Author:** ![Sreenathan\_Nair](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/sreenathan_nair/32/2144_2.png) [@Sreenathan\_Nair](https://community.shotgridsoftware.com/u/Sreenathan_Nair)\
**Post date:** [April 28, 2020, 7:08pm UTC](https://community.shotgridsoftware.com/t/new-file-maya-action-error/8225/7 "2020-04-28T19:08:41Z")

</div>

Happy that you solved it buddy!
