Skip to content

Change of rack location via API does not work #18132

@TorstenEhrhardt

Description

@TorstenEhrhardt

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.1.7

Python Version

3.11

Steps to Reproduce

  • Create Rack in a site and location
  • facility id is not set (null)
  • send patch request to /api/dcim/racks/:id/ with payload
{
    "location": {
        "name": "Other location",
        "site": {
            "name": "Other site"
        }
    },
    "site": {
        "name": "Other site"
    }
}

or only change location with a global unique location

{
    "location": {
        "name": "Other location"
    }
}

Example performed on https://demo.netbox.dev

grafik

Expected Behavior

Location and site of rack is changed, like it does in the frontend

Observed Behavior

Receiving

{
"non_field_errors": [
"The fields location, facility_id must make a unique set."
]
}

If you set some facility_id in the request it's working, also set the facility_id to null after the location was changed

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: duplicateThis issue has already been raisedtype: bugA confirmed report of unexpected behavior in the application

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions