[ https://issues.apache.org/jira/browse/CLOUDSTACK-6793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14020258#comment-14020258 ]
Santhosh Kumar Edukulla commented on CLOUDSTACK-6793: ----------------------------------------------------- Nitin, First thing, we are not masking the surface of current bug again nor is the intention, when getDomainId concrete implementation was adde earlier, with a return of -1, i believe people were aware of its consequences. It seems these were failing since earlier versions as well, nor it was made a blocker any time. We are aware of schema change required for vm_template table, respective implementation under its respective ORM entity and its references when a new column is added. So is the reason to mention a note here that more enhancements will be done with few relevant info. I mentioned the same note in the group as well, when thinking of applying it to master. Now, another question was, is it the right way to add a column wherever required, then we are not making any use of proper relational mapping of tables, EX: account and domain are properly related, so a simple relation through a cross between multiple entities should fetch domain id required( provided getDomainid for vmtemplatevo has a definite meaning). i.e., Expect domain id to be retrieved based upon account id only, rather than adding domain_id to template table, if we see domainid column is not the proper mapping to vm_template table. Now, the question was to add a column to the table and respective reference changes for DML,DDL in code or make the interface changes for getDomainid or alter its original purpose for this derived class of vmtemplatevo, so is the reason of mentioning a note here to the bug with more changes post the release will be taken care. The current fix in a way will not counter effect any existing workflows, nor it breaks. Lastly, I was ready to do the above mentioned changes as well, but after discussing here, only realized that its not proper to make schema and its reference changes now during the time of near to release for ASF. I agree with you that the current issue, i believe is taken care, now more better way as mentioned will be added in future releases. We as well discussed to log a separate bug to track the similar issue, so is the reason for not closing this bug as well. > [Automation] CreateTagsCmd fails with db exceptions > ---------------------------------------------------- > > Key: CLOUDSTACK-6793 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6793 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API > Affects Versions: 4.4.0 > Environment: KVM > Reporter: Rayees Namathponnan > Assignee: Santhosh Kumar Edukulla > Priority: Blocker > Fix For: 4.4.0 > > Attachments: management-server.rar > > > Steps to reproduce > Execute the test case integration.component.test_tags.TestResourceTags > Test case perform below steps > # 1. Create a tag on template/ISO using createTags API > # 2. Delete above created tag using deleteTags API > 2014-05-27 17:41:28,658 DEBUG [c.c.a.ApiServlet] > (catalina-exec-10:ctx-3b66377c ctx-fdaf9174 ctx-62d4b9d2) ===END=== > 10.223.240.193 -- GET > apiKey=x3l3u2QJMKK5AzForI9MKkjNWb4V2ewV-UY6qSPZERrS49jXwUFn5WLvN-r_QJZ-z1t-oO1g9F4-EiUZx9Bd > EQ&resourcetype=Template&resourceIds=35e10eef-7980-4085-8b6c-c68174f1b529&command=createTags&signature=pIJSk7ekg0Tlf > RN%2FWfdp8U42Bgs%3D&tags%5B0%5D.key=OS&response=json&tags%5B0%5D.value=CentOS > 2014-05-27 17:41:28,661 DEBUG [c.c.u.d.T.Transaction] > (API-Job-Executor-89:ctx-c924058c job-577 ctx-ec2f3eb8) Rollin > g back the transaction: Time = 4 Name = API-Job-Executor-89; called by > -TransactionLegacy.rollback:903-TransactionL > egacy.removeUpTo:846-TransactionLegacy.close:670-TransactionContextInterceptor.invoke:36-ReflectiveMethodInvocation. > proceed:161-ExposeInvocationInterceptor.invoke:91-ReflectiveMethodInvocation.proceed:172-JdkDynamicAopProxy.invoke:2 > 04-$Proxy52.persist:-1-TaggedResourceManagerImpl$1.doInTransactionWithoutResult:245-TransactionCallbackNoReturn.doIn > Transaction:25-Transaction$2.doInTransaction:49 > 2014-05-27 17:41:28,662 DEBUG [c.c.a.ApiServlet] > (catalina-exec-22:ctx-dbbc3135) ===START=== 10.223.240.193 -- GET > > jobid=776d2770-db0d-44c8-b2e0-bbe2a9621642&apiKey=x3l3u2QJMKK5AzForI9MKkjNWb4V2ewV-UY6qSPZERrS49jXwUFn5WLvN-r_QJZ-z > 1t-oO1g9F4-EiUZx9BdEQ&command=queryAsyncJobResult&response=json&signature=%2Bk9OtkKpdJkU%2BWI7GO48SOrpKf4%3D > 2014-05-27 17:41:28,672 ERROR [c.c.a.ApiAsyncJobDispatcher] > (API-Job-Executor-89:ctx-c924058c job-577) Unexpected exception while > executing org.apache.cloudstack.api.command.user.tag.CreateTagsCmd > com.cloud.utils.exception.CloudRuntimeException: DB Exception on: > com.mysql.jdbc.JDBC4PreparedStatement@6a7f6c5: INSERT INTO resource_tags > (resource_tags.uuid, resource_tags.key, resource_tags.value, > resource_tags.domain_id, resource_tags.account_id, resource_tags.resource_id, > resource_tags.resource_uuid, resource_tags.resource_type, > resource_tags.customer) VALUES > (_binary'46408de5-040c-4858-8323-881c358bda20', _binary'OS', _binary'CentOS', > -1, 82, 217, _binary'35e10eef-7980-4085-8b6c-c68174f1b529', 'Template', null) > at com.cloud.utils.db.GenericDaoBase.persist(GenericDaoBase.java:1400) > at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > 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:34) > 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 com.sun.proxy.$Proxy52.persist(Unknown Source) > at > com.cloud.tags.TaggedResourceManagerImpl$1.doInTransactionWithoutResult(TaggedResourceManagerImpl.java:245) > at > com.cloud.utils.db.TransactionCallbackNoReturn.doInTransaction(TransactionCallbackNoReturn.java:25) > at > com.cloud.utils.db.Transaction$2.doInTransaction(Transaction.java:49) > at com.cloud.utils.db.Transaction.execute(Transaction.java:37) > at com.cloud.utils.db.Transaction.execute(Transaction.java:46) > at > com.cloud.tags.TaggedResourceManagerImpl.createTags(TaggedResourceManagerImpl.java:214) > 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:606) > 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 > org.apache.cloudstack.network.contrail.management.EventUtils$EventInterceptor.invoke(EventUtils.java:106) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) > at > com.cloud.event.ActionEventInterceptor.invoke(ActionEventInterceptor.java:51) > 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 com.sun.proxy.$Proxy324.createTags(Unknown Source) > at > org.apache.cloudstack.api.command.user.tag.CreateTagsCmd.execute(CreateTagsCmd.java:117) > at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:141) > at > com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:108) > at > org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:503) > at > org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49) > 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:46) -- This message was sent by Atlassian JIRA (v6.2#6252)