Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with IPAM Parent/Child Prefixes #7

Closed
ndom91 opened this issue Mar 5, 2021 · 2 comments
Closed

Issue with IPAM Parent/Child Prefixes #7

ndom91 opened this issue Mar 5, 2021 · 2 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@ndom91
Copy link

ndom91 commented Mar 5, 2021

Environment

  • Python version: 3.8.5
  • Nautobot version: git branch develop @ 24d4ec371fb10c6ac0d686dc9578284c8e9cf04f
  • nautobot-netbox-importer version: git branch gfm-error-handler @ 29a1031

Expected Behavior

Observed Behavior

Some prefixes were mentioned relatively early on with the log message Still unable to resolve reference? Later on those same prefixes were again referenced, this time with the message: Apparent duplicate object encountered...

For example:
21:25:37 Still unable to resolve reference? pk=1 source=ipaddress "62.67.209.64/31__{'pk': 1}__None__None__None" target=vrf
and then
21:25:50 Apparent duplicate object encountered. This may be an issue with your source data or may reflect a bug in this plugin. model=prefix "62.67.209.64/31__None__{'name': 'Itenos'}__{'name': 'Alarislabs Pte Ltd'}" model_id=62.67.209.64/31__None__{'name': 'Itenos'}__{'name': 'Alarislabs Pte Ltd'}

Eventually it ended up crashing completely with one of the aforementioned prefixes logged as ...already present.

Here's the full trace:

Traceback (most recent call last):
  File "/opt/nautobot/bin/nautobot-server", line 8, in <module>
    sys.exit(main())
  File "/opt/nautobot/lib/python3.8/site-packages/nautobot/core/cli.py", line 55, in main
    run_app(
  File "/opt/nautobot/lib/python3.8/site-packages/nautobot/core/runner/runner.py", line 268, in run_app
    management.execute_from_command_line([runner_name, command] + command_args)
  File "/opt/nautobot/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/opt/nautobot/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/nautobot/lib/python3.8/site-packages/django/core/management/base.py", line 330, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/nautobot/lib/python3.8/site-packages/django/core/management/base.py", line 371, in execute
    output = self.handle(*args, **options)
  File "/opt/nautobot/lib/python3.8/site-packages/nautobot_netbox_importer/management/commands/import_netbox_json.py", line 92, in handle
    target.sync_from(source, flags=DiffSyncFlags.SKIP_UNMATCHED_DST)
  File "/opt/nautobot/lib/python3.8/site-packages/nautobot_netbox_importer/diffsync/adapters/abstract.py", line 314, in sync_from
    return super().sync_from(source, diff_class=diff_class, flags=flags)
  File "/opt/nautobot/lib/python3.8/site-packages/diffsync/__init__.py", line 464, in sync_from
    result = syncer.perform_sync()
  File "/opt/nautobot/lib/python3.8/site-packages/diffsync/helpers.py", line 251, in perform_sync
    changed |= self.sync_diff_element(element)
  File "/opt/nautobot/lib/python3.8/site-packages/diffsync/helpers.py", line 293, in sync_diff_element
    self.dst_diffsync.add(model)
  File "/opt/nautobot/lib/python3.8/site-packages/nautobot_netbox_importer/diffsync/adapters/abstract.py", line 230, in add
    super().add(obj)
  File "/opt/nautobot/lib/python3.8/site-packages/diffsync/__init__.py", line 623, in add
    raise ObjectAlreadyExists(f"Object {uid} already present")
diffsync.exceptions.ObjectAlreadyExists: Object 62.140.12.64/26__None__None__None already present

If it helps at all, this is what it looks like in Netbox:

image

@glennmatthews glennmatthews added the bug Something isn't working label Mar 5, 2021
@glennmatthews glennmatthews self-assigned this Mar 5, 2021
@glennmatthews
Copy link
Contributor

I'm having trouble reproducing this so far, but some analysis:

21:25:37 Still unable to resolve reference? pk=1 source=ipaddress "62.67.209.64/31__{'pk': 1}__None__None__None" target=vrf

This suggests than in your source data you have an IPAddress (not Prefix) 62.67.209.64/31 which has a reference to a VRF with pk 1 that the importer is not able to find. Can you check the data to see what VRF corresponds to pk 1, and which IPAddress(es) 62.67.209.64/31 are assigned to that or any other VRF?

@glennmatthews glennmatthews added the question Further information is requested label Mar 26, 2021
@glennmatthews
Copy link
Contributor

I believe this issue to have been fixed (most likely by #28) in the latest version of this plugin. If you're still encountering it, feel free to comment and I'll re-open this issue for further investigation. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants