sureshanaparti opened a new pull request, #13492:
URL: https://github.com/apache/cloudstack/pull/13492

   ### Description
   
   This PR ensures the detail value is not null when updating the VNC access 
details of the VMs with failed migrations on Host maintenance. It fixes the 
Constraint error "_Column 'value' cannot be null_" while updating the  VNC 
access details.
   
   Failed error log below (noticed with 4.18).
   
   ```
   2026-06-24 14:28:55,686 DEBUG [c.c.a.t.Request] 
(AgentMonitor-1:ctx-f1869124) (logid:98e99c06) Seq 2-6593551329447135922: 
Sending  { Cmd , MgmtId: 32988519727921, via: 
2(ref-trl-11982-k-Mol8-vladimir-petrov-kvm2), Ver: v1, Flags: 100011, 
[{"com.cloud.agent.api.GetVncPortCommand":{"id":"13","name":"i-2-13-VM","wait":"0","bypassHostMaintenance":"false"}}]
 }
   2026-06-24 14:28:55,704 DEBUG [c.c.c.ConsoleProxyManagerImpl] 
(consoleproxy-1:ctx-790c7a65) (logid:62b6d880) Enabled non-edge zones available 
for scan: 1
   2026-06-24 14:28:55,707 INFO  [c.c.c.ClusterManagerImpl] 
(Cluster-Heartbeat-1:ctx-539a9269) (logid:a328a129) No inactive management 
server node found
   2026-06-24 14:28:55,707 DEBUG [c.c.c.ClusterManagerImpl] 
(Cluster-Heartbeat-1:ctx-539a9269) (logid:a328a129) Peer scan is finished. 
profiler: Done. Duration: 1ms , profilerQueryActiveList: Done. Duration: 0ms, , 
profilerSyncClusterInfo: Done. Duration: 0ms, profilerInvalidatedNodeList: 
Done. Duration: 0ms, profilerRemovedList: Done. Duration: 0ms,, 
profilerNewList: Done. Duration: 0ms, profilerInactiveList: Done. Duration: 0ms
   2026-06-24 14:28:55,710 DEBUG [c.c.c.ConsoleProxyManagerImpl] 
(consoleproxy-1:ctx-790c7a65) (logid:62b6d880) Zone Zone {"id": "1", "name": 
"ref-trl-11982-k-Mol8-vladimir-petrov", "uuid": 
"9b5b1c23-e596-41e2-8cc1-7291af9608c0"} is ready to launch console proxy
   2026-06-24 14:28:55,847 DEBUG [c.c.a.t.Request] 
(AgentManager-Handler-17:null) (logid:) Seq 2-6593551329447135922: Processing:  
{ Ans: , MgmtId: 32988519727921, via: 2, Ver: v1, Flags: 10, 
[{"com.cloud.agent.api.GetVncPortAnswer":{"port":"0","result":"false","details":"org.libvirt.LibvirtException:
 Domain not found: no domain with matching name 
'i-2-13-VM'","wait":"0","bypassHostMaintenance":"false"}}] }
   2026-06-24 14:28:55,848 DEBUG [c.c.a.t.Request] 
(AgentMonitor-1:ctx-f1869124) (logid:98e99c06) Seq 2-6593551329447135922: 
Received:  { Ans: , MgmtId: 32988519727921, via: 
2(ref-trl-11982-k-Mol8-vladimir-petrov-kvm2), Ver: v1, Flags: 10, { 
GetVncPortAnswer } }
   2026-06-24 14:28:55,848 DEBUG [c.c.a.m.AgentManagerImpl] 
(AgentMonitor-1:ctx-f1869124) (logid:98e99c06) Details from executing class 
com.cloud.agent.api.GetVncPortCommand: org.libvirt.LibvirtException: Domain not 
found: no domain with matching name 'i-2-13-VM'
   2026-06-24 14:28:55,854 ERROR [c.c.u.d.GenericDaoBase] 
(AgentMonitor-1:ctx-f1869124) (logid:98e99c06) DB Exception on: 
HikariProxyPreparedStatement@1962527570 wrapping 
com.mysql.cj.jdbc.ServerPreparedStatement[350]: INSERT INTO user_vm_details 
(user_vm_details.vm_id, user_vm_details.name, user_vm_details.value, 
user_vm_details.display) VALUES (13, x'6b766d2e766e632e61646472657373', NULL, 1)
   java.sql.SQLIntegrityConstraintViolationException: Column 'value' cannot be 
null
           at 
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:118)
           at 
com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
           at 
com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:555)
           at 
com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:339)
           at com.mysql.cj.jdbc.ClientPrepa     
redStatement.executeUpdateInternal(ClientPreparedStatement.java:1061)
           at 
com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1009)
           at 
com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1320)
           at 
com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:994)
           at 
com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
           at 
com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
           at 
com.cloud.utils.db.GenericDaoBase.persist(GenericDaoBase.java:1602)
           at 
org.apache.cloudstack.resourcedetail.ResourceDetailsDaoBase.addDetail(ResourceDetailsDaoBase.java:179)
           at 
com.cloud.vm.dao.UserVmDetailsDaoImpl.addDetail(UserVmDetailsDaoImpl.java:31)
           at jdk.internal.reflect.GeneratedMethodAccessor609.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 
com.cloud.utils.db.TransactionContextInterceptor.invoke(TransactionContextInterceptor.java:34)
           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.$Proxy75.addDetail(Unknown Source)
           at 
com.cloud.resource.ResourceManagerImpl.setKVMVncAccess(ResourceManagerImpl.java:1688)
           at 
com.cloud.resource.ResourceManagerImpl.configureVncAccessForKVMHostFailedMigrations(ResourceManagerImpl.java:1700)
           at 
com.cloud.resource.ResourceManagerImpl.setHostIntoErrorInPrepareForMaintenance(ResourceManagerImpl.java:1732)
           at 
com.cloud.resource.ResourceManagerImpl.attemptMaintain(ResourceManagerImpl.java:1807)
           at 
com.cloud.resource.ResourceManagerImpl.checkAndMaintain(ResourceManagerImpl.java:1826)
           at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           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.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.$Proxy208.checkAndMaintain(Unknown Source)
           at 
com.cloud.resource.ResourceManagerImpl.setKVMVncAccess(ResourceManagerImpl.java:1688)
           at 
com.cloud.resource.ResourceManagerImpl.configureVncAccessForKVMHostFailedMigrations(ResourceManagerImpl.java:1700)
           at 
com.cloud.resource.ResourceManagerImpl.setHostIntoErrorInPrepareForMaintenance(ResourceManagerImpl.java:1732)
           at 
com.cloud.resource.ResourceManagerImpl.attemptMaintain(ResourceManagerImpl.java:1807)
           at 
com.cloud.resource.ResourceManagerImpl.checkAndMaintain(ResourceManagerImpl.java:1826)
           at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           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.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.$Proxy208.checkAndMaintain(Unknown Source)
           at 
com.cloud.agent.manager.AgentManagerImpl$MonitorTask.runInContext(AgentManagerImpl.java:1935)
           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:829)
   2026-06-24 14:28:55,856 DEBUG [c.c.u.d.T.Transaction] 
(AgentMonitor-1:ctx-f1869124) (logid:98e99c06) Rolling back the transaction: 
Time = 5 Name =  AgentMonitor-1; called by 
-TransactionLegacy.rollback:895-TransactionLegacy.removeUpTo:838-TransactionLegacy.close:662-TransactionContextInterceptor.invoke:36-ReflectiveMethodInvocation.proceed:175-ExposeInvocationInterceptor.invoke:97-ReflectiveMethodInvocation.proceed:186-JdkDynamicAopProxy.invoke:215-$Proxy75.addDetail:-1-ResourceManagerImpl.setKVMVncAccess:1688-ResourceManagerImpl.configureVncAccessForKVMHostFailedMigrations:1700-ResourceManagerImpl.setHostIntoErrorInPrepareForMaintenance:1732
   2026-06-24 14:28:55,857 ERROR [c.c.a.m.AgentManagerImpl] 
(AgentMonitor-1:ctx-f1869124) (logid:98e99c06) Caught the following exception:
   com.cloud.utils.exception.CloudRuntimeException: Unable to persist on DB, 
due to: Column 'value' cannot be null
           at 
com.cloud.utils.db.GenericDaoBase.persist(GenericDaoBase.java:1642)
           at 
org.apache.cloudstack.resourcedetail.ResourceDetailsDaoBase.addDetail(ResourceDetailsDaoBase.java:179)
           at 
com.cloud.vm.dao.UserVmDetailsDaoImpl.addDetail(UserVmDetailsDaoImpl.java:31)
           at jdk.internal.reflect.GeneratedMethodAccessor609.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 
com.cloud.utils.db.TransactionContextInterceptor.invoke(TransactionContextInterceptor.java:34)
           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.$Proxy75.addDetail(Unknown Source)
           at 
com.cloud.resource.ResourceManagerImpl.setKVMVncAccess(ResourceManagerImpl.java:1688)
           at 
com.cloud.resource.ResourceManagerImpl.configureVncAccessForKVMHostFailedMigrations(ResourceManagerImpl.java:1700)
           at 
com.cloud.resource.ResourceManagerImpl.setHostIntoErrorInPrepareForMaintenance(ResourceManagerImpl.java:1732)
           at 
com.cloud.resource.ResourceManagerImpl.attemptMaintain(ResourceManagerImpl.java:1807)
           at 
com.cloud.resource.ResourceManagerImpl.checkAndMaintain(ResourceManagerImpl.java:1826)
           at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           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.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.$Proxy208.checkAndMaintain(Unknown Source)
           at 
com.cloud.agent.manager.AgentManagerImpl$MonitorTask.runInContext(AgentManagerImpl.java:1935)
           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:829)
   ```
   
   <!--- Describe your changes in DETAIL - And how has behaviour functionally 
changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to 
reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be 
closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- 
******************************************************************************* 
-->
   <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE 
DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- 
******************************************************************************* 
-->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] Build/CI
   - [ ] Test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [x] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to 
-->
   
   #### How did you try to break this feature and the system with this change?
   
   <!-- see how your change affects other areas of the code, etc. -->
   
   <!-- Please read the 
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) 
document -->
   


-- 
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: [email protected]

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

Reply via email to