A committed run is reported as unfinished when its events cannot be queued

Abierto
#122 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@pheus ya está trabajando en esto.

Desde el 6/11/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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

v0.0.1

NetBox Version

v4.7.4

Python Version

3.12

Steps to Reproduce
  1. Create a Webhook and an Event Rule that triggers it when a Tag is created.
  2. Upload and activate a Project containing this Script File, deploy.py:
    from extras.models import Tag
    from netbox_scripts import Script
    
    
    class MakeTag(Script):
        def run(self, data, commit):
            Tag.objects.create(name='From Revision', slug='from-revision')
            self.log_success('The tag was created.')
    
  3. Stop Redis and run the Script in the calling process:
    python netbox/manage.py runcustomscript deploy.MakeTag --commit
    
  4. Open the Job result and check the Tags list.
Expected Behavior

The Job should make clear that the Script finished and its database changes were committed, but event processing failed. It should not suggest that the Script itself failed to finish, as running it again could duplicate the changes.

Observed Behavior

The Tag "From Revision" exists, and the Script log contains "The tag was created." without reporting a rollback.

However, the Job is marked Failed and reports:

The Script did not finish: Error 111 connecting to localhost:6379. Connection refused.

The database changes have already been committed. An operator relying on the Job message could run the Script again and apply its changes twice.

The same misleading message can result from other errors raised while NetBox processes events after the transaction has committed.

Lenguaje dominante
Python
Estrellas
8
Forks
0
Merge medio
11 h 22 min
PR fusionados (30 d)
40

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.