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 2018/09/12 21:47:03 UTC

[GitHub] csquire opened a new issue #2842: listApis command returns inconsistent results

csquire opened a new issue #2842: listApis command returns inconsistent results
URL: https://github.com/apache/cloudstack/issues/2842
 
 
   <!--
   Verify first that your issue/request is not already reported on GitHub.
   Also test if the latest release and master branch are affected too.
   Always add information AFTER of these HTML comments, but no need to delete the comments.
   -->
   
   ##### ISSUE TYPE
   <!-- Pick one below and delete the rest -->
    * Bug Report
   
   ##### COMPONENT NAME
   <!--
   Categorize the issue, e.g. API, VR, VPN, UI, etc.
   -->
   ~~~
   API
   ~~~
   
   ##### CLOUDSTACK VERSION
   <!--
   New line separated list of affected versions, commit ID for issues on master branch.
   -->
   
   ~~~
   Tested on 4.9.3.0 and 4.11.1.0
   ~~~
   
   ##### CONFIGURATION
   <!--
   Information about the configuration if relevant, e.g. basic network, advanced networking, etc.  N/A otherwise
   -->
   API throttling is enabled with default throttling of 25 requests per second
   
   ##### OS / ENVIRONMENT
   <!--
   Information about the environment if relevant, N/A otherwise
   -->
   
   
   ##### SUMMARY
   <!-- Explain the problem/feature briefly -->
   Users reported that they weren't getting all apis listed in cloudmonkey when running a `sync`. After some debugging, I found that the problem is that the `ApiDiscoveryService` is calling `ApiRateLimitServiceImpl.checkAccess()`, so the results of the listApis command are being truncated because Cloudstack believes the user has exceeded their API throttling rate.
   
   ##### STEPS TO REPRODUCE
   <!--
   For bugs, show exactly how to reproduce the problem, using a minimal test-case. Use Screenshots if accurate.
   
   For new features, show how the feature would be used.
   -->
   I enabled throttling with a 25 request per second limit. I then created a test role with only `list*` permissions and assigned it to a test user. When this user calls `listApis`, they will typically receive anywhere from 15-18 results. Checking the logs, you see `The given user has reached his/her account api limit, please retry after 218 ms.`. 
   
   I raised the limit to 200 requests per second, restarted the management server and tried again. This time I got 143 results and no log messages about the user being throttled.
   
   <!-- Paste example playbooks or commands between quotes below -->
   ~~~
   
   ~~~
   
   <!-- You can also paste gist.github.com links for larger files -->
   
   ##### EXPECTED RESULTS
   <!-- What did you expect to happen when running the steps above? -->
   
   ~~~
   All of the apis the user has permission to access are listed
   ~~~
   
   ##### ACTUAL RESULTS
   <!-- What actually happened? -->
   
   <!-- Paste verbatim command output between quotes below -->
   ~~~
   The user only gets a small number of apis listed in their results
   ~~~
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services