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

django.db.utils.IntegrityError when adding multiple notes to the same maintenance with the same title #140

Closed
glennmatthews opened this issue Oct 20, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@glennmatthews
Copy link
Contributor

Environment

  • Python version:
  • Nautobot version: 1.1.4
  • nautobot-circuit-maintenance version: 0.2.5

Expected Behavior

Circuit maintenance job to run to completion

Observed Behavior

django.db.utils.IntegrityError: duplicate key value violates unique constraint "nautobot_circuit_mainten_maintenance_id_title_f955987f_uniq"
DETAIL:  Key (maintenance_id, title)=(646c824b-d576-4e4c-ba19-19eb307e8d1c, Nonexistent circuit ID _) already exists.

Steps to Reproduce

  1. Receive and process an email notification that references the same nonexistent circuit ID more than once - in this case this appears to be due to the parser not recognizing that "Alternate Circuit ID" needs to be used instead of "Circuit ID", and so mistakenly thinking that the circuit ID _ is being referenced twice:
    image
  2. Job errors out.

Either we should remove the uniqueness constraint that requires that each Note on a CircuitMaintenance must have a unique title, or else we need to explicitly detect and handle the case where a duplicate note would be created and avoid this exception.

@glennmatthews
Copy link
Contributor Author

The specific parser issue is addressed in networktocode/circuit-maintenance-parser#98

@chadell
Copy link
Contributor

chadell commented Oct 21, 2021 via email

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

No branches or pull requests

2 participants