Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseRequest.createRateLimitException mapping error #678

Open
5 tasks done
dmical-icims opened this issue Nov 20, 2024 · 4 comments
Open
5 tasks done

BaseRequest.createRateLimitException mapping error #678

dmical-icims opened this issue Nov 20, 2024 · 4 comments
Labels
bug This points to a verified bug in the code

Comments

@dmical-icims
Copy link

Checklist

  • I have looked into the Readme and Examples, and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

We are observing the following stack trace in our production Auth0 tenant when an Auth0 management api limit is reached:

java.lang.IllegalArgumentException: argument \"content\" is null at com.fasterxml.jackson.databind.ObjectMapper._assertNotNull(ObjectMapper.java:4829) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3627) at com.auth0.net.BaseRequest.createRateLimitException(BaseRequest.java:225) at com.auth0.net.BaseRequest.createResponseException(BaseRequest.java:203) at com.auth0.net.BaseRequest.parseResponseBody(BaseRequest.java:84) at com.auth0.net.BaseRequest.execute(BaseRequest.java:139) at

Here is a corresponding Auth0 log (sanitized) that triggers this error. It appears a null response is not being handled when mapping the response body.

{ date : "2024-11-20T07:41:36.354Z", type : "api_limit", description : "Global per second organizations_read group limit has been reached", client_id : "my-client-id", client_name : "", details : { request : { method : "get", path : "/api/v2/organizations/{id}" }, response :{ } }, log_id : "90020241120074136363206000000000000001223372037538618937", tenant_name : "my-auth0-tenant" }

Reproduction

  1. trigger a rate limit event in an Auth0 tenant when making a request
  2. observe error

Additional context

No response

auth0-java version

2.12.0

Java version

17

@dmical-icims dmical-icims added the bug This points to a verified bug in the code label Nov 20, 2024
@tanya732
Copy link
Contributor

Hi @dmical-icims,

Thank you for bringing this issue to our attention.

I attempted to reproduce this behavior on my end but was unable to encounter the same issue. It’s certainly unusual, and I would like to gather more information to better understand and address the problem.

Could you please provide additional details, such as:

  • The specific number of requests being sent when the rate limit was hit.
  • Any relevant configuration or setup details in your application.
  • Whether this occurs consistently or intermittently.

In the meantime, I will also check with the team to investigate further.

Thank you

@dmical-icims
Copy link
Author

dmical-icims commented Dec 17, 2024

Thanks for looking into this issue.

We're seeing this exception thrown consistently when the requests being sent to the following management APIs exceed the configured rate limit.

GET /api/v2/organizations/{id} with Burst Request Limit: 50 RPS and Sustained Request Limit: 50/second
GET /api/v2/organizations/{id}/enabled_connections with Burst Request Limit: 500 RPM and Sustained Request Limit: 500/minute

@larsf96
Copy link

larsf96 commented Dec 19, 2024

Hi @dmical-icims
Can you post an example of your code? I've tried to reproduce it by calling this in parallel:
mgmt.organizations().get("org_j6EWECYYl2qWrRTW").execute();

The exception is thrown, but looking like this:

com.auth0.exception.RateLimitException: Request failed with status code 429: Global per second organizations_read group limit has been reached
        at com.auth0.net.BaseRequest.createRateLimitException(BaseRequest.java:226)
        at com.auth0.net.BaseRequest.createResponseException(BaseRequest.java:203)
        at com.auth0.net.BaseRequest.parseResponseBody(BaseRequest.java:84)
        at com.auth0.net.BaseRequest.execute(BaseRequest.java:139)
        at com.example.demo.TestComponent.makeAuth0Request(TestComponent.java:50)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1570)

@dmical-icims
Copy link
Author

dmical-icims commented Dec 19, 2024

The Auth0 management API calls are the same as your example. We're seeing the reported issue in a production environment for the following calls:

mgmt.organizations().get(organizationId).execute();
and
mgmt.organizations().getConnections(organizationId, filter).execute();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

No branches or pull requests

3 participants