remote script execution fails: "property 'result' of 'Script' object has no setter" #9649

Closed
opened 2025-12-29 21:20:18 +01:00 by adam · 12 comments
Owner

Originally created by @bitcollector1 on GitHub (May 10, 2024).

Originally assigned to: @jeffgdotorg on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.0.1

Python Version

3.12

Steps to Reproduce

Not able to run scripts remotely since upgrading to 4.0

 curl -X POST "https://netdevbox.hwe.ebay.com/api/extras/scripts/23/" -H "accept: application/json" -H "Authorization: Token 0ee9654cccaa1d17fabb2f689c3587262300163d" -H "Content-Type: application/json" --data '{"commit":true,"data":{"serial_num": "S508754X3919812B"}}'
{"error": "property 'result' of 'Script' object has no setter", "exception": "AttributeError", "netbox_version": "4.0.1", "python_version": "3.12.3"}

Expected Behavior

Script executes as it did prior to upgrade to 4.0

Observed Behavior

Remote script fails with errors. The script runs fine in GUI. Script was working for many months before upgrading to 4.0

Originally created by @bitcollector1 on GitHub (May 10, 2024). Originally assigned to: @jeffgdotorg on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.0.1 ### Python Version 3.12 ### Steps to Reproduce Not able to run scripts remotely since upgrading to 4.0 ``` curl -X POST "https://netdevbox.hwe.ebay.com/api/extras/scripts/23/" -H "accept: application/json" -H "Authorization: Token 0ee9654cccaa1d17fabb2f689c3587262300163d" -H "Content-Type: application/json" --data '{"commit":true,"data":{"serial_num": "S508754X3919812B"}}' ``` ``` {"error": "property 'result' of 'Script' object has no setter", "exception": "AttributeError", "netbox_version": "4.0.1", "python_version": "3.12.3"} ``` ### Expected Behavior Script executes as it did prior to upgrade to 4.0 ### Observed Behavior Remote script fails with errors. The script runs fine in GUI. Script was working for many months before upgrading to 4.0
adam added the type: bugstatus: revisions needed labels 2025-12-29 21:20:18 +01:00
adam closed this issue 2025-12-29 21:20:18 +01:00
Author
Owner

@bitcollector1 commented on GitHub (May 10, 2024):

invoking with the verbose options shows the following

< HTTP/1.1 500 Internal Server Error
@bitcollector1 commented on GitHub (May 10, 2024): invoking with the verbose options shows the following ``` < HTTP/1.1 500 Internal Server Error ```
Author
Owner

@bitcollector1 commented on GitHub (May 10, 2024):

I tried the old command and removed the trailing "/" that was previously used and it now fires off the script but seems to have started multiple instances.

curl -v -X POST -H "Authorization: Token cc962e6655123a1887886a4399f86e808f349225" -H "Content-Type: application/json" -H "Accept: application/json; indent=4" http://netdevbox.hwe.ebay.com/api/extras/scripts/add_update_minios_system.Minios_Webhook --data '{"data": {"serial": "S514175X3706743B", "productname": "SYS-211GT-HNTF", "mfg_name": "Supermicro", "hostname": "minios-S514175X3706743B", "ip_10g": "10.254.149.9", "ip_bmc": "10.254.148.137", "mac_address_10g": "7c:c2:55:32:00:82", "mac_address_bmc": "7c:c2:55:81:11:eb"}, "commit": true}'

Screenshot 2024-05-10 at 10 31 58

