Skip to main content
Question

Cannot upload files with toolkit version 0.7.135

  • March 2, 2026
  • 5 replies
  • 28 views

Hi,
I’m using toolkit to deploy files to CDF. I am using FileMetadata.yaml as in

- externalId: 'my_external_id.usc'
name: 'my_external_id.usc'
source: 'toolkit'
dataSetExternalId: 'my_dataset_external_id'
mimeType: 'application/usc'
metadata:
origin: 'cognite-toolkit'

I have my .usc file in the same folder and toolkit is not uploading the file (just deploying the metadata).

The dry run recognizes that there is file content to be uploaded, but it does not do it

Use case: I am trying to upload a file to be used in the simulator connector routine. I tried deploying just the file first and then deploy the routine and also tried both together, but it did not work.

Any thoughts?
 

5 replies

Anders  Albert
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • March 3, 2026

I struggle with recreating this issue. Do you have more information about exactly the directory structure you have?

Note that we recommend using the data plugin for working with files, https://docs.cognite.com/cdf/deploy/cdf_toolkit/guides/plugins/data_plugin/upload#files.


I have
/files/

where I have both 

MyFile.FileMetadata.yaml

my_external_id.usc


Anders  Albert
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • March 4, 2026

Sorry, can I ask for the terminal output when you run deploy with the ‘--verbose` flag set as well?


Dry run says there’s a file content to deploy


The only thing we have from the deployment about the file is

 

​​​​​
Is it enough?


Forum|alt.badge.img+1

It fails when it tried deploying simulator model revisions, on version: 0.7.135

  • I think its either due to an issue with the resolution of fileExternalId to internalId - ref: docs
  • Or it might be due to the file not being uploaded at all, but thats abit weird because the file is available for upload, and we can see that its recognized in the dry run
    • When Ricardo checked if the file was “uploaded” with the sdk, it was set to false. 

pipeline error,
 

result = execute(*args, **kwargs)

^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/vsts/.local/lib/python3.12/site-packages/cognite_toolkit/_cdf_tk/apps/_core_app.py", line 367, in <lambda>

lambda: cmd.deploy_build_directory(

^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/vsts/.local/lib/python3.12/site-packages/cognite_toolkit/_cdf_tk/commands/deploy.py", line 109, in deploy_build_directory

self.deploy_all_resources(

File "/home/vsts/.local/lib/python3.12/site-packages/cognite_toolkit/_cdf_tk/commands/deploy.py", line 313, in deploy_all_resources

resource_result = self.deploy_resource_type(

^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/vsts/.local/lib/python3.12/site-packages/cognite_toolkit/_cdf_tk/commands/deploy.py", line 393, in deploy_resource_type

result = self.actual_deploy(resources, loader, env_var_warnings)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/vsts/.local/lib/python3.12/site-packages/cognite_toolkit/_cdf_tk/commands/deploy.py", line 423, in actual_deploy

created = self._create_resources(resources.to_create, loader, environment_variable_warning_by_id)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/vsts/.local/lib/python3.12/site-packages/cognite_toolkit/_cdf_tk/commands/deploy.py", line 500, in _create_resources

created = loader.create(resources)

^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/vsts/.local/lib/python3.12/site-packages/cognite_toolkit/_cdf_tk/cruds/_resource_cruds/simulators.py", line 191, in create

return self.client.tool.simulators.model_revisions.create(items)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/vsts/.local/lib/python3.12/site-packages/cognite_toolkit/_cdf_tk/client/api/simulator_model_revisions.py", line 42, in create

return self._request_item_response(items, "create")

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/vsts/.local/lib/python3.12/site-packages/cognite_toolkit/_cdf_tk/client/cdf_client/api.py", line 114, in _request_item_response

for response in self._chunk_requests(items, method, self._serialize_items, params, extra_body, endpoint):

File "/home/vsts/.local/lib/python3.12/site-packages/cognite_toolkit/_cdf_tk/client/cdf_client/api.py", line 165, in _chunk_requests

yield response.get_success_or_raise()

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/vsts/.local/lib/python3.12/site-packages/cognite_toolkit/_cdf_tk/client/http_client/_data_classes.py", line 22, in get_success_or_raise

raise ToolkitAPIError(

cognite_toolkit._cdf_tk.client.http_client._exception.ToolkitAPIError: Request failed with status code 400: File 177485169076625 is not uploaded