Hey there,
I’ve been working along the lines you suggested, and It’s become apparent this won’t work without an update to core.
If I point to a project config file, using an environment variable, SG Desktop will fail to load because the context is at site, not project context, so the path SG is looking for the yml doesn’t exist. This causes SG Desktop to fail to load.
It should be possible to allow includes to point to non-existent files, so we can have optional overrides on a per-project basis, and so SG Desktop won’t error on launch. It would make sense to log a warning if a file doesn’t exist, rather than a TankError.
Here’s the log
2020-03-17 18:37:50,310 [7172 DEBUG sgtk.ext.shotgun_desktop.startup] Getting the default site configuration.
2020-03-17 18:37:50,493 [7172 DEBUG sgtk.ext.shotgun_desktop.paths] These non-plugin_id based pipeline configurations were found by Desktop:
2020-03-17 18:37:50,495 [7172 DEBUG sgtk.ext.shotgun_desktop.paths]
2020-03-17 18:37:50,496 [7172 DEBUG sgtk.ext.shotgun_desktop.paths] This pipeline configuration will be used:
2020-03-17 18:37:50,497 [7172 DEBUG sgtk.ext.shotgun_desktop.paths] None
2020-03-17 18:37:50,498 [7172 DEBUG sgtk.core.log] Removing TK_DEBUG from the environment for this session. This ensures that subprocesses spawned from this process will inherit the global debug logging setting from this process.
2020-03-17 18:37:50,499 [7172 DEBUG sgtk.core.log] Disabling debug logging.
2020-03-17 18:38:08,419 [7172 INFO sgtk.ext.no_current_bundle.3d09481fd15e4e5e967ac190a76b8244] STORAGE ROOT PATH: <Path win:‘Z:\jobs’, linux:’/redacted/jobs’, macosx:’/Volumes/redacted/jobs’> : [‘SHOTGUN_PATH_FIELDS’, ‘class’, ‘delattr’, ‘dict’, ‘doc’, ‘eq’, ‘format’, ‘getattribute’, ‘hash’, ‘init’, ‘module’, ‘ne’, ‘new’, ‘nonzero’, ‘reduce’, ‘reduce_ex’, ‘repr’, ‘setattr’, ‘sizeof’, ‘str’, ‘subclasshook’, ‘weakref’, ‘_get_current_os’, ‘_get_linux’, ‘_get_macosx’, ‘_get_windows’, ‘_linux_path’, ‘_macosx_path’, ‘_sanitize_path’, ‘_set_current_os’, ‘_set_linux’, ‘_set_macosx’, ‘_set_windows’, ‘_windows_path’, ‘as_descriptor_uri’, ‘as_shotgun_dict’, ‘as_system_dict’, ‘current_os’, ‘from_current_os_path’, ‘from_shotgun_dict’, ‘from_system_dict’, ‘get_file_name_from_template’, ‘get_shotgun_storage_key’, ‘join’, ‘linux’, ‘macosx’, ‘normalize’, ‘windows’]
2020-03-17 18:38:08,419 [7172 INFO sgtk.ext.no_current_bundle.3d09481fd15e4e5e967ac190a76b8244] self.parent: [‘class’, ‘delattr’, ‘dict’, ‘doc’, ‘format’, ‘getattribute’, ‘hash’, ‘init’, ‘module’, ‘new’, ‘reduce’, ‘reduce_ex’, ‘repr’, ‘setattr’, ‘sizeof’, ‘str’, ‘subclasshook’, ‘weakref’, ‘_bundle_cache_fallback_paths’, ‘_bundle_cache_root_override’, ‘_descriptor’, ‘_get_descriptor’, ‘_get_metadata’, ‘_get_pipeline_config_file_location’, ‘_get_templates_config_location’, ‘_get_yaml_cache_location’, ‘_pc_id’, ‘_pc_name’, ‘_pc_root’, ‘_plugin_id’, ‘_populate_yaml_cache’, ‘_preprocess_descriptor’, ‘_project_id’, ‘_project_name’, ‘_published_file_entity_type’, ‘_storage_roots’, ‘_update_metadata’, ‘_use_shotgun_path_cache’, ‘convert_to_site_config’, ‘execute_core_hook_internal’, ‘execute_core_hook_method_internal’, ‘execute_post_install_bundle_hook’, ‘get_all_os_paths’, ‘get_all_platform_data_roots’, ‘get_app_descriptor’, ‘get_associated_core_version’, ‘get_bundle_cache_fallback_paths’, ‘get_config_location’, ‘get_configuration_descriptor’, ‘get_core_hooks_location’, ‘get_core_python_location’, ‘get_data_roots’, ‘get_engine_descriptor’, ‘get_environment’, ‘get_environment_path’, ‘get_environments’, ‘get_framework_descriptor’, ‘get_hooks_location’, ‘get_install_location’, ‘get_latest_app_descriptor’, ‘get_latest_engine_descriptor’, ‘get_latest_framework_descriptor’, ‘get_local_storage_for_root’, ‘get_local_storage_mapping’, ‘get_local_storage_roots’, ‘get_name’, ‘get_path’, ‘get_plugin_id’, ‘get_primary_data_root’, ‘get_primary_data_root_name’, ‘get_project_disk_name’, ‘get_project_id’, ‘get_published_file_entity_type’, ‘get_schema_config_location’, ‘get_shotgun_id’, ‘get_shotgun_menu_cache_location’, ‘get_shotgun_path_cache_enabled’, ‘get_templates_config’, ‘has_associated_data_roots’, ‘is_auto_path’, ‘is_localized’, ‘is_site_configuration’, ‘is_unmanaged’, ‘turn_on_shotgun_path_cache’]
2020-03-17 18:38:08,421 [7172 INFO sgtk.ext.no_current_bundle.3d09481fd15e4e5e967ac190a76b8244] self.parent.get_config_location : [‘add’, ‘class’, ‘contains’, ‘delattr’, ‘doc’, ‘eq’, ‘format’, ‘ge’, ‘getattribute’, ‘getitem’, ‘getnewargs’, ‘getslice’, ‘gt’, ‘hash’, ‘init’, ‘le’, ‘len’, ‘lt’, ‘mod’, ‘mul’, ‘ne’, ‘new’, ‘reduce’, ‘reduce_ex’, ‘repr’, ‘rmod’, ‘rmul’, ‘setattr’, ‘sizeof’, ‘str’, ‘subclasshook’, ‘_formatter_field_name_split’, ‘_formatter_parser’, ‘capitalize’, ‘center’, ‘count’, ‘decode’, ‘encode’, ‘endswith’, ‘expandtabs’, ‘find’, ‘format’, ‘index’, ‘isalnum’, ‘isalpha’, ‘isdigit’, ‘islower’, ‘isspace’, ‘istitle’, ‘isupper’, ‘join’, ‘ljust’, ‘lower’, ‘lstrip’, ‘partition’, ‘replace’, ‘rfind’, ‘rindex’, ‘rjust’, ‘rpartition’, ‘rsplit’, ‘rstrip’, ‘split’, ‘splitlines’, ‘startswith’, ‘strip’, ‘swapcase’, ‘title’, ‘translate’, ‘upper’, ‘zfill’]
2020-03-17 18:38:08,422 [7172 INFO sgtk.ext.no_current_bundle.3d09481fd15e4e5e967ac190a76b8244] dp.SHOTGUN_PATH_FIELDS : [‘windows_path’, ‘linux_path’, ‘mac_path’]
2020-03-17 18:38:08,423 [7172 INFO sgtk.ext.no_current_bundle.3d09481fd15e4e5e967ac190a76b8244] dp.current_os : /redacted/jobs
2020-03-17 18:38:08,424 [7172 INFO sgtk.ext.no_current_bundle.3d09481fd15e4e5e967ac190a76b8244] unnamed:None
2020-03-17 18:38:08,426 [7172 INFO sgtk.ext.no_current_bundle.3d09481fd15e4e5e967ac190a76b8244] project_path : /redacted/jobs/unnamed
2020-03-17 18:38:10,184 [7172 ERROR sgtk.ext.shotgun_desktop.startup] Fatal error, user will be logged out.
Traceback (most recent call last):
File “/home/patrick-macdonald/.shotgun/desktop/install/app_store/tk-framework-desktopstartup/v1.10.5/python/shotgun_desktop/startup.py”, line 726, in main
settings
File “/home/patrick-macdonald/.shotgun/desktop/install/app_store/tk-framework-desktopstartup/v1.10.5/python/shotgun_desktop/startup.py”, line 338, in __launch_app
engine = __start_engine_in_zero_config(app, app_bootstrap, splash, user)
File “/home/patrick-macdonald/.shotgun/desktop/install/app_store/tk-framework-desktopstartup/v1.10.5/python/shotgun_desktop/startup.py”, line 456, in __start_engine_in_zero_config
return mgr.bootstrap_engine(“tk-desktop”)
File “/home/patrick-macdonald/.shotgun/desktop/install/app_store/tk-framework-desktopstartup/v1.10.5/python/tk-core/python/tank/bootstrap/manager.py”, line 479, in bootstrap_engine
tk = self._bootstrap_sgtk(engine_name, entity)
File “/home/patrick-macdonald/.shotgun/desktop/install/app_store/tk-framework-desktopstartup/v1.10.5/python/tk-core/python/tank/bootstrap/manager.py”, line 1076, in _bootstrap_sgtk
self.progress_callback
File “/home/patrick-macdonald/.shotgun/desktop/install/app_store/tk-framework-desktopstartup/v1.10.5/python/tk-core/python/tank/bootstrap/manager.py”, line 674, in _cache_bundles
report_bundle_progress
File “/home/patrick-macdonald/.shotgun/desktop/install/app_store/tk-framework-desktopstartup/v1.10.5/python/tk-core/python/tank/bootstrap/cached_configuration.py”, line 487, in cache_bundles
env_obj = pipeline_configuration.get_environment(env_name)
File “/home/patrick-macdonald/.shotgun/redactedfx/sitec186.basic.desktop/cfg/install/core/python/tank/pipelineconfig.py”, line 1109, in get_environment
env_obj = EnvClass(env_file, self, context)
File “/home/patrick-macdonald/.shotgun/redactedfx/sitec186.basic.desktop/cfg/install/core/python/tank/platform/environment.py”, line 692, in init
super(InstalledEnvironment, self).init(env_path, context)
File “/home/patrick-macdonald/.shotgun/redactedfx/sitec186.basic.desktop/cfg/install/core/python/tank/platform/environment.py”, line 61, in init
self._refresh()
File “/home/patrick-macdonald/.shotgun/redactedfx/sitec186.basic.desktop/cfg/install/core/python/tank/platform/environment.py”, line 75, in _refresh
self._env_data = environment_includes.process_includes(self._env_path, data, self.__context)
File “/home/patrick-macdonald/.shotgun/redactedfx/sitec186.basic.desktop/cfg/install/core/python/tank/platform/environment_includes.py”, line 180, in process_includes
data, _ = _process_includes_r(file_name, data, context)
File “/home/patrick-macdonald/.shotgun/redactedfx/sitec186.basic.desktop/cfg/install/core/python/tank/platform/environment_includes.py”, line 213, in _process_includes_r
included_data, included_fw_lookup = _process_includes_r(include_file, included_data, context)
File “/home/patrick-macdonald/.shotgun/redactedfx/sitec186.basic.desktop/cfg/install/core/python/tank/platform/environment_includes.py”, line 203, in _process_includes_r
include_files = _resolve_includes(file_name, data, context)
File “/home/patrick-macdonald/.shotgun/redactedfx/sitec186.basic.desktop/cfg/install/core/python/tank/platform/environment_includes.py”, line 112, in _resolve_includes
path = resolve_include(file_name, include)
File “/home/patrick-macdonald/.shotgun/redactedfx/sitec186.basic.desktop/cfg/install/core/python/tank/util/includes.py”, line 90, in resolve_include
file_name, include, path
TankError: Include resolve error in ‘/redacted/studio/_repos/tk-config-default2/env/./includes/settings/tk-nuke.yml’: ‘$VFX_PROJECT_PATH/config/shotgun/settings/tk-nuke-writenode.yml’ resolved to ‘/redacted/jobs/unnamed/config/shotgun/settings/tk-nuke-writenode.yml’ which does not exist!