You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "sureshanaparti (via GitHub)" <gi...@apache.org> on 2026/01/16 10:16:22 UTC
[PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
sureshanaparti opened a new pull request, #12451:
URL: https://github.com/apache/cloudstack/pull/12451
### Description
This PR fixes NPE issue while deleting storage pool when pool has detached volumes.
Noticed the below exception while deleting the pool:
```
2026-01-16 08:37:10,817 ERROR [c.c.a.ApiServer] (qtp253011924-22:[ctx-b62d6305, ctx-eae6e42c]) (logid:95645b16) unhandled exception executing api command: [Ljava.lang.String;@47cdfd8e java.lang.NullPointerException: Cannot invoke "com.cloud.vm.VMInstanceVO.getUuid()" because "volInstance" is null
at com.cloud.storage.StorageManagerImpl.getStoragePoolNonDestroyedVolumesLog(StorageManagerImpl.java:1568)
at com.cloud.storage.StorageManagerImpl.lambda$deleteDataStoreInternal$2(StorageManagerImpl.java:1535)
at org.apache.logging.log4j.util.LambdaUtil.get(LambdaUtil.java:63)
at org.apache.logging.log4j.util.LambdaUtil.getAll(LambdaUtil.java:47)
at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:2097)
at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1883)
at org.apache.logging.log4j.spi.AbstractLogger.debug(AbstractLogger.java:367)
at com.cloud.storage.StorageManagerImpl.deleteDataStoreInternal(StorageManagerImpl.java:1535)
at com.cloud.storage.StorageManagerImpl.deletePool(StorageManagerImpl.java:1459)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
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 jdk.proxy3/jdk.proxy3.$Proxy130.deletePool(Unknown Source)
at org.apache.cloudstack.api.command.admin.storage.DeletePoolCmd.execute(DeletePoolCmd.java:71)
at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:173)
at com.cloud.api.ApiServer.queueCommand(ApiServer.java:830)
at com.cloud.api.ApiServer.handleRequest(ApiServer.java:654)
at com.cloud.api.ApiServlet.processRequestInContext(ApiServlet.java:351)
at com.cloud.api.ApiServlet$1.run(ApiServlet.java:154)
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 com.cloud.api.ApiServlet.processRequest(ApiServlet.java:151)
at com.cloud.api.ApiServlet.doGet(ApiServlet.java:105)
```
<!--- 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
- [x] Major
- [ ] Minor
- [ ] Trivial
### Screenshots (if appropriate):
### How Has This Been Tested?
Deleted storage pool when pool has detached volumes on it. Expunged the volumes later and able to delete the pool.
**BEFORE CHANGES:**
<img width="1450" height="685" alt="DeleteStoragePool_Issue" src="https://github.com/user-attachments/assets/77c2c261-83c4-41f8-8de5-fd9ce502330c" />
DB:
```
mysql> SELECT id, uuid, name, state, disk_type, format, path, instance_id, removed FROM volumes WHERE pool_id = 5;
+----+--------------------------------------+-------------+----------+-----------+--------+-----------------------------------+-------------+---------------------+
| id | uuid | name | state | disk_type | format | path | instance_id | removed |
+----+--------------------------------------+-------------+----------+-----------+--------+-----------------------------------+-------------+---------------------+
| 8 | 943a0630-1f48-426a-88e6-6ff40f544516 | ROOT-8 | Expunged | NULL | QCOW2 | 9fdf334300000002:vol-8-f2e5-dee6 | 8 | 2025-10-22 09:29:58 |
| 10 | 3847c1a5-d05b-4576-add8-c0454d78fe7c | ROOT-8 | Expunged | NULL | RAW | 9fdf334400000002:vol-10-f2e5-dee6 | 8 | 2026-01-16 08:34:56 |
| 16 | 6de44955-dde3-4044-a52d-4ca2e2b558a7 | PFlexData01 | Ready | NULL | QCOW2 | 9fdf5a5100000004:vol-16-f2e5-dee6 | NULL | NULL |
+----+--------------------------------------+-------------+----------+-----------+--------+-----------------------------------+-------------+---------------------+
3 rows in set (0.00 sec)
```
**AFTER CHANGES:**
<img width="1450" height="695" alt="DeleteStoragePool_AfterFix" src="https://github.com/user-attachments/assets/101c65ea-2f57-4fba-8a7e-af0dc87ccf8c" />
<!-- 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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3759516759
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16395
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3772909674
> @sureshanaparti @DaanHoogland I believe this is already being addressed by #11817 (cc @hsato03)
@bernardodemarco I was testing something and got this issue, fixed and raised the PR, didn't check that it's already addressed.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3760100605
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on code in PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#discussion_r2711649649
##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1558,17 +1558,21 @@ private boolean deleteDataStoreInternal(StoragePoolVO sPool, boolean forced) {
protected String getStoragePoolNonDestroyedVolumesLog(long storagePoolId) {
StringBuilder sb = new StringBuilder();
- List<VolumeVO> nonDestroyedVols = volumeDao.findByPoolId(storagePoolId, null);
+ List<VolumeVO> nonDestroyedVols = volumeDao.findByPoolId(storagePoolId, null).stream().filter(vol -> vol.getState() != Volume.State.Destroy).collect(Collectors.toList());
Review Comment:
updated the volume dao method names returning non destroyed volumes
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on code in PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#discussion_r2703669346
##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1564,8 +1564,12 @@ protected String getStoragePoolNonDestroyedVolumesLog(long storagePoolId) {
sb.append("[");
for (VolumeVO vol : nonDestroyedVols) {
- volInstance = _vmInstanceDao.findById(vol.getInstanceId());
- logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
+ if (vol.getInstanceId() != null) {
+ volInstance = _vmInstanceDao.findById(vol.getInstanceId());
+ if (volInstance != null) {
+ logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
+ }
+ }
Review Comment:
I think we should log detached volumes also is that all non-destroyed volumes are logged in the caller
```
logger.debug("Cannot delete storage pool {} as the following non-destroyed volumes are on it: {}.", sPool::toString, () -> getStoragePoolNonDestroyedVolumesLog(sPool.getId()));
```
Something like
`logMessageInfo.add(String.format("Volume [%s] (not attached to any VM)", vol.getUuid());`
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "hsato03 (via GitHub)" <gi...@apache.org>.
hsato03 commented on code in PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#discussion_r2708842854
##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1558,17 +1558,21 @@ private boolean deleteDataStoreInternal(StoragePoolVO sPool, boolean forced) {
protected String getStoragePoolNonDestroyedVolumesLog(long storagePoolId) {
StringBuilder sb = new StringBuilder();
- List<VolumeVO> nonDestroyedVols = volumeDao.findByPoolId(storagePoolId, null);
+ List<VolumeVO> nonDestroyedVols = volumeDao.findByPoolId(storagePoolId, null).stream().filter(vol -> vol.getState() != Volume.State.Destroy).collect(Collectors.toList());
Review Comment:
The `findByPoolId` method already returns all volumes that are not in the `Destroy` and `Expunged` states.
https://github.com/apache/cloudstack/blob/151444c7cf1ba307974b3927e523956d63e210da/engine/schema/src/main/java/com/cloud/storage/dao/VolumeDaoImpl.java#L167
This filter can be removed,
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#discussion_r2697916067
##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1564,8 +1564,10 @@ protected String getStoragePoolNonDestroyedVolumesLog(long storagePoolId) {
sb.append("[");
for (VolumeVO vol : nonDestroyedVols) {
- volInstance = _vmInstanceDao.findById(vol.getInstanceId());
- logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
+ if (vol.getInstanceId() != null) {
+ volInstance = _vmInstanceDao.findById(vol.getInstanceId());
+ logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
Review Comment:
The findById call could potentially return null if the VM instance has been deleted from the database but the volume still references it. This would cause the same NPE on line 1569. Add a null check for volInstance: `if (volInstance != null) { logMessageInfo.add(...); }`
```suggestion
if (volInstance != null) {
logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
}
```
##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1564,8 +1564,10 @@ protected String getStoragePoolNonDestroyedVolumesLog(long storagePoolId) {
sb.append("[");
for (VolumeVO vol : nonDestroyedVols) {
- volInstance = _vmInstanceDao.findById(vol.getInstanceId());
- logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
+ if (vol.getInstanceId() != null) {
+ volInstance = _vmInstanceDao.findById(vol.getInstanceId());
+ logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
+ }
Review Comment:
The existing test `getStoragePoolNonDestroyedVolumesLogTestNonDestroyedVolumesReturnLog` only covers volumes with attached VMs. Add test cases for: (1) volumes with null instanceId (detached volumes), and (2) volumes where instanceId exists but the VM instance is not found in the database.
##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1564,8 +1564,10 @@ protected String getStoragePoolNonDestroyedVolumesLog(long storagePoolId) {
sb.append("[");
for (VolumeVO vol : nonDestroyedVols) {
- volInstance = _vmInstanceDao.findById(vol.getInstanceId());
- logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
+ if (vol.getInstanceId() != null) {
+ volInstance = _vmInstanceDao.findById(vol.getInstanceId());
+ logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
Review Comment:
Detached volumes (where instanceId is null) are silently skipped from the log message, making it incomplete and potentially misleading. The log should still include information about detached volumes. Consider adding an else branch to log detached volumes separately, for example: `logMessageInfo.add(String.format(\"Volume [%s] (detached)\", vol.getUuid()));`
```suggestion
logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
} else {
logMessageInfo.add(String.format("Volume [%s] (detached)", vol.getUuid()));
```
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3759707798
@blueorangutan package
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3771868557
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "bernardodemarco (via GitHub)" <gi...@apache.org>.
bernardodemarco commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3769210638
@sureshanaparti @DaanHoogland I believe this is already being addressed by #11817 (cc @hsato03)
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3777249251
@blueorangutan package
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3759262631
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on code in PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#discussion_r2709057670
##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1558,17 +1558,21 @@ private boolean deleteDataStoreInternal(StoragePoolVO sPool, boolean forced) {
protected String getStoragePoolNonDestroyedVolumesLog(long storagePoolId) {
StringBuilder sb = new StringBuilder();
- List<VolumeVO> nonDestroyedVols = volumeDao.findByPoolId(storagePoolId, null);
+ List<VolumeVO> nonDestroyedVols = volumeDao.findByPoolId(storagePoolId, null).stream().filter(vol -> vol.getState() != Volume.State.Destroy).collect(Collectors.toList());
Review Comment:
@haeena I didn't check it, the filter was there earlier (added here: https://github.com/apache/cloudstack/pull/8649). I think, we've to rename the dao method then. I'll update in this PR. thanks.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3769955270
> @sureshanaparti @DaanHoogland I believe this is already being addressed by #11817 (cc @hsato03)
ok, it is on main however. I think we need it for 4.20. cc @sureshanaparti
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3777003150
@blueorangutan package
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3777147364
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 16463
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "borisstoyanov (via GitHub)" <gi...@apache.org>.
borisstoyanov merged PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3759713691
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3762640360
<b>[SF] Trillian test result (tid-15201)</b>
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 50168 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12451-t15201-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:
Test | Result | Time (s) | Test File
--- | --- | --- | ---
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3777257680
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3760095156
@blueorangutan test
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3777522925
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16467
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3772993296
@sureshanaparti , I did some damage control. Let me know if I need to revert all my wrong doings.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on code in PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#discussion_r2709057670
##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1558,17 +1558,21 @@ private boolean deleteDataStoreInternal(StoragePoolVO sPool, boolean forced) {
protected String getStoragePoolNonDestroyedVolumesLog(long storagePoolId) {
StringBuilder sb = new StringBuilder();
- List<VolumeVO> nonDestroyedVols = volumeDao.findByPoolId(storagePoolId, null);
+ List<VolumeVO> nonDestroyedVols = volumeDao.findByPoolId(storagePoolId, null).stream().filter(vol -> vol.getState() != Volume.State.Destroy).collect(Collectors.toList());
Review Comment:
@hsato03 I didn't check it, the filter was there earlier (added here: https://github.com/apache/cloudstack/pull/8649). I think, we've to rename the dao method then. I'll update in this PR. thanks.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3759292697
## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/12451?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 4.03%. Comparing base ([`f1f779a`](https://app.codecov.io/gh/apache/cloudstack/commit/f1f779a08d94037baf1aad0c8107eaaf219af80e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`03ca329`](https://app.codecov.io/gh/apache/cloudstack/commit/03ca32900e1b408dc8742469f3990b3d8ae7d464?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
> :exclamation: There is a different number of reports uploaded between BASE (f1f779a) and HEAD (03ca329). Click for more details.
>
> <details><summary>HEAD has 1 upload less than BASE</summary>
>
>| Flag | BASE (f1f779a) | HEAD (03ca329) |
>|------|------|------|
>|unittests|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## 4.20 #12451 +/- ##
=============================================
- Coverage 16.23% 4.03% -12.21%
=============================================
Files 5657 402 -5255
Lines 499024 32701 -466323
Branches 60562 5826 -54736
=============================================
- Hits 81029 1319 -79710
+ Misses 408959 31227 -377732
+ Partials 9036 155 -8881
```
| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/12451/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/12451/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.03% <ø> (ø)` | |
| [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/12451/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/12451?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3759258811
@blueorangutan package
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on code in PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#discussion_r2698002940
##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1564,8 +1564,10 @@ protected String getStoragePoolNonDestroyedVolumesLog(long storagePoolId) {
sb.append("[");
for (VolumeVO vol : nonDestroyedVols) {
- volInstance = _vmInstanceDao.findById(vol.getInstanceId());
- logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
+ if (vol.getInstanceId() != null) {
+ volInstance = _vmInstanceDao.findById(vol.getInstanceId());
+ logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
Review Comment:
not needed
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3768260301
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on code in PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#discussion_r2698009192
##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1564,8 +1564,10 @@ protected String getStoragePoolNonDestroyedVolumesLog(long storagePoolId) {
sb.append("[");
for (VolumeVO vol : nonDestroyedVols) {
- volInstance = _vmInstanceDao.findById(vol.getInstanceId());
- logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
+ if (vol.getInstanceId() != null) {
+ volInstance = _vmInstanceDao.findById(vol.getInstanceId());
+ logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
Review Comment:
done
##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1564,8 +1564,10 @@ protected String getStoragePoolNonDestroyedVolumesLog(long storagePoolId) {
sb.append("[");
for (VolumeVO vol : nonDestroyedVols) {
- volInstance = _vmInstanceDao.findById(vol.getInstanceId());
- logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
+ if (vol.getInstanceId() != null) {
+ volInstance = _vmInstanceDao.findById(vol.getInstanceId());
+ logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
+ }
Review Comment:
done
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on code in PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#discussion_r2698007590
##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1564,8 +1564,10 @@ protected String getStoragePoolNonDestroyedVolumesLog(long storagePoolId) {
sb.append("[");
for (VolumeVO vol : nonDestroyedVols) {
- volInstance = _vmInstanceDao.findById(vol.getInstanceId());
- logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
+ if (vol.getInstanceId() != null) {
+ volInstance = _vmInstanceDao.findById(vol.getInstanceId());
+ logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
+ }
Review Comment:
done
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3772958047
ok, sorry @sureshanaparti I jumped the gun. I see your comment, let’s fix here.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3777008045
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3759949596
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16398
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on code in PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#discussion_r2704710971
##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1564,8 +1564,12 @@ protected String getStoragePoolNonDestroyedVolumesLog(long storagePoolId) {
sb.append("[");
for (VolumeVO vol : nonDestroyedVols) {
- volInstance = _vmInstanceDao.findById(vol.getInstanceId());
- logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
+ if (vol.getInstanceId() != null) {
+ volInstance = _vmInstanceDao.findById(vol.getInstanceId());
+ if (volInstance != null) {
+ logMessageInfo.add(String.format("Volume [%s] (attached to VM [%s])", vol.getUuid(), volInstance.getUuid()));
+ }
+ }
Review Comment:
done
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3768258328
@blueorangutan package
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NPE fix while deleting storage pool when pool has detached volumes [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12451:
URL: https://github.com/apache/cloudstack/pull/12451#issuecomment-3768537178
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16421
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org