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 2020/10/09 15:29:31 UTC

[GitHub] [cloudstack] Spaceman1984 opened a new pull request #4392: Fixed double slash in secret breaking db insert

Spaceman1984 opened a new pull request #4392:
URL: https://github.com/apache/cloudstack/pull/4392


   ## Description
   <!--- Describe your changes in detail -->
   
   <!-- 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: # -->
   Fixes: #4147 
   ## Types of changes
   <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
   - [ ] 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)
   
   ## 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. -->
   
   From the front end, add RBD primary storage pool with a secrect with 2 slashes next to each other - no error.
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on pull request #4392: Fixed double slash in secret breaking db insert

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


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 edited a comment on pull request #4392: Fixed double slash in secret breaking db insert

Posted by GitBox <gi...@apache.org>.
Spaceman1984 edited a comment on pull request #4392:
URL: https://github.com/apache/cloudstack/pull/4392#issuecomment-707038715


   @rhtyd I don't see RBD as an option on Primate for primary storage, my fix was for the UI, but I can't be sure if this works as expected, we need a working back end to test. Not testing end to end is the reason for the "Draft 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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 edited a comment on pull request #4392: Fixed double slash in secret breaking db insert

Posted by GitBox <gi...@apache.org>.
Spaceman1984 edited a comment on pull request #4392:
URL: https://github.com/apache/cloudstack/pull/4392#issuecomment-707035209


   I'll check Primate.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd edited a comment on pull request #4392: Fixed double slash in secret breaking db insert

