Concurrent Project creation allows overlapping Data Source paths

Abierto
#213 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
22/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
django, python
Área
backend, database

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
9
Forks
0
Merge medio
18 h 59 min
PR fusionados (30 d)
93

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de netbox-community/netbox-scripts

Todos los issues de netbox-community/netbox-scripts

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.