{
"status": "error",
"message": "Duration not provided"
}
Version:
[25.4.0-64-g08451a2ba - Thu May 01 2025 23:33:05 GMT+0200](https://www.librenms.org/changelog.html)
If I remember correctly, the API call was working with an older version from about one or two weeks ago. Eventually someone might have an idea or can point me into the correct direction?
Odd request here, but if you both provide some notes in your request AND set the duration to “0:00” does it work?
"notes":"notes","duration":"0:00"
It’s pretty old code, and the error handling isn’t perfect - so it’s not being entirely honest about where it’s failing.
On one box I have I’m seeing 2 issues:
"message": "SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'notes' cannot be null - don’t know when that become a thing, but it seems it is now.
"message": "Carbon\\Carbon::rawAddUnit(): Argument #3 ($value) must be of type int|float, string given, called in /opt/librenms/vendor/nesbot/carbon/src/Carbon/Traits/Units.php on line 356" which may be related to the Laravel 11.x move that could have pulled in Carbon 3, which had breaking changes from what I’ve just read. I don’t know how to refactor to fix those.
On older installs before the Laravel uplifts, just adding notes works.
Edit … OK turns out you can easily make it work by casting the user input to float, and mandating notes in the checks. I’ll try and get a PR together to fix it.
Drop the trailing comma from your data and see if any different - I’ve dealt with that error handling in the change too - it would throw back “No information has been provided to set this device into maintenance” with that input.