You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "Pearl1594 (via GitHub)" <gi...@apache.org> on 2023/12/05 21:28:12 UTC

[PR] API: Fix listing zones and stoage pools [cloudstack]

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

   ### Description
   
   This PR fixes an issue observed upstream when listing zones and storage pools due to missing column in view due to a recent change https://github.com/apache/cloudstack/pull/7489
   
   ```
   2023-12-05 20:48:10,098 ERROR [c.c.a.ApiServer] (qtp925308434-24:ctx-e45bb790 ctx-d27d94a5) (logid:8cc1db1d) unhandled exception executing api command: [Ljava.lang.String;@3de943f8
   com.cloud.utils.exception.CloudRuntimeException: DB Exception on: com.mysql.cj.jdbc.ClientPreparedStatement: SELECT storage_pool_view.id, storage_pool_view.uuid, storage_pool_view.name, storage_pool_view.path, storage_pool_view.host_address, storage_pool_view.status, storage_pool_view.pool_type, storage_pool_view.created, storage_pool_view.removed, storage_pool_view.capacity_bytes, storage_pool_view.cluster_id, storage_pool_view.cluster_uuid, storage_pool_view.cluster_name, storage_pool_view.cluster_type, storage_pool_view.data_center_id, storage_pool_view.data_center_uuid, storage_pool_view.data_center_name, storage_pool_view.pod_id, storage_pool_view.pod_uuid, storage_pool_view.pod_name, storage_pool_view.tag, storage_pool_view.is_tag_a_rule, storage_pool_view.disk_used_capacity, storage_pool_view.disk_reserved_capacity, storage_pool_view.job_id, storage_pool_view.job_uuid, storage_pool_view.job_status, storage_pool_view.scope, storage_pool_view.capacity_iops, storage_pool_view.
 hypervisor, storage_pool_view.storage_provider_name, storage_pool_view.parent FROM storage_pool_view WHERE storage_pool_view.id=1
           at com.cloud.utils.db.GenericDaoBase.searchIncludingRemoved(GenericDaoBase.java:424)
           at com.cloud.utils.db.GenericDaoBase.searchIncludingRemoved(GenericDaoBase.java:360)
           at com.cloud.api.query.dao.StoragePoolJoinDaoImpl.searchByIds(StoragePoolJoinDaoImpl.java:306)
           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)
           ....
   Caused by: java.sql.SQLSyntaxErrorException: Unknown column 'storage_pool_view.is_tag_a_rule' in 'field list'
           at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
           at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
           at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
           ... 70 more
   ```
   
   
   ```
   com.cloud.utils.exception.CloudRuntimeException: DB Exception on: com.mysql.cj.jdbc.ClientPreparedStatement: SELECT host_view.id, host_view.uuid, host_view.name, host_view.status, host_view.type, host_view.private_ip_address, host_view.disconnected, host_view.version, host_view.hypervisor_type, host_view.hypervisor_version, host_view.capabilities, host_view.last_ping, host_view.created, host_view.removed, host_view.oobm_enabled, host_view.oobm_power_state, host_view.ha_enabled, host_view.ha_state, host_view.ha_provider, host_view.resource_state, host_view.mgmt_server_id, host_view.cpu_sockets, host_view.cpus, host_view.speed, host_view.ram, host_view.cluster_id, host_view.cluster_uuid, host_view.cluster_name, host_view.cluster_type, host_view.data_center_id, host_view.data_center_uuid, host_view.data_center_name, host_view.pod_id, host_view.pod_uuid, host_view.pod_name, host_view.guest_os_category_id, host_view.guest_os_category_uuid, host_view.guest_os_category_name, host_view.ta
 g, host_view.is_tag_a_rule, host_view.memory_used_capacity, host_view.memory_reserved_capacity, host_view.cpu_used_capacity, host_view.cpu_reserved_capacity, host_view.job_id, host_view.job_uuid, host_view.job_status, host_view.annotation, host_view.last_annotated, host_view.username FROM host_view WHERE host_view.id IN (1,2,3,4,5)
           at com.cloud.utils.db.GenericDaoBase.searchIncludingRemoved(GenericDaoBase.java:424)
           at com.cloud.utils.db.GenericDaoBase.searchIncludingRemoved(GenericDaoBase.java:360)
           at com.cloud.api.query.dao.HostJoinDaoImpl.searchByIds(HostJoinDaoImpl.java:462)
           at jdk.internal.reflect.GeneratedMethodAccessor247.invoke(Unknown Source)
   
   ...
   Caused by: java.sql.SQLSyntaxErrorException: Unknown column 'host_view.is_tag_a_rule' in 'field list'
           at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
           at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
           at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
           ... 70 more
   ```
   
   
   <!--- 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)
   - [ ] 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
   
   ### 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?
   
   <!-- 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] API: Fix listing zones and stoage pools [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #8311:
URL: https://github.com/apache/cloudstack/pull/8311#issuecomment-1841652090

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/8311?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Comparison is base [(`a15b706`)](https://app.codecov.io/gh/apache/cloudstack/commit/a15b706fbe7809b58a687c690f71391e0bed4117?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 22.25% compared to head [(`36531eb`)](https://app.codecov.io/gh/apache/cloudstack/pull/8311?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 4.44%.
   
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@             Coverage Diff              @@
   ##               main   #8311       +/-   ##
   ============================================
   - Coverage     22.25%   4.44%   -17.81%     
   ============================================
     Files          5117     360     -4757     
     Lines        346819   28231   -318588     
     Branches      49790    4918    -44872     
   ============================================
   - Hits          77190    1256    -75934     
   + Misses       258466   26837   -231629     
   + Partials      11163     138    -11025     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/8311/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [simulator-marvin-tests](https://app.codecov.io/gh/apache/cloudstack/pull/8311/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/8311/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.44% <ø> (ø)` | |
   
   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/8311?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).
   


-- 
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] API: Fix listing zones and stoage pools [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #8311:
URL: https://github.com/apache/cloudstack/pull/8311#issuecomment-1842856912

   Ok, seems like there was an issue during setup of the env. It was a new env based off main branch - but another env got deployed fine. Closing this PR.


-- 
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] API: Fix listing zones and stoage pools [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8311:
URL: https://github.com/apache/cloudstack/pull/8311#issuecomment-1842428448

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


-- 
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] API: Fix listing zones and stoage pools [cloudstack]

Posted by "JoaoJandre (via GitHub)" <gi...@apache.org>.
JoaoJandre commented on PR #8311:
URL: https://github.com/apache/cloudstack/pull/8311#issuecomment-1842757696

   @Pearl1594 I've just used a diff checker to compare this PR's view with whats in #7131, and I don't see the difference, could you explain what changed?


-- 
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] API: Fix listing zones and stoage pools [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #8311:
URL: https://github.com/apache/cloudstack/pull/8311#issuecomment-1842271034

   > @Pearl1594 does this need to go in `engine/schema/src/main/resources/META-INF/db/views/cloud.host_view.sql` based on the new pattern introduced in #7417 ?
   
   good point @shwstppr 
   :+1


-- 
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] API: Fix listing zones and stoage pools [cloudstack]

Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #8311:
URL: https://github.com/apache/cloudstack/pull/8311#issuecomment-1841704499

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=8311)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=8311&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=8311&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=8311&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=8311&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=8311&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=8311&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=8311&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=8311&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=8311&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=8311&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=8311&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=8311&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=8311&metric=coverage&view=list) No Coverage information  
   [![No Duplication information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo-16px.png 'No Duplication information')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=8311&metric=duplicated_lines_density&view=list) No Duplication information
   
   ![warning](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/message_warning-16px.png 'warning') The version of Java (11.0.21) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
   Read more [here](https://docs.sonarsource.com/sonarcloud/appendices/scanner-environment/)
   
   
   


-- 
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] API: Fix listing zones and stoage pools [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8311:
URL: https://github.com/apache/cloudstack/pull/8311#issuecomment-1842258513

   @shwstppr 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] API: Fix listing zones and stoage pools [cloudstack]