Posted by GitBox <gi...@apache.org>.
rhtyd edited a comment on pull request #4392:
URL: https://github.com/apache/cloudstack/pull/4392#issuecomment-707034228


   Does this happen on Primate too @Spaceman1984  or just a UI issue, than backend issue? (related to secret input for adding ceph/rbd pool)
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] GabrielBrascher commented on pull request #4392: Fixed double slash in secret breaking db insert

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


   @DaanHoogland @Spaceman1984 I just tested it. The same exception as the one presented at #4147 happens when adding RBD pool via the Primate UI.
   
   A password containing multiple multiple '/' (e.g. _1234//1234_) resulted on the following exception; the same password with just one '/' does not preset this exception.
   
   Output with dummy values for adding a RBD pool with double slashes:
   `Failed to add data store: DB Exception on: com.mysql.cj.jdbc.ClientPreparedStatement: INSERT INTO storage_pool (storage_pool.id, storage_pool.name, storage_pool.uuid, storage_pool.pool_type, storage_pool.created, storage_pool.update_time, storage_pool.data_center_id, storage_pool.pod_id, storage_pool.used_bytes, storage_pool.capacity_bytes, storage_pool.status, storage_pool.storage_provider_name, storage_pool.host_address, storage_pool.path, storage_pool.port, storage_pool.user_info, storage_pool.cluster_id, storage_pool.scope, storage_pool.managed, storage_pool.capacity_iops, storage_pool.hypervisor, storage_pool.parent) VALUES (0, _binary'test2', _binary'e28b680f-cb21-3089-84e3-584bf549f062', 'RBD', '2020-11-10 12:53:57', null, 1, 1, 0, 0, 'Initialized', _binary'DefaultPrimary', null, _binary'12334@10.2.3.4/pool', 0, null, 1, null, 0, null, null, 0)`


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on pull request #4392: Fixed double slash in secret breaking db insert

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


   @GabrielBrascher can you test whether you have this issue in primate?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #4392: Fixed double slash in secret breaking db insert

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


   Note - Needs testing


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 edited a comment on pull request #4392: Fixed double slash in secret breaking db insert

Posted by GitBox <gi...@apache.org>.
Spaceman1984 edited a comment on pull request #4392:
URL: https://github.com/apache/cloudstack/pull/4392#issuecomment-707038715


   @rhtyd I don't see RBD as an option on Primate for primary storage.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on pull request #4392: Fixed double slash in secret breaking db insert

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


   Needs end to end testing


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #4392: Fixed double slash in secret breaking db insert

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


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4392: Fixed double slash in secret breaking db insert

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


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland edited a comment on pull request #4392: Fixed double slash in secret breaking db insert

Posted by GitBox <gi...@apache.org>.
DaanHoogland edited a comment on pull request #4392:
URL: https://github.com/apache/cloudstack/pull/4392#issuecomment-723010779


   We can keep this open or merge it. old UI so no real consequences. 
   edit: not relevant if we do. mixing things up here Do we have heavy rdb users?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] GabrielBrascher commented on pull request #4392: Fixed double slash in secret breaking db insert

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


   I have seen this issue to register RBD pool via UI inded in case "/" appear in Rados secret. Quite a corner case to have "/" on the secret, thus not really noticed I guess.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #4392: Fixed double slash in secret breaking db insert

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


   Does this happen on Primate too @Spaceman1984  or just a UI issue, than backend issue? (related to secret input for adding ceph/rbd pool)
   @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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #4392: Fixed double slash in secret breaking db insert

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


   Looks like this only affects the old UI, if we're not getting it in 4.15 we may want to check Primate and then close this. cc @sureshanaparti @DaanHoogland et al


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on pull request #4392: Fixed double slash in secret breaking db insert

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


   @rhtyd I don't see the RBD as an option on Primate for primary storage.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] GabrielBrascher commented on pull request #4392: Fixed double slash in secret breaking db insert

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


   @DaanHoogland sorry, I did not provide all the details on the test.
   
   What happens is that the double slashes _break_ the input. For instance, I configured a RBD pool with a password of `1234//12334`, the user as _user_, rados monitor address of `10.2.3.4`, and pool named as `pool`; however, instead of having the expectedf `user@10.2.3.4/pool` the log presents a broken user with the second part of the password after "//": `12334@10.2.3.4/pool`. Via the UI the error presented is the one that I pasted here. The INSERT (as far as I checked) due to null value that should not be null.
   
   From the management server side it is possible to check the API request as:
   
   ```
   zoneid=d3bcf0c7-4886-44d8-a6a1-5952c430e235
   scope=cluster
   name=test2
   provider=DefaultPrimary
   podid=9d3126c1-4309-4e32-b989-df7b11b7e020
   clusterid=27754861-5aeb-488a-b679-0133e1689186
   url=rbd:%2F%2Fuser:1234_%2F12334@10.2.3.4%2Fpool
   command=createStoragePool
   response=json
   ```
   
   Note that the url had scaped one "/" (_%2F_) between _1234_ and _12334_ . URL: `rbd:%2F%2Fuser:1234_%2F12334@10.2.3.4%2Fpool`.
   
   Full log:
   ```
   2020-11-10 13:53:57,682 DEBUG [c.c.a.ApiServlet] (qtp477376212-967:ctx-4a0a2d92) (logid:44629add) ===START===  127.0.0.1 -- GET  scope=cluster&zoneid=d3bcf0c7-4886-44d8-a6a1-5952c430e235&name=test2&provider=DefaultPrimary&podid=9d3126c1-4309-4e32-b989-df7b11b7e020&clusterid=27754861-5aeb-488a-b679-0133e1689186&url=rbd:%2F%2Fuser:1234_%2F12334@10.2.3.4%2Fpool&command=createStoragePool&response=json
   2020-11-10 13:53:57,702 DEBUG [o.a.c.s.d.l.CloudStackPrimaryDataStoreLifeCycleImpl] (qtp477376212-967:ctx-4a0a2d92 ctx-287b0e56) (logid:44629add) createPool Params @ scheme - rbd storageHost - null hostPath - /12334@10.2.3.4/pool port - -1
   2020-11-10 13:53:57,707 DEBUG [c.c.u.d.T.Transaction] (qtp477376212-967:ctx-4a0a2d92 ctx-287b0e56) (logid:44629add) Rolling back the transaction: Time = 2 Name =  qtp477376212-967; called by -TransactionLegacy.rollback:888-TransactionLegacy.removeUpTo:831-TransactionLegacy.close:655-TransactionContextInterceptor.invoke:36-ReflectiveMethodInvocation.proceed:175-ExposeInvocationInterceptor.invoke:95-ReflectiveMethodInvocation.proceed:186-JdkDynamicAopProxy.invoke:212-$Proxy61.persist:-1-PrimaryDataStoreHelper.createPrimaryDataStore:135-CloudStackPrimaryDataStoreLifeCycleImpl.initialize:364-StorageManagerImpl.createPool:738
   2020-11-10 13:53:57,709 DEBUG [c.c.s.StorageManagerImpl] (qtp477376212-967:ctx-4a0a2d92 ctx-287b0e56) (logid:44629add) Failed to add data store: DB Exception on: com.mysql.cj.jdbc.ClientPreparedStatement: INSERT INTO storage_pool (storage_pool.id, storage_pool.name, storage_pool.uuid, storage_pool.pool_type, storage_pool.created, storage_pool.update_time, storage_pool.data_center_id, storage_pool.pod_id, storage_pool.used_bytes, storage_pool.capacity_bytes, storage_pool.status, storage_pool.storage_provider_name, storage_pool.host_address, storage_pool.path, storage_pool.port, storage_pool.user_info, storage_pool.cluster_id, storage_pool.scope, storage_pool.managed, storage_pool.capacity_iops, storage_pool.hypervisor, storage_pool.parent) VALUES (0, _binary'test2', _binary'e28b680f-cb21-3089-84e3-584bf549f062', 'RBD', '2020-11-10 12:53:57', null, 1, 1, 0, 0, 'Initialized', _binary'DefaultPrimary', null, _binary'12334@10.2.3.4/pool', 0, null, 1, null, 0, null, null, 0)
   com.cloud.utils.exception.CloudRuntimeException: DB Exception on: com.mysql.cj.jdbc.ClientPreparedStatement: INSERT INTO storage_pool (storage_pool.id, storage_pool.name, storage_pool.uuid, storage_pool.pool_type, storage_pool.created, storage_pool.update_time, storage_pool.data_center_id, storage_pool.pod_id, storage_pool.used_bytes, storage_pool.capacity_bytes, storage_pool.status, storage_pool.storage_provider_name, storage_pool.host_address, storage_pool.path, storage_pool.port, storage_pool.user_info, storage_pool.cluster_id, storage_pool.scope, storage_pool.managed, storage_pool.capacity_iops, storage_pool.hypervisor, storage_pool.parent) VALUES (0, _binary'test2', _binary'e28b680f-cb21-3089-84e3-584bf549f062', 'RBD', '2020-11-10 12:53:57', null, 1, 1, 0, 0, 'Initialized', _binary'DefaultPrimary', null, _binary'12334@10.2.3.4/pool', 0, null, 1, null, 0, null, null, 0)
           at com.cloud.utils.db.GenericDaoBase.persist(GenericDaoBase.java:1450)
           at org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDaoImpl.persist(PrimaryDataStoreDaoImpl.java:273)
           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)
           at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
   ```
   
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd removed a comment on pull request #4392: Fixed double slash in secret breaking db insert

