MoeRT09 commented on issue #4733:
URL: https://github.com/apache/cloudstack/issues/4733#issuecomment-806076134


   The error always was triggered by the UI requesting the API endpoint 
`https://<host>/client/api/?listall=true&type=routing&page=1&pagesize=20&command=listHostsMetrics&response=json`,
 with the response mentioned 
[here](https://github.com/apache/cloudstack/issues/4733#issuecomment-804967083).
   
   The request should return something like this:
   ```json
   {
     "listhostsmetricsresponse": {
       "count": 1,
       "host": [
         {
           "powerstate": "Disabled",
           "instances": "0 / 0",
           "cputotalghz": "25.60 Ghz (x 1.0)",
           "cpuusedghz": "0.00 Ghz",
           "cpuallocatedghz": "0.00 Ghz",
           "cpuloadaverage": 0.02,
           "memorytotalgb": "124.81 GB (x 1.0)",
           "memoryusedgb": "1.04 GB",
           "memoryallocatedgb": "0.00 GB",
           "networkread": "0.43 GB",
           "networkwrite": "0.00 GB",
           "cputhreshold": false,
           "cpudisablethreshold": false,
           "cpuallocatedthreshold": false,
           "cpuallocateddisablethreshold": false,
           "memorythreshold": false,
           "memorydisablethreshold": false,
           "memoryallocatedthreshold": false,
           "memoryallocateddisablethreshold": false,
         //...
         }
       ]
     }
   }
   ```
   
   As we never saw it working with a non english locale, I can only assume, 
that somewhere on one of those numbers, it gets formatted with the system 
number scheme. Looking at the numbers of the "For input string: "*,**" error, 
the `"cpuloadaverage"` property looks most suspicious for me as it fits the 
number scheme and is the only decimal number not enclosed in hyphens, which 
would definitely cause JSON parsing errors, if the period were a comma.
   
   As a workaround, as already mentioned, the system language of the host 
running the Cloudstack Manager  should be set to `en_US.UTF-8`. On Ubuntu this 
can be accomplished by running `dpkg-reconfigure locales` and selecting 
`en_US.UTF-8` as default. Afterwards, the system should be restarted.
   


-- 
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.

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


Reply via email to