sathvikaragi opened a new issue, #14221:
URL: https://github.com/apache/cloudstack/issues/14221

   ### problem
   
   The updateStoragePool API currently accepts zero or negative values for 
capacity-related parameters. Add positive-number validation so invalid values 
are rejected with Invalid parameter error. This prevents invalid storage pool 
capacity settings from reaching backend processing.
   
   
   
   ### versions
   
   The versions of ACS, hypervisors, storage, network etc..
   
   Checked on 4.23
   
   ### The steps to reproduce the bug
   
   1. Click on edit option for storage pool
   2. Input a negative number for capacity bytes 
   3.click on OK to edit it.
   
   you see an error as : Unable to update on DB, due to: Data truncation: Out 
of range value for column 'capacity_bytes' at row 1
   
   instead of throwing an error for invalid parameter.
   ...
   
   
   ### What to do about it?
   
   
   Before this fix :  When I tried to update a  default primary storage pool 
using a negative value
   <img width="1449" height="754" alt="Image" 
src="https://github.com/user-attachments/assets/bcb00582-6477-49f4-8018-e184fed6617b";
 />
   
   when I tried to input 0 as capacity bytes for storage pool: It is updating 
it to 0
   
   <img width="1285" height="726" alt="Image" 
src="https://github.com/user-attachments/assets/74117cd0-7942-46f8-b34b-857d7966a947";
 />
   
   
   Add positive-number validation to the capacity bytes parameter in the 
updateStoragePool API. If a user provides zero or a negative value, reject the 
request immediately with a clear invalid-parameter error instead of sending it 
for backend processing.
   
   After the fix:
   
   <img width="1463" height="724" alt="Image" 
src="https://github.com/user-attachments/assets/009ea378-302b-4b9c-99f3-deaf8ec24669";
 />
   <img width="1478" height="748" alt="Image" 
src="https://github.com/user-attachments/assets/a6e06293-29d2-4469-a221-c294c37a096a";
 />


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to