-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: needs ownerThis issue is tentatively accepted pending a volunteer committed to its implementationThis issue is tentatively accepted pending a volunteer committed to its implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
Deployment Type
Self-hosted
NetBox Version
v4.2.9
Python Version
3.12
Steps to Reproduce
- Attempt to import a CSV file with duplicate entries (with the same ID) for DCIM Devices.
- Observe the error message displayed in the UI.
- Check the logs with DEBUG logging disabled.
Expected Behavior
- The error message should accurately reflect the cause of the error, indicating that there are duplicate entries in the CSV file.
- The error should be logged even when DEBUG logging is disabled, to ensure proper tracking and diagnosis.
Observed Behavior
We encountered an issue related to the Operation failed due to object-level permissions violation error message during a bulk import operation. There are a couple of problems that I would like to report:
- Misleading Error Message: The error message Operation failed due to object-level permissions violation is misleading. The error occurs because of a check to verify that the number of objects intended to be updated matches the number updated in the database. This error is raised if any of the items in the CSV file to be imported are repeated. The actual issue is related to duplicate entries in the CSV file, not object-level permissions.
- Logging Issue: Errors like this are only logged if DEBUG logging is enabled. Otherwise, they only appear momentarily in the UI. This results in no record of the error in the logs, as we typically log error-level messages in production. This makes it difficult to track and diagnose such issues.

This line seems to be the issue:
if self.queryset.filter(pk__in=[obj.pk for obj in new_objs]).count() != len(new_objs): |
Metadata
Metadata
Assignees
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: needs ownerThis issue is tentatively accepted pending a volunteer committed to its implementationThis issue is tentatively accepted pending a volunteer committed to its implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application