netbox.events_processor ERROR: Cannot import events pipeline extras.events.process_event_queue error: 'ScriptModule' object has no attribute 'python_class' #9758

Closed
opened 2025-12-29 21:22:10 +01:00 by adam · 8 comments
Owner

Originally created by @Rukas307 on GitHub (May 28, 2024).

Originally assigned to: @arthanson on GitHub.

Deployment Type

Self-hosted

NetBox Version

4.0.3

Python Version

3.11

Steps to Reproduce

  1. Create the basic requirements for a script to run and attempt to log anything from the script, such as self.log_info(data).
  2. Create a data source for the script stored on the local machine
  3. Connected to an event rule using event triggers update and create, I have tested Device, Device Role and IP Address in my use case as the object types.
  4. Create or update a Device.
    image

Expected Behavior

Logging script information to the form will occur and the script will run.

Observed Behavior

image

netbox.events_processor ERROR: Cannot import events pipeline extras.events.process_event_queue error: 'ScriptModule' object has no attribute 'python_class'

I am able to utilise the script without logging and get an expected result.

Originally created by @Rukas307 on GitHub (May 28, 2024). Originally assigned to: @arthanson on GitHub. ### Deployment Type Self-hosted ### NetBox Version 4.0.3 ### Python Version 3.11 ### Steps to Reproduce 1. Create the basic requirements for a script to run and attempt to log anything from the script, such as self.log_info(data). 2. Create a data source for the script stored on the local machine 3. Connected to an event rule using event triggers update and create, I have tested Device, Device Role and IP Address in my use case as the object types. 4. Create or update a Device. ![image](https://github.com/netbox-community/netbox/assets/124249850/59c6b14d-492d-4586-9918-a52967a04d48) ### Expected Behavior Logging script information to the form will occur and the script will run. ### Observed Behavior ![image](https://github.com/netbox-community/netbox/assets/124249850/d2274011-8abc-4cba-9e3f-8ef9c9203a32) netbox.events_processor ERROR: Cannot import events pipeline extras.events.process_event_queue error: 'ScriptModule' object has no attribute 'python_class' I am able to utilise the script without logging and get an expected result.
adam added the type: bugstatus: revisions neededtopic: event rules labels 2025-12-29 21:22:10 +01:00
adam closed this issue 2025-12-29 21:22:10 +01:00
Author
Owner

@arthanson commented on GitHub (May 29, 2024):

Thank you for opening a bug report. I was unable to reproduce the reported behavior on NetBox v4.0.3. Please re-confirm the reported behavior on the current stable release and adjust your post above as necessary. Remember to provide detailed steps that someone else can follow using a clean installation of NetBox to reproduce the issue. Remember to include the steps taken to create any initial objects or other data.

@Rukas307 can you please provide a simple script and step-by-step of a reproduction scenario? I did a simple script with the following run method:

    def run(self, data, commit):
        site = Site.objects.first()
        self.log_info("Script was executed", obj=site)

Attached it to a circuit creation event, then created the circuit and it ran fine. Here is the output:

Monosnap python netbox:manage py rqworker high default low 2024-05-29 07-20-17

@arthanson commented on GitHub (May 29, 2024): Thank you for opening a bug report. I was unable to reproduce the reported behavior on NetBox v4.0.3. Please re-confirm the reported behavior on the current stable release and adjust your post above as necessary. Remember to provide detailed steps that someone else can follow using a clean installation of NetBox to reproduce the issue. Remember to include the steps taken to create any initial objects or other data. @Rukas307 can you please provide a simple script and step-by-step of a reproduction scenario? I did a simple script with the following run method: ``` def run(self, data, commit): site = Site.objects.first() self.log_info("Script was executed", obj=site) ``` Attached it to a circuit creation event, then created the circuit and it ran fine. Here is the output: ![Monosnap python netbox:manage py rqworker high default low 2024-05-29 07-20-17](https://github.com/netbox-community/netbox/assets/99642/7bdfe317-ad20-4e42-a834-da96ffa3a9bc)
Author
Owner

@Rukas307 commented on GitHub (May 29, 2024):

Hi @arthanson I have updated the post, including the sample script screen shot.

@Rukas307 commented on GitHub (May 29, 2024): Hi @arthanson I have updated the post, including the sample script screen shot.
Author
Owner

@arthanson commented on GitHub (May 29, 2024):

@Rukas307 I'm running your script and it is working fine on my system. Can you please try re-starting your RQ queue to check if that works?

@arthanson commented on GitHub (May 29, 2024): @Rukas307 I'm running your script and it is working fine on my system. Can you please try re-starting your RQ queue to check if that works?
Author
Owner

@Rukas307 commented on GitHub (May 30, 2024):

@Rukas307 I'm running your script and it is working fine on my system. Can you please try re-starting your RQ queue to check if that works?

I have restarted RQ Queue and am still seeing the same issue.

@Rukas307 commented on GitHub (May 30, 2024): > @Rukas307 I'm running your script and it is working fine on my system. Can you please try re-starting your RQ queue to check if that works? I have restarted RQ Queue and am still seeing the same issue.
Author
Owner

@arthanson commented on GitHub (Jun 4, 2024):

@Rukas307 can you run the script directly without an event? I'd also suggest moving this over to discussions as it doesn't currently look like a bug as we can't reproduce and you can get a much wider audience looking at the issue and they might have suggestions if you open it as a discussion.

@arthanson commented on GitHub (Jun 4, 2024): @Rukas307 can you run the script directly without an event? I'd also suggest moving this over to discussions as it doesn't currently look like a bug as we can't reproduce and you can get a much wider audience looking at the issue and they might have suggestions if you open it as a discussion.
Author
Owner

@arthanson commented on GitHub (Jun 11, 2024):

Closing as no response, @Rukas307 please open as a discussion

@arthanson commented on GitHub (Jun 11, 2024): Closing as no response, @Rukas307 please open as a discussion
Author
Owner

@PaulR282 commented on GitHub (Jul 15, 2024):

I have the same problem. I already opened a discussion for this: #16912 This happened when upgrading to v4 and having event rules that trigger scripts.

@PaulR282 commented on GitHub (Jul 15, 2024): I have the same problem. I already opened a discussion for this: #16912 This happened when upgrading to v4 and having event rules that trigger scripts.
Author
Owner

@jhofmueller commented on GitHub (Aug 28, 2024):

This is a real issue. I just upgrade one of our instances from 3.7.8 to 4.0.9 and some events did not work any more. The procedure discussed here #16912 worked.

The thing is that events fail silently and one only finds out what is wrong when one looks at the logs after finding out that scripts/webhooks did not run.

@jhofmueller commented on GitHub (Aug 28, 2024): This is a real issue. I just upgrade one of our instances from 3.7.8 to 4.0.9 and some events did not work any more. The procedure discussed here [#16912](https://github.com/netbox-community/netbox/discussions/16912) worked. The thing is that events fail silently and one only finds out what is wrong when one looks at the logs after finding out that scripts/webhooks did not run.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9758