Skip to content

The instance of entity type 'Installation' cannot be tracked because another instance with the same key value for {'Id'} is already being tracked #2473

@tsundvoll

Description

@tsundvoll

Describe the bug
Got a 500 error when trying to delete an InspectionArea with Swagger

To Reproduce
Steps to reproduce the behavior:

  1. call DELETE inspectionAreas/{id} in Swagger for an existing inspectionArea ID
  2. observe that the error message in the Flotilla backend is:
    System.InvalidOperationException: The instance of entity type 'Installation' cannot be tracked because another instance with the same key value for {'Id'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.

Expected behavior
The inspectionArea should have been deleted

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend related functionalitybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions