Add CalDAV intermittent-connection probe + log correlation#232
Open
aatchison wants to merge 1 commit into
Open
Add CalDAV intermittent-connection probe + log correlation#232aatchison wants to merge 1 commit into
aatchison wants to merge 1 commit into
Conversation
Diagnostic tooling for the intermittent 'failed to connect to server mail.thundermail.com' calendar errors seen in Thunderbird desktop. A once-a-day integration test cannot catch a failure that occurs ~once every 2-3 hours, so this polls the CalDAV endpoint frequently and records which connection phase fails, then correlates failures against Stalwart CloudWatch logs to determine whether the root cause is Stalwart, the network/edge, or the client. - probe.py: stdlib-only poller timing DNS/TCP/TLS/PROPFIND phases with granular failure classification; appends JSONL results. - correlate.py: matches probe failures against /tb/prod/stalwart logs by public IP and timestamp window. - .env/.jsonl gitignored; README documents usage and result interpretation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Why
Thunderbird desktop users have been intermittently seeing "failed to connect to server mail.thundermail.com" for the calendar (Stalwart CalDAV), roughly once every 2–3 hours. Monitoring is green and the nightly integration test passes — but a once-a-day connect test cannot catch a failure that happens intermittently. Multiple people have observed it.
This adds diagnostic tooling to answer one question: is the root cause Stalwart, the network/edge, or the Thunderbird client? The cause may well be unrelated to Stalwart — this is how we find out for sure.
What
Under
research/caldav-probe/:probe.py— stdlib-only poller (runs locally, no install step). Pollshttps://<host>/dav/cal/on an interval and times each connection phase separately — DNS → TCP → TLS → CalDAVPROPFIND— classifying failures granularly (DNS_FAIL,TCP_FAIL,TLS_FAIL,AUTH_FAIL,HTTP_5XX,TIMEOUT,DAV_ERROR,OK). Appends one JSON line per attempt. Thecaldavlib was intentionally avoided because it collapses every failure into one opaque exception; raw sockets give true per-phase attribution.correlate.py— reads the JSONL, finds failures, and queries/tb/prod/stalwartCloudWatch logs in a window around each failure, filtered to this machine's public IP, so we see the server's view of our connections (or that it logged nothing).README.md,.env.example,.gitignore(.env+*.jsonlnever committed).Interpreting results
TLS_FAIL(cert)TCP_FAIL/TIMEOUTOKValidation
Verified end-to-end against prod with dummy creds: DNS/TCP/TLS phases all time correctly and the request classifies as
AUTH_FAIL(401). Resolved host3.78.21.144.🤖 Generated with Claude Code