Uploaded image for project: 'CloudStack'
  1. CloudStack
  2. CLOUDSTACK-6236

Negative ref_cnt of template(snapshot/volume)_store_ref results in out-of-range error in Mysql

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.4.0
    • Component/s: Storage Controller
    • Security Level: Public (Anyone can view this level - this is the default.)
    • Labels:
      None

      Description

      Steps:

      1. Deploy CS with ESXi5.5 and NFS secondary storage.
      2. Create a VM and take the snapshot of root volume.
      3. Create a template from snapshot.
      4. Migrate the secondary NFS to S3.
      5. Download the template created from snapshot (step3). Now the template will be in S3.

      6. Tried to delete the template now.

      Observation:

      Template got deleted from S3 but observing an exception while deleting it from ImageCache.

      2014-03-04 16:19:58,227 DEBUG [c.c.a.m.AgentManagerImpl] (AgentManager-Handler-14:null) SeqA 2-9302: Sending Seq 2-9302: { Ans: , MgmtId: 6758231703598, via: 2, Ver: v1, Flags: 100010, [{"com.cloud.agent.api.AgentControlAnswer":{"result":true,"wait":0}}] }
      2014-03-04 16:19:58,255 ERROR [c.c.a.ApiAsyncJobDispatcher] (Job-Executor-51:Job-47) Unexpected exception while executing org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd
      com.cloud.utils.exception.CloudRuntimeException: DB Exception on: com.mysql.jdbc.JDBC4PreparedStatement@5cb563d: SELECT template_store_ref.id, template_store_ref.store_id, template_store_ref.template_id, template_store_ref.store_role, template_store_ref.created, template_store_ref.last_updated, template_store_ref.download_pct, template_store_ref.size, template_store_ref.physical_size, template_store_ref.download_state, template_store_ref.local_path, template_store_ref.error_str, template_store_ref.job_id, template_store_ref.install_path, template_store_ref.url, template_store_ref.is_copy, template_store_ref.destroyed, template_store_ref.update_count, template_store_ref.updated, template_store_ref.state, template_store_ref.ref_cnt FROM template_store_ref WHERE template_store_ref.template_id = 202 AND template_store_ref.store_role = 'ImageCache'
      at com.cloud.utils.db.GenericDaoBase.searchIncludingRemoved(GenericDaoBase.java:421)
      at com.cloud.utils.db.GenericDaoBase.searchIncludingRemoved(GenericDaoBase.java:356)
      at com.cloud.utils.db.GenericDaoBase.search(GenericDaoBase.java:340)
      at com.cloud.utils.db.GenericDaoBase.search(GenericDaoBase.java:1243)
      at org.apache.cloudstack.storage.image.db.TemplateDataStoreDaoImpl.listOnCache(TemplateDataStoreDaoImpl.java:365)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      at com.cloud.utils.db.TransactionContextInterceptor.invoke(TransactionContextInterceptor.java:33)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      at $Proxy108.listOnCache(Unknown Source)
      at org.apache.cloudstack.storage.image.TemplateDataFactoryImpl.listTemplateOnCache(TemplateDataFactoryImpl.java:147)
      at com.cloud.template.HypervisorTemplateAdapter.delete(HypervisorTemplateAdapter.java:355)
      at com.cloud.template.TemplateManagerImpl.deleteTemplate(TemplateManagerImpl.java:1097)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      at com.cloud.event.ActionEventInterceptor.invoke(ActionEventInterceptor.java:50)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      at $Proxy158.deleteTemplate(Unknown Source)
      at org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd.execute(DeleteTemplateCmd.java:112)
      at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:161)
      at com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:97)
      at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:529)
      at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:50)
      at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
      at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
      at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
      at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:47)
      at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.run(AsyncJobManagerImpl.java:486)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:679)
      Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLDataException: '18446744073709551615' in column '21' is outside valid range for the datatype BIGINT.
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
      at com.mysql.jdbc.Util.getInstance(Util.java:386)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1026)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
      at com.mysql.jdbc.ResultSetImpl.throwRangeException(ResultSetImpl.java:7870)
      at com.mysql.jdbc.ResultSetImpl.parseLongAsDouble(ResultSetImpl.java:7095)
      at com.mysql.jdbc.ResultSetImpl.getLong(ResultSetImpl.java:2981)
      at com.mysql.jdbc.ResultSetImpl.getLong(ResultSetImpl.java:2946)
      at org.apache.commons.dbcp.DelegatingResultSet.getLong(DelegatingResultSet.java:228)
      at org.apache.commons.dbcp.DelegatingResultSet.getLong(DelegatingResultSet.java:228)
      at com.cloud.utils.db.GenericDaoBase.setField(GenericDaoBase.java:541)
      at com.cloud.utils.db.GenericDaoBase.setField(GenericDaoBase.java:1702)
      at com.cloud.utils.db.GenericDaoBase.toEntityBean(GenericDaoBase.java:1582)
      at com.cloud.utils.db.GenericDaoBase.toEntityBean(GenericDaoBase.java:1543)
      at com.cloud.utils.db.GenericDaoBase.searchIncludingRemoved(GenericDaoBase.java:417)
      ... 49 more
      2014-03-04 16:19:58,276 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (Job-Executor-51:Job-47) Complete async job-47, jobStatus: FAILED, resultCode: 530, result: org.apache.cloudstack.api.response.ExceptionResponse/null/

      {"uuidList":[],"errorcode":530,"errortext":"DB Exception on: com.mysql.jdbc.JDBC4PreparedStatement@5cb563d: SELECT template_store_ref.id, template_store_ref.store_id, template_store_ref.template_id, template_store_ref.store_role, template_store_ref.created, template_store_ref.last_updated, template_store_ref.download_pct, template_store_ref.size, template_store_ref.physical_size, template_store_ref.download_state, template_store_ref.local_path, template_store_ref.error_str, template_store_ref.job_id, template_store_ref.install_path, template_store_ref.url, template_store_ref.is_copy, template_store_ref.destroyed, template_store_ref.update_count, template_store_ref.updated, template_store_ref.state, template_store_ref.ref_cnt FROM template_store_ref WHERE template_store_ref.template_id \u003d 202 AND template_store_ref.store_role \u003d \u0027ImageCache\u0027 "}

      2014-03-04 16:19:58,286 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (Job-Executor-51:Job-47) Done executing org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd for job-47
      2014-03-04 16:19:58,293 INFO [o.a.c.f.j.i.AsyncJobMonitor] (Job-Executor-51:Job-47) Remove job-47 from job monitoring
      2014-03-04 16:19:58,346 DEBUG [c.c.a.ApiServlet] (catalina-exec-9:ctx-3603c648) ===START=== 10.146.0.130 – GET comma

        Attachments

          Activity

            People

            • Assignee:
              minchen07 Min Chen
              Reporter:
              minchen07 Min Chen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: