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

Stop Sentry being flooded by "failed host lookup" #4630

Closed
monsieurtanuki opened this issue Sep 11, 2023 · 1 comment · Fixed by #4642
Closed

Stop Sentry being flooded by "failed host lookup" #4630

monsieurtanuki opened this issue Sep 11, 2023 · 1 comment · Fixed by #4642
Assignees
Labels
✨ enhancement New feature or request good first issue Good for newcomers

Comments

@monsieurtanuki
Copy link
Contributor

Problem

Every week I receive a Sentry report that is flooded by SocketException: Failed host lookup: 'static.openfoodfacts.org'.
For instance, this week 2 of the top 3 Sentry errors were that type of error (like https://openfoodfacts.sentry.io/issues/4209456223/?notification_uuid=5e3ad9a2-7d25-4008-a32b-011d33135270&project=5376745&referrer=weekly_report)
Let's assume that the server is mature enough and does not need Smoothie Sentry errors to know when it's down.
By clearing those "failed host lookup" errors, the weekly report would make more sense, and we would be able to detect less frequent but more interesting errors.

Proposed solution

It looks like it affects specifically static.openfoodfacts.org. That's typically where we retrieve svg files (like "vegetarian" icon).
And in that case that's particularly stupid to have an error (reported by Sentry or not) because we have a local fallback icon anyway.
The solution would be to replace our unique SvgPicture.network( call (in svg_cache.dart) by something more robust if the network lookup fails. Something like we try-catch the download of the svg data and then display that data - and if there's a SocketException: Failed host lookup: 'static.openfoodfacts.org' we don't send a call to Sentry.

@monsieurtanuki
Copy link
Contributor Author

Additional thought: whatever solution we implement should cache the (successful) results, as SvgPicture.network does.
The cache should last as long as the app. For instance with static fields.
If we cache longer we may not be able to get the server icon changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request good first issue Good for newcomers
1 participant