Skip to content

[Bug]: Erroneous "More than one result returned for primary_mac_address" #1379

Open
@MrDrMcCoy

Description

@MrDrMcCoy

Ansible NetBox Collection version

devel, commit fa4c44b

Ansible version

$ ansible --version
ansible [core 2.18.2]
  config file = /home/jmccoy/.ansible.cfg
  configured module search path = ['/home/jmccoy/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules', '/home/jmccoy/git/configMgmt/ansible/plugins/modules', '/home/jmccoy/configMgmt/ansible/plugins/modules', '/home/jmccoy/.local/lib/python3.10/site-packages/ansible/plugins/modules', '/home/jmccoy/.local/lib/python3.11/site-packages/ansible/plugins/modules', '/home/jmccoy/.local/lib/python3.12/site-packages/ansible/plugins/modules']
  ansible python module location = /home/jmccoy/.local/lib/python3.12/site-packages/ansible
  ansible collection location = /home/jmccoy/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/jmccoy/.local/bin/ansible
  python version = 3.12.3 (main, Jan 17 2025, 18:03:48) [GCC 13.3.0] (/usr/bin/python3)
  jinja version = 3.1.4
  libyaml = True

NetBox version

NetBox Community v4.2.3

Python version

3.11

Steps to Reproduce

ansible-playbook netbox_host.yml -e @~/pod-050-1029-00.yml --tags=delete,all --skip-tags=check_pod_count -v

Full log and role/playbook: https://cloud.protobit.io/index.php/s/irzycamBkcTpEt8

Steps to reproduce are:

  1. Create new host object
  2. Create interface for that host
  3. Create MAC address, associated with that interface
  4. Update the interface to set the MAC we just created as primary

Expected Behavior

The interface should be updated with the primary MAC address.

Observed Behavior

This succeeds for most cases, but occasionally errors out with msg: More than one result returned for primary_mac_address.
We do not believe this should be possible, as the MAC address object is new and unique in Netbox.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions