You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/03/09 17:22:00 UTC

[GitHub] [cloudstack] GabrielBrascher opened a new pull request #6080: Increase size of column 'value' at table 'account_details'

GabrielBrascher opened a new pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080


   
   ### Description
   
   This PR increases the column `value` at table `account_details` from 255 chars to `4096`, matching with the value allowed in the API command for updating the configuration of accounts.
   
   When the `value` length is bigger than 255, the following log is presented right after the `updateConfiguration` API call:
   ```
   2022-03-09 17:50:24,627 ERROR [c.c.a.ApiServer] (qtp30578394-234766:ctx-cad18b45 ctx-32e954dd) (logid:0948e203) unhandled exception executing api command: [Ljava.lang.String;@117c6ba7
   com.cloud.utils.exception.CloudRuntimeException: DB Exception on: com.mysql.cj.jdbc.ClientPreparedStatement: INSERT INTO account_details (account_details.account_id, account_details.name, account_details.value) VALUES (39, _binary'api.allowed.source.cidr.list', _binary'<huge binary>')
   	at com.cloud.utils.db.GenericDaoBase.persist(GenericDaoBase.java:1450)
   	at jdk.internal.reflect.GeneratedMethodAccessor168.invoke(Unknown Source)
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	....
   	....
   	....
   Caused by: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Data too long for column 'value' at row 1
   	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:104)
   	at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
   	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1092)
   	... 83 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: AUTOMATATION 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)
   - [X] 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
   - [X] 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 -->
   <!-- see how your change affects other areas of the code, etc. -->
   - Update configurations for an account
   - Assert that configuration is properly updated (which was not the case before the change)
   
   <!-- 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



[GitHub] [cloudstack] nvazquez commented on pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#issuecomment-1064018916


   Thanks @GabrielBrascher I was spinning an env for testing it - will post my review after that


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



[GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on a change in pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#discussion_r833067599



##########
File path: engine/schema/src/main/resources/META-INF/db/schema-41610to41700.sql
##########
@@ -652,3 +652,5 @@ INSERT INTO `cloud`.`user_vm_details`(`vm_id`, `name`, `value`)
         INNER JOIN `cloud`.`vm_instance` ON vm_instance.id = user_vm_details.vm_id
         WHERE ssh_keypairs.account_id = vm_instance.account_id;
 
+-- PR #6080 Change column `value` size from 255 to 4096 characters, matching the API "updateConfiguration" "value" size
+ALTER TABLE `cloud`.`account_details` MODIFY `value` VARCHAR(4096);

Review comment:
       Thanks @GutoVeronezi!




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



[GitHub] [cloudstack] nvazquez commented on pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#issuecomment-1063600650


   @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



[GitHub] [cloudstack] GabrielBrascher commented on pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#issuecomment-1063170234


   @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



[GitHub] [cloudstack] nvazquez commented on pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#issuecomment-1064044817


   @GabrielBrascher I've tested through the API and UI:
   
   - API works as expected, passed `value` parameters with length > 255 and the response was properly retrieved. 
   - UI seems to still be truncating the value at 255 characters, can you check if this can be extended?
   
   Example: input length = 650 characters:
   
   ````
   (localcloud) 🐱 > update configuration accountid=deb22344-0869-49a2-ac1f-116cb858ee03 name='api.allowed.source.cidr.list' value=12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
   {
     "configuration": {
       "category": "Advanced",
       "description": "Comma separated list of IPv4/IPv6 CIDRs from which API calls can be performed. Can be set on Global and Account levels.",
       "isdynamic": true,
       "name": "api.allowed.source.cidr.list",
       "scope": "account",
       "value": "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
     }
   }
   ````
   <img width="919" alt="Screen Shot 2022-03-10 at 10 13 45" src="https://user-images.githubusercontent.com/5295080/157669028-2f578977-459d-4d96-8f78-6ce4b66a1381.png">
   
   


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



[GitHub] [cloudstack] blueorangutan commented on pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#issuecomment-1063600831


   @nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) 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



[GitHub] [cloudstack] blueorangutan commented on pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#issuecomment-1063171093


   @GabrielBrascher a Jenkins job has been kicked to build packages. 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



[GitHub] [cloudstack] nvazquez commented on pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#issuecomment-1068054714


   Hi @GabrielBrascher please advise when this one is ready for testing again


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



[GitHub] [cloudstack] GabrielBrascher commented on pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#issuecomment-1064016080


   Before merging, I am afraid that we might need to also increase the size of the value in the response object, otherwise, the API response will not contain the whole value stored in DB. Placing it as a draft in the meantime to avoid it getting merged.


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



[GitHub] [cloudstack] blueorangutan commented on pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#issuecomment-1063982362


   <b>Trillian test result (tid-3552)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 31419 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6080-t3552-kvm-centos7.zip
   Smoke tests completed. 92 look OK, 0 have errors
   Only failed 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



[GitHub] [cloudstack] blueorangutan commented on pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#issuecomment-1063214532


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 2817


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



[GitHub] [cloudstack] GutoVeronezi commented on a change in pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
GutoVeronezi commented on a change in pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#discussion_r832533365



##########
File path: engine/schema/src/main/resources/META-INF/db/schema-41610to41700.sql
##########
@@ -652,3 +652,5 @@ INSERT INTO `cloud`.`user_vm_details`(`vm_id`, `name`, `value`)
         INNER JOIN `cloud`.`vm_instance` ON vm_instance.id = user_vm_details.vm_id
         WHERE ssh_keypairs.account_id = vm_instance.account_id;
 
+-- PR #6080 Change column `value` size from 255 to 4096 characters, matching the API "updateConfiguration" "value" size
+ALTER TABLE `cloud`.`account_details` MODIFY `value` VARCHAR(4096);

Review comment:
       When calling `MODIFY` command, it removes all the column metadata and only adds what is specified in the command (in this case, only `VARCHAR(4096)`). Currently this field is `NOT NULL`, therefore it must be informed in the command:
   
   ```suggestion
   ALTER TABLE `cloud`.`account_details` MODIFY `value` VARCHAR(4096) NOT NULL;
   ```




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



[GitHub] [cloudstack] nvazquez commented on pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#issuecomment-1064121169


   Yes @GabrielBrascher seeing the same - the only remark from your comment is the lengths are 650 and 255. Extending the response field should solve it, worth checking if the UI does truncate or simply displays the received data for configurations


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



[GitHub] [cloudstack] GabrielBrascher commented on pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#issuecomment-1064032941


   Thanks, @nvazquez!
   I will do some changes and run some manual 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



[GitHub] [cloudstack] GabrielBrascher commented on pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#issuecomment-1064108226


   @nvazquez  I am seeing the following:
   
   - Update command and response looks OK:
   
   ```
   (poc) 🐱 > update configuration accountid=064a02be-caf8-46c7-8264-92c5a9d782b2 name=api.allowed.source.cidr.list value=12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
   {
     "configuration": {
       "category": "Advanced",
       "description": "Comma separated list of IPv4/IPv6 CIDRs from which API calls can be performed. Can be set on Global and Account levels.",
       "isdynamic": true,
       "name": "api.allowed.source.cidr.list",
       "scope": "account",
       "value": "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
     }
   }
   ```
   
   - But list command returns a fraction:
   
   ```
   (poc) 🐱 > list configurations name=api.allowed.source.cidr.list accountid=064a02be-caf8-46c7-8264-92c5a9d782b2 pagesize=600 page=1
   {
     "configuration": [
       {
         "category": "Advanced",
         "description": "Comma separated list of IPv4/IPv6 CIDRs from which API calls can be performed. Can be set on Global and Account levels.",
         "isdynamic": true,
         "name": "api.allowed.source.cidr.list",
         "scope": "account",
         "value": "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345"
       }
     ],
     "count": 1
   }
   ```
   
   Updated value with length of 651 
   
   ```
   "value": "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
   ```
   
   listed value with length of 256
   ```
   "value": "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345"
   ```


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



[GitHub] [cloudstack] GutoVeronezi commented on a change in pull request #6080: Increase size of column 'value' at table 'account_details'

Posted by GitBox <gi...@apache.org>.
GutoVeronezi commented on a change in pull request #6080:
URL: https://github.com/apache/cloudstack/pull/6080#discussion_r832533365



##########
File path: engine/schema/src/main/resources/META-INF/db/schema-41610to41700.sql
##########
@@ -652,3 +652,5 @@ INSERT INTO `cloud`.`user_vm_details`(`vm_id`, `name`, `value`)
         INNER JOIN `cloud`.`vm_instance` ON vm_instance.id = user_vm_details.vm_id
         WHERE ssh_keypairs.account_id = vm_instance.account_id;
 
+-- PR #6080 Change column `value` size from 255 to 4096 characters, matching the API "updateConfiguration" "value" size
+ALTER TABLE `cloud`.`account_details` MODIFY `value` VARCHAR(4096);

Review comment:
       When calling `MODIFY` command, it removes all the column metadata and only adds what is specified in the command (in this case, only `VARCHAR(4096)`. Currently this field is `NOT NULL`, therefore it must be informed in the command:
   
   ```suggestion
   ALTER TABLE `cloud`.`account_details` MODIFY `value` VARCHAR(4096) NOT NULL;
   ```




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