@bitcollector1 commented on GitHub (May 10, 2024): I tried the old command and removed the trailing "/" that was previously used and it now fires off the script but seems to have started multiple instances. ``` curl -v -X POST -H "Authorization: Token cc962e6655123a1887886a4399f86e808f349225" -H "Content-Type: application/json" -H "Accept: application/json; indent=4" http://netdevbox.hwe.ebay.com/api/extras/scripts/add_update_minios_system.Minios_Webhook --data '{"data": {"serial": "S514175X3706743B", "productname": "SYS-211GT-HNTF", "mfg_name": "Supermicro", "hostname": "minios-S514175X3706743B", "ip_10g": "10.254.149.9", "ip_bmc": "10.254.148.137", "mac_address_10g": "7c:c2:55:32:00:82", "mac_address_bmc": "7c:c2:55:81:11:eb"}, "commit": true}' ``` ![Screenshot 2024-05-10 at 10 31 58](https://github.com/netbox-community/netbox/assets/50723251/314e7f0f-fad1-4d7b-8e1b-d657c03d0c60)
Author
Owner

@bitcollector1 commented on GitHub (May 10, 2024):

oddly enough, the scripts are not showing in the "job specific" job view :(

Screenshot 2024-05-10 at 10 38 48
@bitcollector1 commented on GitHub (May 10, 2024): oddly enough, the scripts are not showing in the "job specific" job view :( <img width="1314" alt="Screenshot 2024-05-10 at 10 38 48" src="https://github.com/netbox-community/netbox/assets/50723251/34fec085-accc-473f-8359-03a1334793f5">
Author
Owner

@bitcollector1 commented on GitHub (May 10, 2024):

Finally, the jobs never seem to complete.....they seem to be stuck running.

@bitcollector1 commented on GitHub (May 10, 2024): Finally, the jobs never seem to complete.....they seem to be stuck running.
Author
Owner

@bitcollector1 commented on GitHub (May 10, 2024):

Here you can see references to "Script Module" when run remotely

Screenshot 2024-05-10 at 10 55 23

The ones I ran from the GUI report differently

Screenshot 2024-05-10 at 10 56 27
@bitcollector1 commented on GitHub (May 10, 2024): Here you can see references to "Script Module" when run remotely <img width="1302" alt="Screenshot 2024-05-10 at 10 55 23" src="https://github.com/netbox-community/netbox/assets/50723251/0ce6947a-6b72-49e8-afdf-426aae7d8eae"> The ones I ran from the GUI report differently <img width="1309" alt="Screenshot 2024-05-10 at 10 56 27" src="https://github.com/netbox-community/netbox/assets/50723251/261b00da-5e4e-4569-87b7-68edf0005974">
Author
Owner

@bitcollector1 commented on GitHub (May 10, 2024):

Only a single instance is being fired off now.....no idea what the difference is but this might be why I had 800+ jobs scheduled the other night......seems like something is amiss.

@bitcollector1 commented on GitHub (May 10, 2024): Only a single instance is being fired off now.....no idea what the difference is but this might be why I had 800+ jobs scheduled the other night......seems like something is amiss.
Author
Owner

@bitcollector1 commented on GitHub (May 10, 2024):

This stuff is all above my pay grade, but it looks like there is some more work to be done in this space!

@bitcollector1 commented on GitHub (May 10, 2024): This stuff is all above my pay grade, but it looks like there is some more work to be done in this space!
Author
Owner

@bitcollector1 commented on GitHub (May 10, 2024):

Looks like I am still able to get the script to run using the manage function using the old syntax.

python3 /opt/netbox/netbox/manage.py runscript --data '{"serial": "S514175X3706743B", "productname": "SYS-211GT-HNTF", "mfg_name": "Supermicro", "hostname": "minios-S514175X3706743B", "ip_10g": "10.254.149.9", "ip_bmc": "10.254.148.137", "mac_address_10g": "7c:c2:55:32:00:82", "mac_address_bmc": "7c:c2:55:81:11:eb"}' add_update_minios_system.Minios_Webhook
[2024-05-10 11:36:33,608][INFO] - Script completed in 0 minutes, 1.25 seconds
@bitcollector1 commented on GitHub (May 10, 2024): Looks like I am still able to get the script to run using the manage function using the old syntax. ``` python3 /opt/netbox/netbox/manage.py runscript --data '{"serial": "S514175X3706743B", "productname": "SYS-211GT-HNTF", "mfg_name": "Supermicro", "hostname": "minios-S514175X3706743B", "ip_10g": "10.254.149.9", "ip_bmc": "10.254.148.137", "mac_address_10g": "7c:c2:55:32:00:82", "mac_address_bmc": "7c:c2:55:81:11:eb"}' add_update_minios_system.Minios_Webhook ``` ``` [2024-05-10 11:36:33,608][INFO] - Script completed in 0 minutes, 1.25 seconds ```
Author
Owner

@bitcollector1 commented on GitHub (May 10, 2024):

In closing, the script does run via CURL command, even with the error, but it never completes.

curl -X POST -v "https://netdevbox.hwe.ebay.com/api/extras/scripts/23/" -H "accept: application/json" -H "Authorization: Token 0ee9654cccaa1d17fabb2f689c3587262300163d" -H "Content-Type: application/json" --data  '{"data": {"serial_num": "S508754X3919812B"}, "commit": true}'
@bitcollector1 commented on GitHub (May 10, 2024): In closing, the script does run via CURL command, even with the error, but it never completes. ``` curl -X POST -v "https://netdevbox.hwe.ebay.com/api/extras/scripts/23/" -H "accept: application/json" -H "Authorization: Token 0ee9654cccaa1d17fabb2f689c3587262300163d" -H "Content-Type: application/json" --data '{"data": {"serial_num": "S508754X3919812B"}, "commit": true}' ```
Author
Owner

@bitcollector1 commented on GitHub (May 10, 2024):

I was going to delete the script and add it back in and I ran into this issue :(

Screenshot 2024-05-10 at 12 12 11

Script was actually deleted but remains in GUI

(venv) ebay@netdevbox:/opt/netbox/netbox/scripts$ ls -altr | grep curl
(venv) ebay@netdevbox:/opt/netbox/netbox/scripts$ 
Screenshot 2024-05-10 at 12 19 40
@bitcollector1 commented on GitHub (May 10, 2024): I was going to delete the script and add it back in and I ran into this issue :( <img width="896" alt="Screenshot 2024-05-10 at 12 12 11" src="https://github.com/netbox-community/netbox/assets/50723251/b1882a5a-aa5b-48b8-8dc0-24003f566e1f"> Script was actually deleted but remains in GUI ``` (venv) ebay@netdevbox:/opt/netbox/netbox/scripts$ ls -altr | grep curl (venv) ebay@netdevbox:/opt/netbox/netbox/scripts$ ``` <img width="1304" alt="Screenshot 2024-05-10 at 12 19 40" src="https://github.com/netbox-community/netbox/assets/50723251/5552b529-35a7-46c9-9b15-ee20c723b0cb">
Author
Owner

@bitcollector1 commented on GitHub (May 10, 2024):

Added the script back in.

Screenshot 2024-05-10 at 12 20 26 Screenshot 2024-05-10 at 12 20 31
(venv) ebay@netdevbox:/opt/netbox/netbox/scripts$ ls -altr | grep curl
-rw-r--r--  1 netbox netbox 34744 May 10 12:20 netbox_curl_refresh.py
@bitcollector1 commented on GitHub (May 10, 2024): Added the script back in. <img width="1160" alt="Screenshot 2024-05-10 at 12 20 26" src="https://github.com/netbox-community/netbox/assets/50723251/8b64d98f-5df1-4c8c-9f14-b9cd132738cf"> <img width="844" alt="Screenshot 2024-05-10 at 12 20 31" src="https://github.com/netbox-community/netbox/assets/50723251/e3d84ea8-8e58-464c-94a8-b04d9c58bf70"> ``` (venv) ebay@netdevbox:/opt/netbox/netbox/scripts$ ls -altr | grep curl -rw-r--r-- 1 netbox netbox 34744 May 10 12:20 netbox_curl_refresh.py ```
Author
Owner

@jeffgdotorg commented on GitHub (May 13, 2024):

Thanks for reporting a problem you're having with NetBox. The volume of detail you've provided in comments is impressive, and will probably prove useful in case we're able to confirm that you've found a bug. To get to that point, though, we need more detail in the Steps to Reproduce section.

Please keep in mind that, before the team can start to track down a suspected bug, they need to be able to reproduce it in the lab. This means we need to know the steps required to get from a freshly installed instance of a particular NetBox version successfully running a simple script, to an upgraded system running 4.0.1 where the script is misbehaving in the way you describe. Without that, it's impossible to eliminate the possibility that you're seeing a behavior that's peculiar to some aspect of your system setup.

At minimum we need the Steps to Reproduce amended with the following information:

  • Prior version in which the script was running as expected
  • A simple script that is confirmed to showcase the problem behavior following an upgrade to 4.0.1
  • Some information about what the script is doing, in case its imports or actions may be somehow relevant

Please update accordingly so that we can move forward.

@jeffgdotorg commented on GitHub (May 13, 2024): Thanks for reporting a problem you're having with NetBox. The volume of detail you've provided in comments is impressive, and will probably prove useful in case we're able to confirm that you've found a bug. To get to that point, though, we need more detail in the *Steps to Reproduce* section. Please keep in mind that, before the team can start to track down a suspected bug, they need to be able to reproduce it in the lab. This means we need to know the steps required to get from a freshly installed instance of a particular NetBox version successfully running a simple script, to an upgraded system running 4.0.1 where the script is misbehaving in the way you describe. Without that, it's impossible to eliminate the possibility that you're seeing a behavior that's peculiar to some aspect of your system setup. At minimum we need the *Steps to Reproduce* amended with the following information: - Prior version in which the script was running as expected - A simple script that is confirmed to showcase the problem behavior following an upgrade to 4.0.1 - Some information about what the script is doing, in case its imports or actions may be somehow relevant Please update accordingly so that we can move forward.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9649