ValueError When Handling Retry-After Headers After 429 Too Many Requests Error
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in vendor/microsoft/kiota-http-guzzle/src/Middleware/RetryHandler.php around line 298 and reproduce the 429 response from simultaneous OneDrive search requests. Verify handling of a Retry-After value such as "60,120" and confirm the request can retry or produce an appropriate HTTP exception instead of the parse error.
Written by the indexing model from the issue text.
Description
Describe the bug
The issue arises after encountering a 429 Too Many Requests error, which likely returns an incorrect Retry-After header value like 60,120 (representing two retry times or a malformed retry interval). When the retry handler attempts to process this value, it throws an error because it cannot properly parse the value into an integer due to the comma.
This bug was also observed in the Python version of the SDK and has been resolved by splitting the value on the comma, and using only the first of the two resulting values.
Expected behavior
- Server returns proper Retry After value
- Client is able to properly parse value & retry request or if still gets 429, throw an appropriate HTTP exception.
How to reproduce
- Trigger a 429 Too Many Requests error by sending multple simultaneous requests to onedrive search endpoint
me/drive/root/search(q='t') - Observe that the Retry-After header contains the value "60,120".
- The retry handler fails with the error
Fatal error: Uncaught exception "RuntimeException" with message "Unable to parse Retry-After header value 60,120" File: /var/www/html/vendor/microsoft/kiota-http-guzzle/src/Middleware/RetryHandler.php on line 298
SDK Version
2.4.0
Latest version known to work for scenario above?
No response
Known Workarounds
None
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- Dominant language
- PHP
- Stars
- 16
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoftgraph/msgraph-sdk-php-core
-
status:waiting-for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoftgraph/msgraph-sdk-php-core#227 · 2 comments · 1 reaction ·
-
status:waiting-for-triage type:bug
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
area:authentication goodfirstissue type:enhancement
microsoftgraph/msgraph-sdk-php-core#202 · 4 comments · 1 assignee ·
-
type:feature
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoftgraph/msgraph-sdk-php-core#195 · 2 comments ·
-
microsoftgraph/msgraph-sdk-php-core#132 · 1 comment · 1 assignee ·
All issues in microsoftgraph/msgraph-sdk-php-core
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/static-site-importer#1767 ·