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

Duplicate IP addresses with the same UID found #37

Open
ndombroski opened this issue Aug 22, 2024 · 0 comments
Open

Duplicate IP addresses with the same UID found #37

ndombroski opened this issue Aug 22, 2024 · 0 comments

Comments

@ndombroski
Copy link
Collaborator

While operating the netbox-ip-controller, our instance of NetBox experienced a period of downtime where API requests were intermittently failing. This resulted in a number of duplicated IP Address objects in NetBox. The duplicated objects had all fields identical, including UID. After a period of downtime, it is expected for their to be a brief delay in the IP addresses to become eventually consistent, but this should not result in duplicates.

This was discovered due to errors of the following form in the logs:

deleting IP: checking if IP exists: more than one IP with UID "1a9ef0ae-7f1b-47b3-973b-20a61b3d48c2" found

At first glance, this doesn't seem like it should be possible. The function for upserting an IP address is essentially the following logic:
1.) Get the IP address with the given UID
2.) If it does not exist, create it. Else do nothing

It only seems possible for duplicates to happen if the backing data source for NetBox does not have strong read-after-write consistency. In which case, if the function is run twice in rapid succession, then its possible that both times the IP with the given UID is not found, and both times it is created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant