Skip to main content
Question

Cdf toolkit version 0.7.x breaks our view dependencies resolution when releasing new version of our data model

  • March 30, 2026
  • 3 replies
  • 26 views

Marwen TALEB
MVP

Hello, 

Currently using cdf-tk version 0.5.111. The bySpace param on btree indexes is not yet supported in this version.

We are trying to migrate to version 0.7.220. Although, this version sets correctly the bySpace param on indexes it does not seem to resolve correctly the view dependencies in our data model.

Error trace: 
 

Deploying 375 views to CDF...
WARNING [MEDIUM]: Found a strongly interdependent set of 75 views: 
sp_dm_dap_knowledge_graph:BHAComponent(version=4.3), sp_dm_dap_knowledge_graph:BHARun(version=4.3), 
(...)
sp_dm_dap_knowledge_graph:WellPath(version=4.3), sp_dm_dap_knowledge_graph:Wellbore(version=4.3) and 
sp_dm_dap_knowledge_graph:WellboreSection(version=4.3). This might indicate a data model design issue, and 
the deployment might fail due to API batch size limits.
Traceback (most recent call last):
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/bin/cdf-tk", line 8, in <module>
    sys.exit(app())
             ~~~^^
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/cognite_toolkit/_cdf.py", line 134, in app
    _app()
    ~~~~^^
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/typer/main.py", line 1152, in __call__
    raise e
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/typer/main.py", line 1135, in __call__
    return get_command(self)(*args, **kwargs)
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File “pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/typer/core.py", line 813, in main
    return _main(
        self,
    ...<6 lines>...
        **extra,
    )
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/typer/core.py", line 189, in _main
    rv = self.invoke(ctx)
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/typer/main.py", line 1514, in wrapper
    return callback(**use_params)
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/cognite_toolkit/_cdf_tk/apps/_core_app.py", line 387, in deploy
    cmd.run(
    ~~~~~~~^
        lambda: cmd.deploy_build_directory(
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<9 lines>...
        )
        ^
    )
    ^
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/cognite_toolkit/_cdf_tk/commands/_base.py", line 77, in run
    raise e
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/cognite_toolkit/_cdf_tk/commands/_base.py", line 74, in run
    result = execute(*args, **kwargs)
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/cognite_toolkit/_cdf_tk/apps/_core_app.py", line 388, in <lambda>
    lambda: cmd.deploy_build_directory(
            ~~~~~~~~~~~~~~~~~~~~~~~~~~^
        env_vars=env_vars,
        ^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
        verbose=verbose,
        ^^^^^^^^^^^^^^^^
    )
    ^
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/cognite_toolkit/_cdf_tk/commands/deploy.py", line 113, in deploy_build_directory
    self.deploy_all_resources(
    ~~~~~~~~~~~~~~~~~~~~~~~~~^
        client=client,
        ^^^^^^^^^^^^^^
    ...<9 lines>...
        verbose=verbose,
        ^^^^^^^^^^^^^^^^
    )
    ^
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/cognite_toolkit/_cdf_tk/commands/deploy.py", line 325, in deploy_all_resources
    resource_result = self.deploy_resource_type(
        loader,
    ...<6 lines>...
        verbose,
    )
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/cognite_toolkit/_cdf_tk/commands/deploy.py", line 405, in deploy_resource_type
    result = self.actual_deploy(resources, loader, env_var_warnings)
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/cognite_toolkit/_cdf_tk/commands/deploy.py", line 435, in actual_deploy
    created = self._create_resources(resources.to_create, loader, environment_variable_warning_by_id)
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/cognite_toolkit/_cdf_tk/commands/deploy.py", line 512, in _create_resources
    created = loader.create(resources)
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/cognite_toolkit/_cdf_tk/cruds/_resource_cruds/datamodel.py", line 766, in create
    created.extend(self.client.tool.views.create(batch))
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
  File "/pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/cognite_toolkit/_cdf_tk/client/api/views.py", line 50, in create
    return self._request_item_response(items, "upsert")
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/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 "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/cognite_toolkit/_cdf_tk/client/cdf_client/api.py", line 165, in _chunk_requests
    yield response.get_success_or_raise(request)
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "pypoetry/virtualenvs/drillx-dwdap-cdf-toolkit-fxS2v_xU-py3.13/lib/python3.13/site-packages/cognite_toolkit/_cdf_tk/client/http_client/_data_classes.py", line 28, in get_success_or_raise
    raise ToolkitAPIError(
    ...<5 lines>...
    )
cognite_toolkit._cdf_tk.client.http_client._exception.ToolkitAPIError: Request failed with status code 400: Cannot upsert view 'sp_dm_dap_knowledge_graph:GlobalCost/4.3' because the source view 'sp_dm_dap_knowledge_graph:GlobalCostItem/4.3' does not exist.

 

previous used version (0.5.111), we have the following log and cdf-tk manages to create a correct dependency tree of our views and deploy correctly the data model: 

 

Deploying 375 views to CDF...

2026-03-30T15:09:37+00:00 WARNING [LOW]: Failed to create 370 views: Cannot

upsert view 'sp_dm_well_wb_generalities:Wellbore/4.6'. Implemented view

'sp_dm_dap_knowledge_graph:WellboreBaseAttributes/4.6' does not exist..

Attempting to recover...

 

What do you suggest? 

 

Thank you 

3 replies

Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img+8

@Anders Albert will you be able to help out here?


Peter  Arwanitis
Practitioner
Forum|alt.badge.img

Toolkit has added support for stricter validation, and as a consequence started to support dependency resolution (ordering) with 0.7.145 (as an alpha feature)  and 0.7.181 as standard. 

 

The question now is, why this didn't help in this case?


Forum|alt.badge.img

Hello Marwen,

Thank you for alerting us about this issue!

As noted by ​@Peter Arwanitis, we have implemented new deployment logic which should have made it possible for you to deploy this model, however we identified a bug in this logic which is the likely culprit in your case.

We just released version 0.7.226 of Toolkit which includes a patch that fixes this bug, would you be able to update to this version and retry deployment and see if it works for you now?

(Note that the validation which gave you the HTTP 400 error and which this patch mitigates is only run upon first creating a new view or updating a view to a new version)

Note also that you will still receive the “WARNING [MEDIUM]: Found a strongly interdependent set of 75 views: “ warning in the new version, although this is unlikely to be an issue on your end, and should no longer lead to a crash. Please reach out again if you see this number nearing or going above 100, this is a hard limit currently enforced in the API and we will need to consider other options if that happens (at that point, it would also fail with version 0.5.111 of toolkit)