Posted by "JoaoJandre (via GitHub)" <gi...@apache.org>.
JoaoJandre commented on PR #8311:
URL: https://github.com/apache/cloudstack/pull/8311#issuecomment-1842809677

   > > @Pearl1594 I've just used a diff checker to compare this PR's view with what is in #7131, and I don't see the difference, could you explain what changed?
   > 
   > @JoaoJandre My bad, I did not realize that we had separate sql files for views. And I do notice that the column is specified there. So, I am not really sure though why it didn't get applied, because zone and storage pool tabs do not load anymore.
   
   The view scripts are only executed on upgrades, so if your environment was already on version 4.19, they would not get updated. Also, there are some logs on DatabaseUpgradeChecker.java#executeViewScripts that show what is being executed, if you don't see any logs about that, the views did not get updated.


-- 
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] API: Fix listing zones and stoage pools [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 closed pull request #8311: API: Fix listing zones and stoage pools
URL: https://github.com/apache/cloudstack/pull/8311


-- 
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] API: Fix listing zones and stoage pools [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #8311:
URL: https://github.com/apache/cloudstack/pull/8311#issuecomment-1842750610

   Thanks @shwstppr . I'll update the PR. I wasn't aware of these changes. 


-- 
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] API: Fix listing zones and stoage pools [cloudstack]

Posted by "shwstppr (via GitHub)" <gi...@apache.org>.
shwstppr commented on PR #8311:
URL: https://github.com/apache/cloudstack/pull/8311#issuecomment-1842257913

   @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] API: Fix listing zones and stoage pools [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #8311:
URL: https://github.com/apache/cloudstack/pull/8311#issuecomment-1842405798

   > This PR fixes an issue observed upstream when listing zones and storage pools due to missing column in view due to a
   
   upstream :D 
   
   seriously @shwstppr is right about the location of the change. Will take some getting used to for all of us, but then it will also help us in reviewing.


-- 
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] API: Fix listing zones and stoage pools [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #8311:
URL: https://github.com/apache/cloudstack/pull/8311#issuecomment-1842769531

   > @Pearl1594 I've just used a diff checker to compare this PR's view with what is in #7131, and I don't see the difference, could you explain what changed?
   
   @JoaoJandre My bad, I did not realize that we had separate sql files for views. And I do notice that the column is specified there. So, I am not really sure though why it didn't get applied, because zone and storage pool tabs do not load anymore.


-- 
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