Skip to content

Conversation

@Pearl1594
Copy link
Contributor

Description

This PR fixes: #11100

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • 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
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@codecov
Copy link

codecov bot commented Jul 3, 2025

Codecov Report

Attention: Patch coverage is 14.58333% with 41 lines in your changes missing coverage. Please review.

Project coverage is 16.23%. Comparing base (ed7bd5e) to head (84577e8).
Report is 9 commits behind head on 4.20.

Files with missing lines Patch % Lines
.../cloud/resourcelimit/ResourceLimitManagerImpl.java 14.58% 41 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #11138      +/-   ##
============================================
+ Coverage     16.16%   16.23%   +0.07%     
- Complexity    13278    13328      +50     
============================================
  Files          5657     5657              
  Lines        497969   498663     +694     
  Branches      60389    60650     +261     
============================================
+ Hits          80472    80945     +473     
- Misses       408531   408726     +195     
- Partials       8966     8992      +26     
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.08% <14.58%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland 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.

@sureshanaparti sureshanaparti added this to the 4.20.2 milestone Jul 4, 2025
@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14031

@DaanHoogland
Copy link
Contributor

@blueorangutan ui

@blueorangutan
Copy link

@DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/11138 (QA-JID-660)

@DaanHoogland
Copy link
Contributor

DaanHoogland commented Jul 5, 2025

when updating resource count for a child domain it fails. I think this is not what solves the issue at hand/needs more investigation.

@hsato03
Copy link
Collaborator

hsato03 commented Jul 7, 2025

The regression was introduced by commit a0080a0 as the accountId (a0080a0#diff-d2867d8cb1ef1dd180f2cf4a9c8c69086ffcd4153b7f3c7c2211b0d49920ac62R857) parameter is null while updating domains resource count, which caused the moveDomain API to stop working as well.

Perhaps ensuring that accountId is not null before using it would be enough to fix the issue.

@DaanHoogland
Copy link
Contributor

The regression was introduced by commit a0080a0 as the accountId (a0080a0#diff-d2867d8cb1ef1dd180f2cf4a9c8c69086ffcd4153b7f3c7c2211b0d49920ac62R857) parameter is null while updating domains resource count, which caused the moveDomain API to stop working as well.

Perhaps ensuring that accountId is not null before using it would be enough to fix the issue.

no, I think an accountid should not be obligatory when updating limit counts on a domain. But a null check (and making the code you point to not be called if it is null) would seem in order.

@hsato03
Copy link
Collaborator

hsato03 commented Jul 8, 2025

The regression was introduced by commit a0080a0 as the accountId (a0080a0#diff-d2867d8cb1ef1dd180f2cf4a9c8c69086ffcd4153b7f3c7c2211b0d49920ac62R857) parameter is null while updating domains resource count, which caused the moveDomain API to stop working as well.
Perhaps ensuring that accountId is not null before using it would be enough to fix the issue.

no, I think an accountid should not be obligatory when updating limit counts on a domain. But a null check (and making the code you point to not be called if it is null) would seem in order.

Yes, that's what I meant. My last comment was a bit ambiguous, sorry 😁

@DaanHoogland DaanHoogland force-pushed the ghi11100-resource-count branch from 9d01e3b to 84577e8 Compare July 15, 2025 10:17
Comment on lines +1089 to -1099
if (accountId != null) {
Account account = _entityMgr.findById(Account.class, accountId);
if (account == null) {
throw new InvalidParameterValueException("Unable to find account " + accountId);
}
_accountMgr.verifyCallerPrivilegeForUserOrAccountOperations(account);
}
_accountMgr.verifyCallerPrivilegeForUserOrAccountOperations(account);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the essential change. @Pearl1594 @hsato03 , can you have a look?

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
7.5% Coverage on New Code (required ≥ 40%)

See analysis details on SonarQube Cloud

Copy link
Contributor Author

@Pearl1594 Pearl1594 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Tested fix. Works as expected. Thanks @DaanHoogland

Copy link
Collaborator

@hsato03 hsato03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLGTM

@DaanHoogland DaanHoogland merged commit 23de6c7 into 4.20 Jul 18, 2025
48 of 50 checks passed
@DaanHoogland DaanHoogland deleted the ghi11100-resource-count branch July 18, 2025 20:35
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Aug 6, 2025
@daviftorres
Copy link
Contributor

hey @Pearl1594 , I believe I found a bug that is related to this one. Are you able to confirm if this fix resolves the issue below:

On our NON-Prod environment environments that are on ACS 4.21.0, the following command works.

cmk moveDomain domainid=<ID_TO_MOVE> parentdomainid=<DESTINATION_ID>

But on our Prod environment, that is on ACS 4.20.1 the same command fails with the following output.

🙈 Error: (HTTP 431, error code 4350) Unable to find account null

@Pearl1594
Copy link
Contributor Author

hey @Pearl1594 , I believe I found a bug that is related to this one. Are you able to confirm if this fix resolves the issue below:

On our NON-Prod environment environments that are on ACS 4.21.0, the following command works.

cmk moveDomain domainid=<ID_TO_MOVE> parentdomainid=<DESTINATION_ID>

But on our Prod environment, that is on ACS 4.20.1 the same command fails with the following output.

🙈 Error: (HTTP 431, error code 4350) Unable to find account null

Thanks @daviftorres - will check it out. This wasn't tested with the moveDomain API - something may have been overlooked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Resource Count fails in 4.20.1 with “Unable to find account null”

6 participants