sureshanaparti opened a new issue, #9834:
URL: https://github.com/apache/cloudstack/issues/9834
<!--
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release and main branch are affected too.
Always add information AFTER of these HTML comments, but no need to delete
the comments.
-->
NPE during host rolling maintenance when host has tag and service offering
doesn't have host tag.
##### ISSUE TYPE
<!-- Pick one below and delete the rest -->
* Bug Report
##### COMPONENT NAME
<!--
Categorize the issue, e.g. API, VR, VPN, UI, etc.
-->
~~~
Host
~~~
##### CLOUDSTACK VERSION
<!--
New line separated list of affected versions, commit ID for issues on main
branch.
-->
~~~
4.19.1.2
~~~
##### OS / ENVIRONMENT
<!--
Information about the environment if relevant, N/A otherwise
-->
MS + KVM Hosts (OL8)
##### SUMMARY
<!-- Explain the problem/feature briefly -->
NPE after start rolling maintenance when host has tag and service offering
doesn't have host tag. Other host(s) in cluster has tag.
##### STEPS TO REPRODUCE
<!--
For bugs, show exactly how to reproduce the problem, using a minimal
test-case. Use Screenshots if accurate.
For new features, show how the feature would be used.
-->
- Set host tag to host, say Host1
- Set host tag to any other host, say Host2, in the same cluster as Host1
- Create VM on the Host1, using service offering with no host tag
- Start rolling maintenance on Host1
Logs:
```
2024-10-22 05:40:25,689 INFO [o.a.c.f.j.i.AsyncJobMonitor]
(API-Job-Executor-32:ctx-6b9edab0 job-41) (logid:c9c074cb) Add job-41 into job
monitoring
2024-10-22 05:40:25,691 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl]
(qtp660017404-20:ctx-f60bd7f6 ctx-8a09649a) (logid:2c81de00) submit async
job-41, details: AsyncJobVO: {id:41, userId: 2, accountId: 2, instanceType:
Host, instanceId: 2, cmd:
org.apache.cloudstack.api.command.admin.resource.StartRollingMaintenanceCmd,
cmdInfo:
{"response":"json","ctxUserId":"2","sessionkey":"5KjTYbzLXZBM2G0YP4VX1m0ImKo","httpmethod":"GET","ctxStartEventId":"115","hostids":"00016127-58a3-4cd4-95e6-f7279db0574c","ctxDetails":"{\"interface
com.cloud.host.Host\":\"00016127-58a3-4cd4-95e6-f7279db0574c\"}","ctxAccountId":"2","cmdEventType":"HOST.ROLLING.MAINTENANCE"},
cmdVersion: 0, status: IN_PROGRESS, processStatus: 0, resultCode: 0, result:
null, initMsid: 32989593469185, completeMsid: null, lastUpdated: null,
lastPolled: null, created: null, removed: null}
2024-10-22 05:40:25,693 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl]
(API-Job-Executor-32:ctx-6b9edab0 job-41) (logid:2df29f6c) Executing
AsyncJobVO: {id:41, userId: 2, accountId: 2, instanceType: Host, instanceId: 2,
cmd:
org.apache.cloudstack.api.command.admin.resource.StartRollingMaintenanceCmd,
cmdInfo:
{"response":"json","ctxUserId":"2","sessionkey":"5KjTYbzLXZBM2G0YP4VX1m0ImKo","httpmethod":"GET","ctxStartEventId":"115","hostids":"00016127-58a3-4cd4-95e6-f7279db0574c","ctxDetails":"{\"interface
com.cloud.host.Host\":\"00016127-58a3-4cd4-95e6-f7279db0574c\"}","ctxAccountId":"2","cmdEventType":"HOST.ROLLING.MAINTENANCE"},
cmdVersion: 0, status: IN_PROGRESS, processStatus: 0, resultCode: 0, result:
null, initMsid: 32989593469185, completeMsid: null, lastUpdated: null,
lastPolled: null, created: null, removed: null}
2024-10-22 05:40:25,695 DEBUG [c.c.a.ApiServlet]
(qtp660017404-20:ctx-f60bd7f6 ctx-8a09649a) (logid:2c81de00) ===END===
10.0.3.251 -- GET
hostids=00016127-58a3-4cd4-95e6-f7279db0574c&command=startRollingMaintenance&response=json&sessionkey=5KjTYbzLXZBM2G0YP4VX1m0ImKo
2024-10-22 05:40:25,709 DEBUG [c.c.r.RollingMaintenanceManagerImpl]
(API-Job-Executor-32:ctx-6b9edab0 job-41 ctx-d4ae806d) (logid:2df29f6c) State
checks on the hosts in the cluster
2024-10-22 05:40:25,709 DEBUG [c.c.r.RollingMaintenanceManagerImpl]
(API-Job-Executor-32:ctx-6b9edab0 job-41 ctx-d4ae806d) (logid:2df29f6c)
Checking hosts capacity before attempting rolling maintenance
2024-10-22 05:40:25,733 ERROR [c.c.a.ApiAsyncJobDispatcher]
(API-Job-Executor-32:ctx-6b9edab0 job-41) (logid:2df29f6c) Unexpected exception
while executing
org.apache.cloudstack.api.command.admin.resource.StartRollingMaintenanceCmd
java.lang.NullPointerException
at
com.cloud.resource.RollingMaintenanceManagerImpl.lambda$checkHostTags$1(RollingMaintenanceManagerImpl.java:679)
at
java.base/java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
at
java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1632)
at
java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
at
java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
at
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
at
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at
java.base/java.util.stream.MatchOps$MatchTask.doLeaf(MatchOps.java:306)
at
java.base/java.util.stream.MatchOps$MatchTask.doLeaf(MatchOps.java:277)
at
java.base/java.util.stream.AbstractShortCircuitTask.compute(AbstractShortCircuitTask.java:115)
at
java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
at
java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at
java.base/java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:408)
at
java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:736)
at
java.base/java.util.stream.MatchOps$MatchOp.evaluateParallel(MatchOps.java:242)
at
java.base/java.util.stream.MatchOps$MatchOp.evaluateParallel(MatchOps.java:196)
at
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
at
java.base/java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:528)
at
com.cloud.resource.RollingMaintenanceManagerImpl.checkHostTags(RollingMaintenanceManagerImpl.java:679)
at
com.cloud.resource.RollingMaintenanceManagerImpl.performCapacityChecksBeforeHostInMaintenance(RollingMaintenanceManagerImpl.java:626)
at
com.cloud.resource.RollingMaintenanceManagerImpl.performCapacityChecks(RollingMaintenanceManagerImpl.java:593)
at
com.cloud.resource.RollingMaintenanceManagerImpl.startRollingMaintenance(RollingMaintenanceManagerImpl.java:200)
at
org.apache.cloudstack.api.command.admin.resource.StartRollingMaintenanceCmd.execute(StartRollingMaintenanceCmd.java:131)
at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:172)
at
com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:112)
at
org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:654)
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:602)
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)
2024-10-22 05:40:25,738 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl]
(API-Job-Executor-32:ctx-6b9edab0 job-41) (logid:2df29f6c) Complete async
job-41, jobStatus: FAILED, resultCode: 530, result:
org.apache.cloudstack.api.response.ExceptionResponse/null/{"uuidList":[],"errorcode":"530"}
```
<img width="1250" alt="Host_RollingMaintenance_Issue"
src="https://github.com/user-attachments/assets/1a704468-a056-4a21-b71b-2d1b70604738">
<!-- You can also paste gist.github.com links for larger files -->
##### EXPECTED RESULTS
<!-- What did you expect to happen when running the steps above? -->
~~~
Rolling maintenance of host should be performed without any issues.
~~~
##### ACTUAL RESULTS
<!-- What actually happened? -->
<!-- Paste verbatim command output between quotes below -->
~~~
Rolling maintenance of host fails with error.
~~~
--
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]