cairis-platform / cairis-platform/cairis

Model Packages not importable after changing Options/Asset Types

Open
#679 1 comment 1 reaction 1 assignee Claimed by @failys View on GitHub
bug
Dominant language
Python
Stars
172
Forks
61
PR merge metrics
No merged PRs in 30d

Description

### Problem

You can't import a cairis-file if it contains new/different asset types.

### Steps to reproduce:

- Start Cairis-Docker with mysql 8.4 and the latest cairis-docker-containers.
- Create new Database A
- Options/Asset Types: update "Systems" to "System"
- Risk/Assets: Create a new Asset of Type "System"
- System/Export / Model Package (.cairis)
- Create new Database B
- System/Import Model - Pick cairis File.
- You encounter an error message like
[Home](http://servername:7071/)
Import

Error importing /tmpDocker/model.xml: 'Update error (message:(MySQLdb._exceptions.OperationalError) (1048, "Column \'asset_type_id\' cannot be null")\n[SQL: call addAsset(%s,%s,%s,%s,%s,%s,%s,%s)]\n[parameters: (117, \'a\', \'a\', \'a\', \'a\', \'System\', \'0\', \'\')]\n(Background on this error at: https://sqlalche.me/e/20/e3q8))'

Same Problem if you define new asset types instead of updating existing ones.

### Expected behavior

Cairis imports asset types before importing assets and is able to import complete cairis files even if they include different asset types.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.