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

Middlware Pipeline RecursionError: maximum recursion depth exceeded #846

Closed
nagibyro opened this issue Aug 6, 2024 · 2 comments
Closed
Assignees
Labels
Status: No Recent Activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:bug A broken experience

Comments

@nagibyro
Copy link

nagibyro commented Aug 6, 2024

Describe the bug

We are attempting to read a users people endpoint. And the SDK seems to work for about ~30 minutes then we start getting RecursionError exceptions. We call the graph sdk like:

query_params = PeopleRequestBuilder.PeopleRequestBuilderGetQueryParameters(
   orderby="displayName", top=page_size, filter="personType/class eq 'Person'"
)

request_config = RequestConfiguration(query_parameters=query_params)
people = await msgraph_client.me.people.get(request_configuration=request_config)

Expected behavior

Not to receive RecursionError: maximum recursion depth exceeded errors

How to reproduce

Unfortunately I have not been able to reproduce this locally and only see it happening in our deployed application after the app has been running for sometime.

SDK Version

1.5.2

Latest version known to work for scenario above?

No response

Known Workarounds

Restarting our app.

Debug output

Click to expand log ``` people = await msgraph_client.me.people.get(request_configuration=request_config)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/msgraph/generated/users/item/people/people_request_builder.py", line 66, in get

2024-08-06T14:44:31.553Z

return await self.request_adapter.send_async(request_info, PersonCollectionResponse, error_mapping)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/httpx_request_adapter.py", line 178, in send_async

2024-08-06T14:44:31.553Z

response = await self.get_http_response_message(request_info, parent_span)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/httpx_request_adapter.py", line 530, in get_http_response_message

2024-08-06T14:44:31.553Z

resp = await self._http_client.send(request)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/sentry_sdk/integrations/httpx.py", line 143, in send

2024-08-06T14:44:31.553Z

rv = await real_send(self, request, **kwargs)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/ddtrace/contrib/httpx/patch.py", line 137, in _wrapped_async_send

2024-08-06T14:44:31.553Z

resp = await wrapped(*args, **kwargs)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/httpx/_client.py", line 1661, in send

2024-08-06T14:44:31.553Z

response = await self._send_handling_auth(

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/httpx/_client.py", line 1689, in _send_handling_auth

2024-08-06T14:44:31.553Z

response = await self._send_handling_redirects(

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/httpx/_client.py", line 1726, in _send_handling_redirects

2024-08-06T14:44:31.553Z

response = await self._send_single_request(request)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/httpx/_client.py", line 1763, in _send_single_request

2024-08-06T14:44:31.553Z

response = await transport.handle_async_request(request)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/msgraph_core/middleware/async_graph_transport.py", line 21, in handle_async_request

2024-08-06T14:44:31.553Z

response = await self.pipeline.send(request)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/middleware/middleware.py", line 38, in send

2024-08-06T14:44:31.553Z

return await self._first_middleware.send(request, self._transport)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/middleware/redirect_handler.py", line 77, in send

2024-08-06T14:44:31.553Z

response = await super().send(request, transport)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/middleware/middleware.py", line 65, in send

2024-08-06T14:44:31.553Z

return await self.next.send(request, transport)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/middleware/retry_handler.py", line 84, in send

2024-08-06T14:44:31.553Z

response = await super().send(request, transport)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/middleware/middleware.py", line 65, in send

2024-08-06T14:44:31.553Z

return await self.next.send(request, transport)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/middleware/parameters_name_decoding_handler.py", line 62, in send

2024-08-06T14:44:31.553Z

response = await super().send(request, transport)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/middleware/middleware.py", line 65, in send

2024-08-06T14:44:31.553Z

return await self.next.send(request, transport)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/middleware/url_replace_handler.py", line 44, in send

2024-08-06T14:44:31.553Z

response = await super().send(request, transport)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/middleware/middleware.py", line 65, in send

2024-08-06T14:44:31.553Z

return await self.next.send(request, transport)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/middleware/user_agent_handler.py", line 30, in send

2024-08-06T14:44:31.553Z

return await super().send(request, transport)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/middleware/middleware.py", line 65, in send

2024-08-06T14:44:31.553Z

return await self.next.send(request, transport)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/middleware/headers_inspection_handler.py", line 54, in send

2024-08-06T14:44:31.553Z

response = await super().send(request, transport)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/middleware/middleware.py", line 65, in send

2024-08-06T14:44:31.553Z

return await self.next.send(request, transport)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/msgraph_core/middleware/telemetry.py", line 48, in send

2024-08-06T14:44:31.553Z

response = await super().send(request, transport)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/kiota_http/middleware/middleware.py", line 62, in send

2024-08-06T14:44:31.553Z

response = await transport.handle_async_request(request)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/msgraph_core/middleware/async_graph_transport.py", line 24, in handle_async_request

2024-08-06T14:44:31.553Z

response = await self.transport.handle_async_request(request)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/msgraph_core/middleware/async_graph_transport.py", line 24, in handle_async_request

2024-08-06T14:44:31.553Z

response = await self.transport.handle_async_request(request)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

File "/venv/lib/python3.12/site-packages/msgraph_core/middleware/async_graph_transport.py", line 24, in handle_async_request

2024-08-06T14:44:31.553Z

response = await self.transport.handle_async_request(request)

2024-08-06T14:44:31.553Z

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2024-08-06T14:44:31.553Z

[Previous line repeated 964 more times]

2024-08-06T14:44:31.553Z

RecursionError: maximum recursion depth exceeded

</details>


### Configuration

_No response_

### Other information

_No response_
@nagibyro nagibyro added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Aug 6, 2024
@shemogumbe
Copy link
Collaborator

Hello @nagibyro thanks for using the python SDK and for raising this.

On the issue,

  1. Does inspecting request headers give any clues to what might be going wrong - the location header, the retry-after-header:
  2. What is the page size, could it be too large?
  3. How large is the recordset likely to be returned by the query, if to large, have you considered getting paginated responses and following the odata.nect_link porperty?

@shemogumbe shemogumbe added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Aug 15, 2024

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: No Recent Activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants