Do not raise an exception if external stats endpoint fails, so login can work again. More verbosity for errors.#7187
Merged
ramyaragupathy merged 2 commits intodevelopfrom Mar 9, 2026
Conversation
for more information, see https://pre-commit.ci
|
Member
|
@emi420 - thanks for documenting the observations. @prabinoid - once PR is approved from your end, let's go ahead merge it so that it is not blocking contribution workflow. We need to understand:
|
Collaborator
|
As mentioned by @emi420 , after deploying the hotfix, the login will work but the stats update and mapper level upgrades will still not work due to the 429, too many requests error. Creating a separate ticket to track this, but for the time being, hotfix can be merged so that the login would work. |
prabinoid
approved these changes
Mar 9, 2026
This was referenced Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What type of PR is this? (check all applicable)
Describe this PR
Today people started to report problems with logging in. After some testing, I saw an error in the backend logs when the users stats are updated. In the production instance we can see this error:
2026-03-07 20:37:04.238 | DEBUG | loguru._logger:debug:2040 - External-Error in OSM APII've added more verbosity for the error logs in the function that update and save user stats and running TM locally I got HTTP error code
429"Too many requests".This PR adds more verbosity but also let the process continue when there's an error in an external stats API (OSM or OhSome), returning an empty object and not updating stats for the user.
Review Guide
AFAIK, returning an empty object for stats should not affect anything. Stats will be outdated until the both external stats services are working, but please take a look into this to be sure.
You can block any external stats URL manually (ex: using /etc/hosts) and see how it works when a requests fail. The error log will include more details now.
Then you can test this code in development/staging/prod to check that everything is working ok. Even if the OSM server keeps returning "Too many requests", login and other features should work, the affected features will be user stats reporting and badges + updating mapper level.