Invalid version in descriptor: latest

Hello there!

I’m trying to bootstrap sgtk on the farm. If I don’t set a configuration specifically, then it falls back to the Primary config, which is fine by me for now. However, my Primary pipeline configuration does not have a descriptor since it never needed one, it has an uploaded config that works just fine. But this bootstrap process needs a descriptor it seems like, or else it gives me this error:

No config descriptor specified - Cannot create a configuration object.

If I give it a descriptor, like this:

It gives me the error:
Invalid version in descriptor {'type': 'shotgun', 'entity_type': 'PipelineConfiguration', 'name': 'Primary', 'field': 'sg_uploaded_config', 'version': 'latest'}

I don’t know how to modify this descriptor or how to get the latest version of this config.
I just can’t seem to find any documentation about how to set this properly.
Seems a bit dull to give the config a descriptor that point back right at the current config.

What would be the correct solution here?

Hi @pw_simon

I remember working with the bootstrap and getting that error too, but I can’t find any of that.

You could check this documentation: Descriptors — tk-core v0.21.3 documentation

Seems like it only works specifying the version of the attached config. You can get the ID by API (querying the sg_uploaded_config of the pipeline configuration) or in the Files page in the webpage.

1 Like

Thanks @Jaziel !
I already checked the documentation you sent, but as you could also see, there was no ‘latest’ option so I ended up with the exact solution you’re mentioning.

1 Like

Yes, maybe I remember a manual solution for this but… maybe not haha, seems like a bug for me, because you will need to update the version id every time you upgrade the configuration.

I can avoid updating the pipeline config entity descriptor by setting it in the code dynamically:

mgr.base_configuration = {
                'type': 'shotgun',
                'entity_type': 'PipelineConfiguration',  # entity type
                'name': 'Primary',  # name of the record in shotgun (e.g. 'code' field)
                'project_id': project_id,  # optional project id. If omitted, name is assumed to be unique.
                'field': 'uploaded_config',  # attachment field where payload can be found
                'version': latest_file_entity_id  # attachment id of particular attachment
1 Like