Skip to main content
Question

After version 0.8.0 of Cognite Toolkit, table definitions in .Database.yaml files lead to database deletion attempts

  • April 28, 2026
  • 2 replies
  • 12 views

When attempting to upgrade from version 0.7.237 to 0.8.33, we saw the following error in our deployment log

  ERROR (ResourceDeleteError): Failed to delete raw databases due to API error: 
Request failed with status code 400: Tried to delete non-empty databases
raw_miros non-recursively.
The request body and response has been written to
deploy_logs_2026-04-24/2026-04-24T15_28_00.297618+00_00.json for debugging
purposes.

The raw_miros database is referenced in input files with the .Database.yaml file extension and with contents like this

- dbName: '{{raw_db_name_prefix}}_miros'
tableName: header_alv
- dbName: '{{raw_db_name_prefix}}_miros'
tableName: header_iaa
- dbName: '{{raw_db_name_prefix}}_miros'
tableName: header_ska
...

Based on dry runs, it seems like we can avoid database deletion attempts by renaming the files to have the .Table.yaml file extension.

The YAML reference page for Cognite Toolkit states

RAW table configuration filenames must end with Table, for example, my_table.Table.yaml. Database configuration filenames must end with Database, for example, my_database.Database.yaml.

Although the reference does not present an example of a database configuration, I believe a database configuration only has the dbName property, not a tableName property like above. The input file worked as intended in version 0.7.237 and earlier.

It is difficult to see how Cognite Toolkit’s attempt to delete the RAW database in version 0.8.33 is reasonable based on the input files, so I suspect this constitutes a bug even if we should rename our files with the .Table.yaml file extension.

2 replies

Forum|alt.badge.img

Hi Ivar, confirming that we’ve seen your report and we are currently working on a fix. Thank you for reporting this! 


Forum|alt.badge.img

Following up on this —thank you again for taking the time to share the full details, this was super helpful Ivar!

What was happening: when a .Database.yaml contained tableName entries, cdf deploy saw a diff between your file and what was deployed in CDF (since the database resource only stores the name) and incorrectly classified the database as needing recreation. That's why you saw it attempt a delete on a plain cdf deploy 

I also wanted to note that no data was ever at risk. The toolkit's deletion process for RAW tables was always rejected by CDF on a non-empty database with a hard error — this is exactly the error you ran into. 

We've shipped a fix in 0.8.58: cdf deploy now skips these resources when .Database.yaml or .Table.yaml files are misconfigured.

On your end you will now need to split your tables out of the .Database.yaml files. Each .Database.yaml should contain only dbName entries (the database name itself); any entries with tableName belong in a separate .Table.yaml. Once you've done that and upgraded to 0.8.58, your tables should be deployed correctly on the next cdf build + cdf deploy. The cdf build step will warn you about any remaining misshaped files.

Thanks again for flagging this!