Posted by GitBox <gi...@apache.org>.
rhtyd removed a comment on pull request #4392:
URL: https://github.com/apache/cloudstack/pull/4392#issuecomment-707033624


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] GabrielBrascher commented on pull request #4392: Fixed double slash in secret breaking db insert

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


   Maybe this should be addressed on the backend.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on pull request #4392: Fixed double slash in secret breaking db insert

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


   @Spaceman1984 the issue is reported on 4.13. can you rebase?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 edited a comment on pull request #4392: Fixed double slash in secret breaking db insert

Posted by GitBox <gi...@apache.org>.
Spaceman1984 edited a comment on pull request #4392:
URL: https://github.com/apache/cloudstack/pull/4392#issuecomment-707038715


   @rhtyd I don't see RBD as an option on Primate for primary storage, my fix was for the UI, but I can't be sure if this works as expected, we need a working back end to 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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on pull request #4392: Fixed double slash in secret breaking db insert

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


   @GabrielBrascher I don't see a double slash in that output, what is the problematic field, and what was the input value?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4392: Fixed double slash in secret breaking db insert

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


   Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2154


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on pull request #4392: Fixed double slash in secret breaking db insert

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


   We can keep this open or merge it. old UI so no real consequences. Do we have heavy rdb users?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd merged pull request #4392: Fixed double slash in secret breaking db insert

Posted by GitBox <gi...@apache.org>.
rhtyd merged pull request #4392:
URL: https://github.com/apache/cloudstack/pull/4392


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on pull request #4392: Fixed double slash in secret breaking db insert

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


   I'll check primate.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org