You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "alexandru-bagu (via GitHub)" <gi...@apache.org> on 2023/02/17 10:21:56 UTC

[GitHub] [cloudstack] alexandru-bagu opened a new issue, #7254: db statistics collection failed due to For input string: "3392832763"

alexandru-bagu opened a new issue, #7254:
URL: https://github.com/apache/cloudstack/issues/7254

   ##### ISSUE TYPE
   <!-- Pick one below and delete the rest -->
    * Bug Report
   
   ##### COMPONENT NAME
   StatsCollector
   ~~~
   
   ~~~
   
   ##### CLOUDSTACK VERSION
   4.17.2
   
   ~~~
   
   
   After the MySQL server has been running for a while commands like `SHOW GLOBAL STATUS LIKE 'Queries';` and `SHOW GLOBAL STATUS LIKE 'Uptime';` will provide big numbers, bigger than Java's int supports. Because of this a error pops up every once in a while like this:
   
   ```
   2023-02-17 12:14:36,626 DEBUG [c.c.s.StatsCollector] (StatsCollector-2:ctx-5dbc245f) (logid:54583e3e) DbCollector is running...
   2023-02-17 12:14:36,629 ERROR [c.c.s.StatsCollector] (StatsCollector-2:ctx-5dbc245f) (logid:54583e3e) db statistics collection failed due to For input string: "3392832763"
   2023-02-17 12:14:36,629 DEBUG [c.c.s.StatsCollector] (StatsCollector-2:ctx-5dbc245f) (logid:54583e3e) db statistics collection failed.
   java.lang.NumberFormatException: For input string: "3392832763"
           at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
           at java.base/java.lang.Integer.parseInt(Integer.java:652)
           at java.base/java.lang.Integer.valueOf(Integer.java:983)
           at com.cloud.server.StatsCollector$DbCollector.getDynamicDataFromDB(StatsCollector.java:739)
           at com.cloud.server.StatsCollector$DbCollector.runInContext(StatsCollector.java:719)
           at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:48)
           at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:55)
           at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:102)
           at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:52)
           at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:45)
           at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
           at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
           at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
           at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
           at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
           at java.base/java.lang.Thread.run(Thread.java:834)
   ```
   
   This is due to 
   ```
   Welcome to the MariaDB monitor.  Commands end with ; or \g.
   Your MariaDB connection id is 8273589
   Server version: 5.5.68-MariaDB MariaDB Server
   
   Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
   
   Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
   
   MariaDB [(none)]> SHOW GLOBAL STATUS LIKE 'Uptime';
   +---------------+----------+
   | Variable_name | Value    |
   +---------------+----------+
   | Uptime        | 28379613 |
   +---------------+----------+
   1 row in set (0.00 sec)
   
   MariaDB [(none)]> SHOW GLOBAL STATUS LIKE 'Queries';
   +---------------+------------+
   | Variable_name | Value      |
   +---------------+------------+
   | Queries       | 3392841904 |
   +---------------+------------+
   1 row in set (0.00 sec)
   ```
   
   Solution would be to switch to Long instead of Integer I presume.
   ```
            private void getDynamicDataFromDB() {
                Map<String, String> stats = DbUtil.getDbInfo("STATUS", queries, uptime);
                dbStats.put(collectionTime, new Date());
                dbStats.put(queries, (Integer.valueOf(stats.get(queries))));
                dbStats.put(uptime, (Integer.valueOf(stats.get(uptime))));
            }
   ```


-- 
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: commits-unsubscribe@cloudstack.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] alexandru-bagu closed issue #7254: db statistics collection failed due to For input string: "3392832763"

Posted by "alexandru-bagu (via GitHub)" <gi...@apache.org>.
alexandru-bagu closed issue #7254: db statistics collection failed due to For input string: "3392832763"
URL: https://github.com/apache/cloudstack/issues/7254


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on issue #7254: db statistics collection failed due to For input string: "3392832763"

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on issue #7254:
URL: https://github.com/apache/cloudstack/issues/7254#issuecomment-1434448285

   @alexandru-bagu 
   this should have been fixed #7125 


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org