YunoHost-Apps / monitorix_ynh

Monitorix package for YunoHost
GNU Affero General Public License v3.0
3 stars 10 forks source link

Monitorix priority config is unable to be set as a negative number (increased priority) #65

Open MadMan247 opened 4 months ago

MadMan247 commented 4 months ago

Describe the bug

Monitorix, in the "main configuration" menu in the app's administrative panel, has an option to adjust the priority. This section explicitly mentions setting it to a negative number to allow monitorix to read data even under heavy load. Setting this value as negative through the webadmin returns an error. Positive values do work.

Context

Steps to reproduce

-install monitorix -navigate to admin section of yunohost (www.example.com/yunohost/admin/) -go to applications > monitorix -go to "main configuration" -set "process priority" to a negative number (please note that this issue remains even if you use the down arrow instead of manually entering a negative value)

Expected behavior

no "this form contains errors" message

Logs

There do not seem to be logs, as this is caught very early in the process. closest I can give is the closing lines of yunohost-api.log also, man does doing anything through the webadmin put tons of lines in that log.

2024-07-11 14:32:03,903 DEBUG    yunohost.configpanel (unknown function) - [605.65] Ask unanswered question and prevalidate data
2024-07-11 14:32:03,905 DEBUG    moulinette.actionsmap process - action [605.65] executed in 8.585s
2024-07-11 14:32:03,906 DEBUG    moulinette.core release - lock has been released
2024-07-11 14:32:03,909 INFO     geventwebsocket.handler (unknown function) - 127.0.0.1 - - [2024-07-11 14:32:03] "PUT /apps/monitorix/config/main HTTP/1.1" 400 211 8.595818
2024-07-11 14:32:03,911 DEBUG    geventwebsocket.handler (unknown function) - Closed WebSocket
2024-07-11 14:32:03,911 DEBUG    geventwebsocket.handler (unknown function) - Failed to write closing frame -> closing socket
2024-07-11 14:32:03,911 DEBUG    geventwebsocket.handler (unknown function) - Closed WebSocket

If applicable and useful, add screenshots to help explain your problem. image

Josue-T commented 1 month ago

It seem to be an upstream issue on the config panel. They probably didn't think about allowing a negative number.

Josue-T commented 1 month ago

For now the workaround would be just to set manually the value from command line with this command:

yunohost app setting monitorix process_priority -v 20

And then you need to update (or force update) the app to take new value into account.