Error Unable to resolve template fields after folder creation! when try to create a new file

i’m create a new project!
Already create schema with this link https://gitlab.com/naiwin/shotginconfig

drive : T:\feature
project : DNH2

and when i create a new asset file
category : Assets
asset : rdMan01
task : hair

then script editor show

// Debug: Shotgun path_cache: Path cache syncing not necessary - local folders already up to date! //
// Error: Shotgun tk-multi-workfiles2: Unable to resolve template fields after folder creation!
Traceback (most recent call last):
File “C:\Users\naiwi\AppData\Roaming\Shotgun\bundle_cache\app_store\tk-multi-workfiles2\v0.12.2\python\tk_multi_workfiles\actions\new_file_action.py”, line 70, in execute
self._environment.work_template, validate=True
File “C:\Users\naiwi\AppData\Roaming\Shotgun\caveteam\p221c265.basic.desktop\cfg\install\core\python\tank\context.py”, line 647, in as_template_fields
“creation for %s and try again!” % (self, self.shotgun_url)
TankError: Cannot resolve template data for context ‘hair, Asset rdMan01’ - this context does not have any associated folders created on disk yet and therefore no template data can be extracted. Please run the folder creation for https://[studioname].shotgunstudio.com/detail/Task/13291 and try again! //
// Error: Shotgun tk-multi-workfiles2: Failed to complete ‘New File’ action
Traceback (most recent call last):
File “C:\Users\naiwi\AppData\Roaming\Shotgun\bundle_cache\app_store\tk-multi-workfiles2\v0.12.2\python\tk_multi_workfiles\actions\new_file_action.py”, line 79, in execute
"Unable to resolve template fields after folder creation! This could mean "
TankError: Unable to resolve template fields after folder creation! This could mean there is a mismatch between your folder schema and templates. Please email support@shotgunsoftware.com if you need help fixing this. //

and when i run tank command it said


Command: Unregister folders

Unregistering the following folders:

  • T:\feature\DNH2\

WARNING: Path 'T:\feature\DNH2' is not registered in Shotgun - ignoring.
No associated folders found!

2 Likes

Hi @Thanapat_Tummati,

Welcome to the community and thank you for posting!

It looks like this context does not have any associated folders created on disk yet and therefore no template data can be extracted. We have a little bit of documentation on the path cache, but perhaps not enough to help explain what is going on here.

Essentially the context_from_path method is looking up the path you provided in the path cache, which is a registry of path to entity associations. So if the path can’t be found/matched to entities in the path cache, then no context can be derived.

** What you could do**

  • Confirm that you have add the T:\feature\DNH2\ path to the File Management section in Site Preference.

  • What you could also check is whether you create the folders for your asset, that you get the appropriate FilesystemLocation entities created in Shotgun, ie your Asset folder should have been created while you selecting the task context in DCC software.

  • If not, you could go to the Task page here https://[studioname].shotgunstudio.com/detail/Task/13291 and try to see if you could create folder manually. Usually, no need to create it manually, but just for testing to narrow down the issue. (right click on the task, or go to Project Action on the task details page to retrieve toolkit actions, you will see create folder option there. )

  • If still no luck, you need to

    • close the dcc software and re-launch SG desktop,
    • toggle on Debug Mode on Shotgun Desktop
    • try to reproduce the issue until you see the same error in script editor
    • write to support@shotgunsoftware.com with all the information (including a link to the community post) and tk-desktop.log and tk-[dcc software, eg.].log. Here is where you could fin the log files. as well as a copy of your Toolkit schema.

We will further investigate your issue and get back with valuable conclusion back for the community to consume at the end.

Cheers,
Ben

4 Likes

thank for answer!!

i try it and won’t work. :slightly_frowning_face:
so i try to create schema from default config
And found that if i config {Step} before {sg_asset}/{Asset}
ie asset_root: work/asset/{Step}/SM/{sg_asset_type}/{Asset}
it will error
but if i move {Step} after {Asset} it work properly
-my new config
asset_root: work/asset/SM/{sg_asset_type}/{Asset}/{Step}

1 Like

hi ben
I was same error occurred;
image
And PSCC、3dsMax ;
I can’t see what in my configuration could be the cause of this. Anywhere I can start searching?

Thanks!

Resolved here: