Unable to schedule script via API #11829

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

Originally created by @llamafilm on GitHub (Nov 13, 2025).

NetBox Edition

NetBox Community

NetBox Version

4.3.2

Python Version

3.12

Steps to Reproduce

Create a custom script with scheduling_enabled = True

$ curl http://localhost/api/extras/scripts/5/ \
-H "Netbox-Authorization: Token $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"data":{},"commit":false, "schedule_at": "2025-11-13 02:00:00"}'

Expected Behavior

It should work

Observed Behavior

{"error": "'Script' object has no attribute 'scheduling_enabled'", "exception": "AttributeError", "netbox_version": "4.3.2", "python_version": "3.12.12"}

Originally created by @llamafilm on GitHub (Nov 13, 2025). ### NetBox Edition NetBox Community ### NetBox Version 4.3.2 ### Python Version 3.12 ### Steps to Reproduce Create a custom script with `scheduling_enabled = True` ``` $ curl http://localhost/api/extras/scripts/5/ \ -H "Netbox-Authorization: Token $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"data":{},"commit":false, "schedule_at": "2025-11-13 02:00:00"}' ``` ### Expected Behavior It should work ### Observed Behavior `{"error": "'Script' object has no attribute 'scheduling_enabled'", "exception": "AttributeError", "netbox_version": "4.3.2", "python_version": "3.12.12"}`
adam added the type: bugnetbox labels 2025-12-29 21:50:22 +01:00
adam closed this issue 2025-12-29 21:50:22 +01:00
Author
Owner

@llamafilm commented on GitHub (Nov 13, 2025):

I think the issue is here: 4961b0d334/netbox/extras/scripts.py (L391)

That classproperty decorator should be property instead. I haven't tested this fix yet but that's my hunch.

@llamafilm commented on GitHub (Nov 13, 2025): I think the issue is here: https://github.com/netbox-community/netbox/blob/4961b0d3347139729a5cbe2c40a7be7c223825ae/netbox/extras/scripts.py#L391 That `classproperty` decorator should be `property` instead. I haven't tested this fix yet but that's my hunch.
Author
Owner

@pheus commented on GitHub (Nov 13, 2025):

Thanks for taking the time to open this issue!

If you haven’t already, could you try sending a POST request to run the script via the REST API? Here’s a minimal curl example:

curl -X POST \
  -H "Authorization: Token $API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json; indent=4" \
  http://localhost/api/extras/scripts/5/ \
  --data '{"data": {}, "schedule_at": "2025-11-14 02:00:00", "commit": false}'

Hope this helps!

@pheus commented on GitHub (Nov 13, 2025): Thanks for taking the time to open this issue! If you haven’t already, could you try sending a `POST` request to run the script via the REST API? Here’s a minimal `curl` example: ```bash curl -X POST \ -H "Authorization: Token $API_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json; indent=4" \ http://localhost/api/extras/scripts/5/ \ --data '{"data": {}, "schedule_at": "2025-11-14 02:00:00", "commit": false}' ``` Hope this helps!
Author
Owner

@llamafilm commented on GitHub (Nov 13, 2025):

The -X POST argument is implied already by -d. But I tried it anyway, and the result is exactly the same. If I remove the scheduling_enabled option then it works fine.

$ curl -X POST \
  -H "Authorization: Token $API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json; indent=4" \
  http://localhost/api/extras/scripts/5/ \
  --data '{"data": {}, "schedule_at": "2025-11-14 02:00:00", "commit": false}'
{"error": "'Script' object has no attribute 'scheduling_enabled'", "exception": "AttributeError", "netbox_version": "4.3.2", "python_version": "3.12.12"}
@llamafilm commented on GitHub (Nov 13, 2025): The `-X POST` argument is implied already by `-d`. But I tried it anyway, and the result is exactly the same. If I remove the `scheduling_enabled` option then it works fine. ``` $ curl -X POST \ -H "Authorization: Token $API_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json; indent=4" \ http://localhost/api/extras/scripts/5/ \ --data '{"data": {}, "schedule_at": "2025-11-14 02:00:00", "commit": false}' {"error": "'Script' object has no attribute 'scheduling_enabled'", "exception": "AttributeError", "netbox_version": "4.3.2", "python_version": "3.12.12"} ```
Author
Owner

@pheus commented on GitHub (Nov 13, 2025):

You're absolutely right — -d implies POST in curl. I missed that; thanks for pointing it out, and sorry for the confusion.

The error you’re seeing ('Script' object has no attribute 'scheduling_enabled') when including schedule_at looks like a known issue in 4.3.2 when scheduling a custom script via the API (tracked in: #19555). The fix was included in v4.3.3.

@pheus commented on GitHub (Nov 13, 2025): You're absolutely right — `-d` implies `POST` in `curl`. I missed that; thanks for pointing it out, and sorry for the confusion. The error you’re seeing (`'Script' object has no attribute 'scheduling_enabled'`) when including `schedule_at` looks like a known issue in 4.3.2 when scheduling a custom script via the API (tracked in: #19555). The fix was included in v4.3.3.
Author
Owner

@llamafilm commented on GitHub (Nov 14, 2025):

Ah, thank you! I hadn't seen that. I just upgraded to 4.3.7 and confirm it's fixed.

@llamafilm commented on GitHub (Nov 14, 2025): Ah, thank you! I hadn't seen that. I just upgraded to 4.3.7 and confirm it's fixed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11829