Malformed revision manifests cause server errors

Abierto
#232 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
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
backend

Línea de trabajo

Start by reading the existing manifest validation used by the revision file's Source tab, then trace the manifest consumers named in the issue across the project pages, file detail pages, upload operations, and REST API. Check how each consumer handles malformed stored data and how operations avoid changes when validation fails. Done means affected pages show a meaningful error without manifest-derived information, and dependent operations are refused without changes.

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

Descripción

app: scripts 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 an upload-backed Script Project and upload a Script.
  2. Once the revision is active, overwrite its manifest using nbshell:
    from netbox_scripts.models import ScriptProjectRevision
    
    ScriptProjectRevision.objects.filter(pk=<revision_id>).update(manifest=[None])
    
  3. Open any of the following pages or attempt to upload another Script:
    • Script Project's Script Files tab
    • Script Project's Revision Files tab
    • Script File detail page
    • Revision's Files tab
    • Revision file's File tab

The last three pages are affected by the changes introduced in #224.

Expected Behavior

The affected pages remain usable and display a meaningful error, consistent with the revision file's Source tab. Information and links derived from an invalid manifest are not displayed.

Operations that depend on the manifest are refused without making changes.

Observed Behavior

The affected pages and operations fail with an HTTP 500 error, for example:

TypeError: 'NoneType' object is not subscriptable

Several consumers access the stored manifest without validating it first. This also affects the REST API.

The revision file's Source tab already handles this gracefully by displaying "The stored manifest cannot be trusted."

All manifest consumers should handle malformed manifests consistently by reusing the existing manifest validation mechanism.

The issue was identified during the implementation and review of #24 (#224).

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.