-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Handle analytics publishing errors more gracefully #10185
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for jumping on this! The fix is straight forward and minimal. 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for identifying the culprit! Before we merge I just want to understand why we are using a AnalyticsClientPublisher
directly, rather than using localstack.utils.analytics.log
, which already handles errors and logging.
@dominikschubert do you remember?
publisher.publish( | ||
[Event(name="ls:usage_analytics", metadata=metadata, payload=aggregated_payload)] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason for not using the global analytics bus here? it already does buffering and graceful handling of errors
Co-authored-by: Thomas Rausch <[email protected]>
This PR is outdated, wasn't able to replicate the error anymore with the latest version, as the code path no longer gets called with the new runtime framework introduced in #10942 . Closing this one for now - we can revisit in the future if the issue comes up again. 👍 |
Motivation
In a support channel, we've seen error stack trace related to SSL verification when connecting to the analytics service (can happen if the user is behind a corporate proxy/firewall).
This behavior can be reproduced by setting
analytics.localstack.cloud
to an invalid IP address (where the TLS certificate doesn't match our hostname), then shutting down the container:These logs should not be presented to the user, and the error also causes the shutdown hooks not to be executed properly on shutdown in
stop_infra()
.Changes
Add a try/except block to catch the exception, and log it with an INFO log message.
Let me know if you'd like to see this covered with a test - happy to try and wire something up, if we think it could be useful.