Logs Service server responded with an internal error (potentially load-shedding)

Receiving this error when calling the logs endpoint. Are these endpoints rate limited? If so, how do I get around this?

Logs Service server responded with an internal error (potentially load-shedding)

for i in range(99):
    # execute Auth0 get user request
    url = "https://***.auth0.com/api/v2/logs"
    parameters = {'page': i, 'per_page': 99, 'client_name':'My Application', 'type':'s*', 'date':'[2025-01-01 TO *]'}
    headers = {'Content-type': 'application/json', 'Accept': 'text/plain', 'Authorization': BEARER}
    response = requests.get(url, headers=headers, params=parameters)

    data = json.loads(response.text)    
    json_string = json.dumps(data)
    strg = json_string.strip("[]")

    # dump log response to file
    with open(FILE_PATH,'w') as outfile:
        outfile.write(strg)

Hi @emurphy

As per our Management API Documentation, there is a limitation of 100 log events per request to retrieve logs, also you may only paginate through up to 1,000 search results.

However, can you provide me the exact error code and full message in order to investigate this further if necessary?

Kind Regards,
Nik

Thanks for your response Nik. See below.

{"statusCode": 400, "error": "Bad Request", "message": "Logs Service server responded with an internal error (potentially load-shedding)"}

Hi @emurphy

I have looked into the issue that you are facing and first of all, you request URI seems to be valid, I have tested on my end a similar URL for the request and it seemed to go through:

https://{{auth0_domain}}/api/v2/logs?page=0&per_page=99&client_name={random_app_name}&type=s*&date=2025-01-01 TO *

I believe the issue that you are having is caused by the fact that you are making too many requests to the Log Server and that is why you are receiving a load-shedding error

You can try testing it out with fewer requests, such as using for i in range(5) to see if you receive the same error.

Let me know if you are still facing issues with the error or if you have any other questions on the matter.

Kind Regards,
Nik

Fewer requests works, and should have mentioned that in my original post. So basically there is no way to retrieve in bulk without additional pagination logic. Thanks for your help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.