nautobot-app-netbox-importer icon indicating copy to clipboard operation
nautobot-app-netbox-importer copied to clipboard

data import produces failures for existing users (e.g. admin at least)

Open itheodoridis opened this issue 4 years ago • 1 comments

Environment

  • Python version: 3.8.10
  • Nautobot version: 1.0.3
  • nautobot-netbox-importer version: 1.4.0

Expected Behavior

no failures when importing data

Observed Behavior

existing users cause failures, even if no users are there beyond admin, the existence of admin causes a failure

Steps to Reproduce

  1. Create a working installation of Nautobot 1.0.3 on Ubuntu 20.04 with nautobot-netbox-importer 1.4.0 following installation guide for Nautobot on Ubuntu and installation guide from plugin github page.
  2. Export data from a working installation of Netbox 2.10.4 following instructions on the plugin github page
  3. Import data with the use of nautobot-netbox-importer following instructions on the plugin github page

itheodoridis avatar Jul 13 '21 15:07 itheodoridis

Thanks for the report! This is somewhat "working as designed", as inconvenient as that may be, in that it's not trivial for the importer to determine that the user "admin" in the NetBox export is meant to be the same user as "admin" that you've pre-created in Nautobot. Since their primary keys (PKs) don't match, as far as the importer is concerned, these are two separate User accounts who happen to share the same username (which is not permitted in the database, hence why the user creation fails).

The workaround that I would recommend is to ensure that you do not create a user in Nautobot that has the same username as a user that exists in the NetBox database dump - if you really need to create a Nautobot user account prior to running the importer, be sure that it's got a username that does not conflict, even if that means using something like admin2 or nautobot-admin instead of admin.

This would be a good thing to add to the README and/or the FAQ as a potential issue to be avoided; unfortunately I don't think this is something that will be fixable as such.

glennmatthews avatar Jul 13 '21 18:07 glennmatthews