Repository navigation
Repeated deletion to add the same network to the vm error #5651
Copy link
Copy link
Closed
Labels
Milestone
Description
ISSUE TYPE
- Bug Report
COMPONENT NAME
NIC
CLOUDSTACK VERSION
4.15.0.0
4.15.2.0
4.16.0.0
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
STEPS TO REPRODUCE
1. add network1 to vm1
2. delete network1 form vm1
3. add network1 to vm1
EXPECTED RESULTS
Added network1 to the VM successfully
ACTUAL RESULTS
Failed
Adding network failed
Unable to schedule async job for command com.cloud.vm.VmWorkAddVmToNetwork, unexpected exception.
management.log
2021-11-02 11:09:45,740 WARN [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-98:ctx-e494c47e job-68640 ctx-e25ca7d3) (logid:b2e679eb) Unable to schedule async job for command com.cloud.vm.VmWorkAddVmToNetwork, unexpected exception.
javax.persistence.EntityExistsException: Entity already exists
at com.cloud.utils.db.GenericDaoBase.handleEntityExistsException(GenericDaoBase.java:858)
at com.cloud.utils.db.GenericDaoBase.persist(GenericDaoBase.java:1449)
at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$1.doInTransaction(AsyncJobManagerImpl.java:241)
at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$1.doInTransaction(AsyncJobManagerImpl.java:237)
at com.cloud.utils.db.Transaction$2.doInTransaction(Transaction.java:50)
at com.cloud.utils.db.Transaction.execute(Transaction.java:40)
at com.cloud.utils.db.Transaction.execute(Transaction.java:47)
at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl.submitAsyncJob(AsyncJobManagerImpl.java:237)
at com.cloud.vm.VirtualMachineManagerImpl.createVmWorkJobToAddNetwork(VirtualMachineManagerImpl.java:5414)
at com.cloud.vm.VirtualMachineManagerImpl.addVmToNetworkThroughJobQueue(VirtualMachineManagerImpl.java:5381)
at com.cloud.vm.VirtualMachineManagerImpl.addVmToNetwork(VirtualMachineManagerImpl.java:3767)
at com.cloud.vm.UserVmManagerImpl.addNicToVirtualMachine(UserVmManagerImpl.java:1427)
at jdk.internal.reflect.GeneratedMethodAccessor1836.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.apache.cloudstack.network.contrail.management.EventUtils$EventInterceptor.invoke(EventUtils.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at com.cloud.event.ActionEventInterceptor.invoke(ActionEventInterceptor.java:51)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at com.sun.proxy.$Proxy183.addNicToVirtualMachine(Unknown Source)
at org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd.execute(AddNicToVMCmd.java:163)
at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:156)
at com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:108)
at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:620)
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 org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.run(AsyncJobManagerImpl.java:568)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
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:829)
Caused by: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'Filed-394-5f2f00fe-057b-4f93-b713-6b865893b2c0' for key 'vm_work_job_step_and_objects'
Reactions are currently unavailable
Activity
weizhouapache commentedon Nov 2, 2021
@nvazquez @DaanHoogland
this sounds like a blocker issue.
DaanHoogland commentedon Nov 2, 2021
sounds so @weizhouapache ,
ad 1. I had a quick look at the stacktrace and the code and can't find a change related but it might well be new, I don't see it yet.
ad 2. a workaround would involve editing a worker table which is even worse that 'just' touching the database so I'd say let's keep clear of that and try to fix.
weizhouapache commentedon Nov 2, 2021
seems to be caused by #5541
constraint key
vm_work_job_step_and_objectsis defined in #5541DaanHoogland commentedon Nov 2, 2021
that PR was added in 4.16 so that would mean it is not the cause of the failure in 4.15 @weizhouapache .
weizhouapache commentedon Nov 2, 2021
@DaanHoogland I think this issue does not exist in 4.15.
@div8cn can you please confirm ?
DaanHoogland commentedon Nov 2, 2021
@div8cn @weizhouapache I just confirmed it doesn't exist in 4.15 , just in 4.16
div8cn commentedon Nov 3, 2021
Sorry, I manually merged this PR into 4.15, so I tested this BUG
This problem does not exist in 4.15, thank you
@weizhouapache @DaanHoogland