Skip to content

ERR_OPS_APPLY_CHANGE_SET when mandatory Custom Field exists #309

@lukassavukaitis

Description

@lukassavukaitis

Diode version

v1.0.0

Deployment type

docker compose

Deployment type version

Docker Compose version v2.35.1

Diode SDK type

diode-sdk-python

Diode SDK version

Orb agent v2.0.0

Diode NetBox Plugin version

v1.0.0

NetBox version

v4.2.6

Steps to reproduce

Create a Custom Field associated to dcim.device model and make it required.
Create a device manually.
Create a device discovery in Orb agent to discover the same device.

Expected behavior

Device is discovered and any missing pieces are added into Netbox.

Observed behavior

Device discovery fails with "error":"apply change set failed - ERR_OPS_APPLY_CHANGE_SET - {\"id\":\"2a886e79-23ff-44c7-8319-3349af2ba319\",\"errors\":{\"dcim.device\":{\"__all__\":[\"Missing required custom field 'Ownership'.\"

Excerpt from reconciler container log:

{
    "time": "2025-05-05T09:40:25.83555814Z",
    "level": "DEBUG",
    "msg": "generate diff",
    "statusCode": 200,
    "response": {
        "id": "2a886e79-23ff-44c7-8319-3349af2ba319",
        "errors": null,
        "change_set": {
            "id": "2a886e79-23ff-44c7-8319-3349af2ba319",
            "changes": [{
                    "id": "b0125ae1-29d3-41e6-a48b-da0f093d6f6b",
                    "change_type": "noop",
                    "object_type": "dcim.devicerole",
                    "object_id": 2,
                    "ref_id": null,
                    "object_primary_value": "LAN Switch",
                    "before": {
                        "color": "ffeb3b",
                        "description": "Standard LAN-Switch Role for all belongings (shared and dedicated LAN)",
                        "id": 2,
                        "name": "LAN Switch",
                        "slug": "lan-switch",
                        "vm_role": false
                    },
                    "data": {},
                    "new_refs": []
                }, {
                    "id": "34ebbcf8-3911-46cd-9e44-534b29228f51",
                    "change_type": "noop",
                    "object_type": "dcim.site",
                    "object_id": 23,
                    "ref_id": null,
                    "object_primary_value": "My Site",
                    "before": {
                        "description": "My Site office",
                        "group": 24,
                        "id": 23,
                        "latitude": 54.123456,
                        "longitude": 23.123456,
                        "name": "My Site",
                        "physical_address": "1600 Pennsylvania Avenue NW",
                        "region": 4,
                        "shipping_address": "1600 Pennsylvania Avenue NW",
                        "slug": "site-my-site",
                        "status": "active",
                        "tenant": 14
                    },
                    "data": {},
                    "new_refs": []
                }, {
                    "id": "e945da26-6b9d-4718-b7f6-5937c6ba490f",
                    "change_type": "noop",
                    "object_type": "dcim.manufacturer",
                    "object_id": 1,
                    "ref_id": null,
                    "object_primary_value": "Cisco",
                    "before": {
                        "custom_fields": {},
                        "id": 1,
                        "name": "Cisco",
                        "slug": "cisco"
                    },
                    "data": {},
                    "new_refs": []
                }, {
                    "id": "f4832b28-9dc4-4215-a5a9-bf0cf46c61e7",
                    "change_type": "noop",
                    "object_type": "dcim.devicetype",
                    "object_id": 1973,
                    "ref_id": null,
                    "object_primary_value": "WS-C2960X-48FPD-L",
                    "before": {
                        "custom_fields": {},
                        "exclude_from_utilization": false,
                        "id": 1973,
                        "is_full_depth": false,
                        "manufacturer": 1,
                        "model": "WS-C2960X-48FPD-L",
                        "part_number": "WS-C2960X-48FPD-L",
                        "slug": "ws-c2960x-48fpd-l",
                        "u_height": 1.0
                    },
                    "data": {},
                    "new_refs": []
                }, {
                    "id": "4020f58d-e2cd-47ab-8724-99d5b289fc6b",
                    "change_type": "update",
                    "object_type": "dcim.platform",
                    "object_id": 368,
                    "ref_id": null,
                    "object_primary_value": "ios",
                    "before": {
                        "id": 368,
                        "name": "ios",
                        "slug": "ios"
                    },
                    "data": {
                        "id": 368,
                        "manufacturer": 1,
                        "name": "ios"
                    },
                    "new_refs": []
                }, {
                    "id": "ae44d4d5-92e7-400d-907e-6b6722a7a78d",
                    "change_type": "create",
                    "object_type": "dcim.device",
                    "object_id": null,
                    "ref_id": "new_object:dcim.device:1b53fedb-81a1-4d33-aebe-ed29156ea069",
                    "object_primary_value": "My-Switch-Name",
                    "before": {},
                    "data": {
                        "custom_fields": {},
                        "device_type": 1973,
                        "name": "My-Switch-Name",
                        "platform": 368,
                        "role": 2,
                        "serial": "FOC2866S1G8",
                        "site": 23,
                        "status": "active"
                    },
                    "new_refs": []
                }
            "branch": null
        }
    }
}{
    "time": "2025-05-05T09:40:25.84171016Z",
    "level": "DEBUG",
    "msg": "change set generated",
    "id": 508,
    "externalID": "2a886e79-23ff-44c7-8319-3349af2ba319",
    "ingestionLogID": 508
}{
    "time": "2025-05-05T09:40:25.918239048Z",
    "level": "DEBUG",
    "msg": "apply change set",
    "payload": {
        "id": "2a886e79-23ff-44c7-8319-3349af2ba319",
        "changes": [{
                "id": "b0125ae1-29d3-41e6-a48b-da0f093d6f6b",
                "change_type": "noop",
                "object_type": "dcim.devicerole",
                "object_id": 2,
                "data": {},
                "object_primary_value": "LAN Switch"
            }, {
                "id": "34ebbcf8-3911-46cd-9e44-534b29228f51",
                "change_type": "noop",
                "object_type": "dcim.site",
                "object_id": 23,
                "data": {},
                "object_primary_value": "My Site"
            }, {
                "id": "e945da26-6b9d-4718-b7f6-5937c6ba490f",
                "change_type": "noop",
                "object_type": "dcim.manufacturer",
                "object_id": 1,
                "data": {},
                "object_primary_value": "Cisco"
            }, {
                "id": "f4832b28-9dc4-4215-a5a9-bf0cf46c61e7",
                "change_type": "noop",
                "object_type": "dcim.devicetype",
                "object_id": 1973,
                "data": {},
                "object_primary_value": "WS-C2960X-48FPD-L"
            }, {
                "id": "4020f58d-e2cd-47ab-8724-99d5b289fc6b",
                "change_type": "update",
                "object_type": "dcim.platform",
                "object_id": 368,
                "data": {
                    "id": 368,
                    "manufacturer": 1,
                    "name": "ios"
                },
                "object_primary_value": "ios"
            }, {
                "id": "ae44d4d5-92e7-400d-907e-6b6722a7a78d",
                "change_type": "create",
                "object_type": "dcim.device",
                "ref_id": "new_object:dcim.device:1b53fedb-81a1-4d33-aebe-ed29156ea069",
                "data": {
                    "custom_fields": {},
                    "device_type": 1973,
                    "name": "My-Switch-Name",
                    "platform": 368,
                    "role": 2,
                    "serial": "FOC2866S1G8",
                    "site": 23,
                    "status": "active"
                },
                "object_primary_value": "My-Switch-Name"
            }
        ]
    }
}{
    "time": "2025-05-05T09:40:25.95994901Z",
    "level": "DEBUG",
    "msg": "apply change set",
    "response": {
        "id": "2a886e79-23ff-44c7-8319-3349af2ba319",
        "errors": {
            "dcim.device": {
                "__all__": ["Missing required custom field 'Ownership'."]
            }
        }
    }
}{
    "time": "2025-05-05T09:40:25.959994177Z",
    "level": "DEBUG",
    "msg": "failed to apply change set",
    "id": 508,
    "externalID": "2a886e79-23ff-44c7-8319-3349af2ba319",
    "ingestionLogID": 508,
    "error": "apply change set failed - ERR_OPS_APPLY_CHANGE_SET - {"id":"2a886e79-23ff-44c7-8319-3349af2ba319","errors":{"dcim.device":{"__all__":["Missing required custom field 'Ownership'."]}}}"
}{
    "time": "2025-05-05T09:40:25.962210968Z",
    "level": "ERROR",
    "msg": "error applying changeset",
    "error": "apply change set failed - ERR_OPS_APPLY_CHANGE_SET - {"id":"2a886e79-23ff-44c7-8319-3349af2ba319","errors":{"dcim.device":{"__all__":["Missing required custom field 'Ownership'."]}}}"
}

Image

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus: needs triageThis issue is awaiting triage by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions