Skip to content

Conversation

@weizhouapache
Copy link
Member

Description

This PR fixes #7165

old:

(localcloud) 🐱 > list users keyword=ADMIN
🙈 Error: (HTTP 530, error code 4250) Caught: com.mysql.cj.jdbc.ClientPreparedStatement: SELECT user_view.id, user_view.uuid, user_view.username, user_view.password, user_view.firstname, user_view.lastname, user_view.email, user_view.state, user_view.api_key, user_view.secret_key, user_view.created, user_view.removed, user_view.timezone, user_view.registration_token, user_view.is_registered, user_view.incorrect_login_attempts, user_view.account_id, user_view.account_uuid, user_view.account_name, user_view.account_type, user_view.account_role_id, user_view.domain_id, user_view.domain_uuid, user_view.domain_name, user_view.domain_path, user_view.job_id, user_view.job_uuid, user_view.job_status, user_view.default, user_view.source FROM user_view WHERE user_view.account_id=2 AND user_view.account_type != 5  AND user_view.id != 1  AND  (user_view.username LIKE x'2541444D494E25'  OR user_view.firstname LIKE x'2541444D494E25'  OR user_view.lastname LIKE x'2541444D494E25'  OR user_view.email LIKE x'2541444D494E25'  OR user_view.state LIKE x'2541444D494E25'  OR user_view.account_name LIKE x'2541444D494E25'  OR user_view.account_type = ** NOT SPECIFIED ** )  AND user_view.removed IS NULL  ORDER BY user_view.id ASC  LIMIT 0, 500

new:

(localcloud) 🐱 > list users keyword=admin listall=true  filter=username,roletype
{
  "count": 3,
  "user": [
    {
      "roletype": "Admin",
      "username": "admin"
    },
    {
      "roletype": "Admin",
      "username": "admin-kubeadmin"
    },
    {
      "roletype": "DomainAdmin",
      "username": "testadmin"
    }
  ]
}

and

(localcloud) 🐱 > list users keyword=domain_admin listall=true  filter=username,roletype
{
  "count": 1,
  "user": [
    {
      "roletype": "DomainAdmin",
      "username": "testadmin"
    }
  ]
}

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)

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?

old:

```
(localcloud) 🐱 > list users keyword=ADMIN
🙈 Error: (HTTP 530, error code 4250) Caught: com.mysql.cj.jdbc.ClientPreparedStatement: SELECT user_view.id, user_view.uuid, user_view.username, user_view.password, user_view.firstname, user_view.lastname, user_view.email, user_view.state, user_view.api_key, user_view.secret_key, user_view.created, user_view.removed, user_view.timezone, user_view.registration_token, user_view.is_registered, user_view.incorrect_login_attempts, user_view.account_id, user_view.account_uuid, user_view.account_name, user_view.account_type, user_view.account_role_id, user_view.domain_id, user_view.domain_uuid, user_view.domain_name, user_view.domain_path, user_view.job_id, user_view.job_uuid, user_view.job_status, user_view.default, user_view.source FROM user_view WHERE user_view.account_id=2 AND user_view.account_type != 5  AND user_view.id != 1  AND  (user_view.username LIKE x'2541444D494E25'  OR user_view.firstname LIKE x'2541444D494E25'  OR user_view.lastname LIKE x'2541444D494E25'  OR user_view.email LIKE x'2541444D494E25'  OR user_view.state LIKE x'2541444D494E25'  OR user_view.account_name LIKE x'2541444D494E25'  OR user_view.account_type = ** NOT SPECIFIED ** )  AND user_view.removed IS NULL  ORDER BY user_view.id ASC  LIMIT 0, 500
```

new:

```
(localcloud) 🐱 > list users keyword=admin listall=true  filter=username,roletype
{
  "count": 3,
  "user": [
    {
      "roletype": "Admin",
      "username": "admin"
    },
    {
      "roletype": "Admin",
      "username": "admin-kubeadmin"
    },
    {
      "roletype": "DomainAdmin",
      "username": "testadmin"
    }
  ]
}
```

and
```
(localcloud) 🐱 > list users keyword=domain_admin listall=true  filter=username,roletype
{
  "count": 1,
  "user": [
    {
      "roletype": "DomainAdmin",
      "username": "testadmin"
    }
  ]
}
```
@weizhouapache weizhouapache changed the base branch from main to 4.17 February 3, 2023 13:20
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 3, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell D 2 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Feb 3, 2023

Codecov Report

Merging #7169 (828f2a8) into 4.17 (e1d3657) will increase coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff            @@
##               4.17    #7169   +/-   ##
=========================================
  Coverage     10.37%   10.38%           
  Complexity     6650     6650           
=========================================
  Files          2453     2453           
  Lines        242439   242444    +5     
  Branches      37938    37941    +3     
=========================================
+ Hits          25164    25171    +7     
+ Misses       214165   214155   -10     
- Partials       3110     3118    +8     
Impacted Files Coverage Δ
...ain/java/com/cloud/api/query/QueryManagerImpl.java 2.98% <0.00%> (-0.01%) ⬇️
...rg/apache/cloudstack/quota/QuotaStatementImpl.java 36.28% <0.00%> (-3.99%) ⬇️
...apache/cloudstack/syslog/AlertsSyslogAppender.java 56.49% <0.00%> (-2.26%) ⬇️
...n/java/com/cloud/vm/VirtualMachineManagerImpl.java 0.00% <0.00%> (ø)
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 6.10% <0.00%> (+0.46%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@DaanHoogland
Copy link
Contributor

how about list users keyword=ADMIN like what gave the initial exception, now?

@vladimirpetrov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@vladimirpetrov a 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.

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 5512

Copy link
Contributor

@vladimirpetrov vladimirpetrov left a comment

Choose a reason for hiding this comment

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

LGTM based on manual testing.

@DaanHoogland DaanHoogland added this to the 4.18.0.0 milestone Feb 8, 2023
Copy link
Contributor

@stephankruggg stephankruggg left a comment

Choose a reason for hiding this comment

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

CLGTM, did not manually test it

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 5538

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-6144)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 39372 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7169-t6144-kvm-centos7.zip
Smoke tests completed. 98 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_deploy_vm_with_extraconfig_kvm Error 0.14 test_deploy_vm_extra_config_data.py
test_03_update_vm_with_extraconfig_kvm Error 1.13 test_deploy_vm_extra_config_data.py
test_08_upgrade_kubernetes_ha_cluster Failure 568.94 test_kubernetes_clusters.py
test_02_deploy_vm_on_specific_cluster Error 1.14 test_vm_deployment_planner.py
test_03_deploy_vm_on_specific_pod Error 1.16 test_vm_deployment_planner.py
test_04_deploy_vm_on_host_override_pod_and_cluster Error 1.17 test_vm_deployment_planner.py
test_05_deploy_vm_on_cluster_override_pod Error 1.14 test_vm_deployment_planner.py

@DaanHoogland
Copy link
Contributor

errors are not specific to this PR and addressed in #7190
merging with twoo LGTM and manual testing

@DaanHoogland DaanHoogland merged commit e62062f into apache:4.17 Feb 10, 2023
DaanHoogland added a commit that referenced this pull request Feb 10, 2023
* 4.17:
  server: fix exception while list users with keyword (#7169)
@DaanHoogland DaanHoogland deleted the 4.17-fix-list-users-with-keyword branch February 10, 2023 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI - SQL error when searching/filtering on accountuser page

5 participants