Getting error while bulk import of child devices #3692

Closed
opened 2025-12-29 18:30:38 +01:00 by adam · 0 comments
Owner

Originally created by @0HugoStiglitz0 on GitHub (May 15, 2020).

Originally assigned to: @jeremystretch on GitHub.

Environment

  • Python version: 3.6.8
  • NetBox version: 2.8.4

Steps to Reproduce

  1. Going to Device Bulk Import / Child Devices

  2. Insert the list with the needed variables and submit
    Used list:
    device_type,name,device_role,manufacturer,status,parent,device_bay
    DCLink-OM4-6Port,MM_1.01A1-2.01A1,Patchpanel,Generic,Planned,BGT1.01A,1

  3. Getting error below:

Traceback (most recent call last):
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/contrib/auth/mixins.py", line 85, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/views/generic/base.py", line 97, in dispatch
    return handler(request, *args, **kwargs)
  File "/opt/netbox/netbox/utilities/views.py", line 620, in post
    obj_form = self.model_form(data, headers=headers)
  File "/opt/netbox/netbox/dcim/forms.py", line 1977, in __init__
    self.fields['device_bay'].queryset = self.fields['device_bay'].queryset.filter(**params)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/models/query.py", line 904, in filter
    return self._filter_or_exclude(False, *args, **kwargs)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/models/query.py", line 923, in _filter_or_exclude
    clone.query.add_q(Q(*args, **kwargs))
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/models/sql/query.py", line 1351, in add_q
    clause, _ = self._add_q(q_object, self.used_aliases)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/models/sql/query.py", line 1382, in _add_q
    check_filterable=check_filterable,
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/models/sql/query.py", line 1251, in build_filter
    lookups, parts, reffed_expression = self.solve_lookup_type(arg)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/models/sql/query.py", line 1088, in solve_lookup_type
    _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta())
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/models/sql/query.py", line 1484, in names_to_path
    "Choices are: %s" % (name, ", ".join(available)))

Exception Type: FieldError at /dcim/devices/import/child-devices/
Exception Value: Cannot resolve keyword 'device' into field. Choices are: _name, asset_tag, cluster, cluster_id, comments, consoleports, consoleserverports, created, custom_field_values, device_bays, device_role, device_role_id, device_type, device_type_id, face, frontports, id, images, interfaces, inventory_items, last_updated, local_context_data, name, parent_bay, platform, platform_id, position, poweroutlets, powerports, primary_ip4, primary_ip4_id, primary_ip6, primary_ip6_id, rack, rack_id, rearports, secrets, serial, services, site, site_id, status, tagged_items, tags, tenant, tenant_id, vc_master_for, vc_position, vc_priority, virtual_chassis, virtual_chassis_id

-> before updating, it worked fine: I imported aprox. 200 devices and added them there speical parent device / bay. Before, "device_type" was "model_name" and "device_bay" was "device_bay_name"

Expected Behavior

Device "MM_1.01A1-2.01A1" is created as Device Type "DCLink-OM4-6Port", Device Role "Patchpanel" and device is installed in parent Device "BGT1.01A" bay 1.

Observed Behavior

No device is created. Getting error.

Thanks a lot
/Hugo

Originally created by @0HugoStiglitz0 on GitHub (May 15, 2020). Originally assigned to: @jeremystretch on GitHub. ### Environment * Python version: 3.6.8 * NetBox version: 2.8.4 ### Steps to Reproduce 1. Going to Device Bulk Import / Child Devices 2. Insert the list with the needed variables and submit Used list: device_type,name,device_role,manufacturer,status,parent,device_bay DCLink-OM4-6Port,MM_1.01A1-2.01A1,Patchpanel,Generic,Planned,BGT1.01A,1 3. Getting error below: ``` Traceback (most recent call last): File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response response = self.process_exception_by_middleware(e, request) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/views/generic/base.py", line 71, in view return self.dispatch(request, *args, **kwargs) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/contrib/auth/mixins.py", line 85, in dispatch return super().dispatch(request, *args, **kwargs) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/views/generic/base.py", line 97, in dispatch return handler(request, *args, **kwargs) File "/opt/netbox/netbox/utilities/views.py", line 620, in post obj_form = self.model_form(data, headers=headers) File "/opt/netbox/netbox/dcim/forms.py", line 1977, in __init__ self.fields['device_bay'].queryset = self.fields['device_bay'].queryset.filter(**params) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/models/query.py", line 904, in filter return self._filter_or_exclude(False, *args, **kwargs) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/models/query.py", line 923, in _filter_or_exclude clone.query.add_q(Q(*args, **kwargs)) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/models/sql/query.py", line 1351, in add_q clause, _ = self._add_q(q_object, self.used_aliases) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/models/sql/query.py", line 1382, in _add_q check_filterable=check_filterable, File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/models/sql/query.py", line 1251, in build_filter lookups, parts, reffed_expression = self.solve_lookup_type(arg) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/models/sql/query.py", line 1088, in solve_lookup_type _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta()) File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/models/sql/query.py", line 1484, in names_to_path "Choices are: %s" % (name, ", ".join(available))) Exception Type: FieldError at /dcim/devices/import/child-devices/ Exception Value: Cannot resolve keyword 'device' into field. Choices are: _name, asset_tag, cluster, cluster_id, comments, consoleports, consoleserverports, created, custom_field_values, device_bays, device_role, device_role_id, device_type, device_type_id, face, frontports, id, images, interfaces, inventory_items, last_updated, local_context_data, name, parent_bay, platform, platform_id, position, poweroutlets, powerports, primary_ip4, primary_ip4_id, primary_ip6, primary_ip6_id, rack, rack_id, rearports, secrets, serial, services, site, site_id, status, tagged_items, tags, tenant, tenant_id, vc_master_for, vc_position, vc_priority, virtual_chassis, virtual_chassis_id ``` -> before updating, it worked fine: I imported aprox. 200 devices and added them there speical parent device / bay. Before, "device_type" was "model_name" and "device_bay" was "device_bay_name" ### Expected Behavior Device "MM_1.01A1-2.01A1" is created as Device Type "DCLink-OM4-6Port", Device Role "Patchpanel" and device is installed in parent Device "BGT1.01A" bay 1. ### Observed Behavior No device is created. Getting error. Thanks a lot /Hugo
adam added the type: bugstatus: accepted labels 2025-12-29 18:30:38 +01:00
adam closed this issue 2025-12-29 18:30:39 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3692