Concurrent Project creation allows overlapping Data Source paths

Đang mở
#213 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
22/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
django, python
Lĩnh vực
backend, database

Hướng nghiên cứu

The bug is in the POST handler for /api/plugins/netbox-scripts/projects/, where data path overlap is validated before the Project is saved. Start by finding that validation and the create path, then check how it runs inside a transaction. Reproduce with two concurrent requests using the steps in the issue. Done means concurrent creation of overlapping Projects on one Data Source is rejected, and the existing edit validation still passes.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

app: scripts Bucket: KTLO severity: low status: backlog type: bug
Plugin Version

v0.1.0

NetBox Version

v4.7.6

Python Version

3.12

Steps to Reproduce
  1. Create and synchronize a Data Source containing the directory automation/netbox.
  2. From separate clients, concurrently send two POST requests to /api/plugins/netbox-scripts/projects/ to create Data Source-backed Projects on the same Data Source, using distinct names and keys and the following data paths:
    • automation
    • automation/netbox
  3. Check the resulting Projects.
Expected Behavior

One request succeeds and the other is rejected with a validation error. Projects on the same Data Source must not have overlapping directories.

Observed Behavior

If both requests validate before either transaction commits, both Projects can be created despite their overlapping directories.

Subsequent attempts to edit either Project fail validation because of the overlapping data paths.

The race condition was reproduced using separate database sessions on the development branch for #33.

Ngôn ngữ chính
Python
Star
9
Fork
0
Merge trung bình
18 giờ 59 phút
Pull request đã merge (30 ngày)
93

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của netbox-community/netbox-scripts

Tất cả issue của netbox-community/netbox-scripts

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.