Investigate spike in payload/info/sessionLength validation errors in the Main Ping
Categories
(Data Platform and Tools :: Monitoring & Alerting, task)
Tracking
(Not tracked)
People
(Reporter: frank, Assigned: klukas)
References
(Blocks 1 open bug)
Details
(Whiteboard: [dataquality])
See this dashboard for the errors themselves.
This bug is for breaking down what types of errors these are, and the cause of the values of these errors. For example, are they negative, truncated, or just malformed?
We can then decide on any of the following remediation:
- Ignoring this as a valid error
- Updating the schema to allow these kinds of values through
- Updating the client to prevent this problem
- Change the pipeline to handle this differently, e.g. cocercion
Comment 1•6 years ago
|
||
There has been a large spike in sessionLength errors due to invalid session lengths. The following three queries show the extent of the error:
Count the number of errors with sessionLength in them. This number is significant (about 3m per day).
https://console.cloud.google.com/bigquery?project=moz-fx-data-shared-prod&organizationId=442341870013&j=bq:US:bquxjob_63195634_16eec5eb507&page=queryresults
SELECT
DATE(submission_timestamp) AS date,
error_message,
exception_class,
COUNT(*)
FROM
`moz-fx-data-shar-nonprod-efed.payload_bytes_error.telemetry`
WHERE
DATE(submission_timestamp) >= date '2019-12-01'
AND document_type = 'main'
AND error_message LIKE '%#/payload/info/sessionLength:%'
GROUP BY
1,
2,
3
ORDER BY
4 DESC
Which versions are predominant in the errors? Firefox 71.0, release, build_id 20191202093317.
SELECT
SPLIT(uri, "/")[
OFFSET
(6)] AS version,
SPLIT(uri, "/")[
OFFSET
(7)] AS channel,
SPLIT(uri, "/")[
OFFSET
(8)] AS build_id,
COUNT(*) AS n_documents,
COUNT(DISTINCT SPLIT(uri, "/")[
OFFSET
(3)]) AS n_distinct_documents
FROM
`moz-fx-data-shar-nonprod-efed.payload_bytes_error.telemetry`
WHERE
DATE(submission_timestamp) >= date '2019-12-01'
AND document_type = 'main'
AND error_message LIKE '%#/payload/info/sessionLength:%'
GROUP BY
1,
2,
3
ORDER BY
4 DESC
What do the session lengths look like in the payloads? It turns out to be large, negative values.
https://console.cloud.google.com/bigquery?project=moz-fx-data-shared-prod&organizationId=442341870013&j=bq:US:bquxjob_426b3d5b_16eec3827ca&page=queryresults
SELECT
approx_quantiles(json_EXTRACT(udf_js.gunzip(payload),
"$.payload.info.sessionLength"), 10)
FROM
`moz-fx-data-shar-nonprod-efed.payload_bytes_error.telemetry`
WHERE
DATE(submission_timestamp) >= date '2019-12-01'
AND document_type = 'main'
AND error_message LIKE '%#/payload/info/sessionLength:%'
AND SPLIT(uri, "/")[
OFFSET
(8)] = '20191202093317'
LIMIT
1000
Comment 2•6 years ago
|
||
It seems to follow the update uptake curve for that release. I'd be interested to see if this is at most one ping per client, or if there is a sizable population of clients sending multiple of these.
Comment 3•6 years ago
|
||
This seems to be spread out over the population, I've written another query to check:
SELECT
date(submission_timestamp) as date,
count(distinct json_EXTRACT(udf_js.gunzip(payload), "$.clientId")) as n_clients,
count(*) as n_documents
FROM
`moz-fx-data-shar-nonprod-efed.payload_bytes_error.telemetry`
WHERE
DATE(submission_timestamp) >= date '2019-12-01'
AND document_type = 'main'
AND error_message LIKE '%#/payload/info/sessionLength:%'
AND SPLIT(uri, "/")[OFFSET(8)] = '20191202093317'
group by 1
order by 1
Row date n_clients n_documents
1 2019-12-02 6 6
2 2019-12-03 1757 1795
3 2019-12-04 10394 10786
4 2019-12-05 13113 13553
5 2019-12-06 28756 29407
6 2019-12-07 23794 24369
7 2019-12-08 22829 23273
8 2019-12-09 35857 36653
Note that this query is based on the non-prod project, which is a 1% sample of documents.
Comment 4•6 years ago
|
||
Anthony noticed that all of these are coming from Windows users. Hey Robert, did something new with Windows updates ride in 71?
Comment 5•6 years ago
|
||
Hi Chris, are you referring to something that would cause "session lengths" to be "large, negative values"? If so, nothing app update related that I can think of though there might be something outside of app update that caused this.
Comment 6•6 years ago
|
||
Yeah, that was to what I was referring. I was hoping there was some Update Agent shenanigans in the work that would somehow muck with when the browser thinks it was launched the first time after update.
Comment 7•6 years ago
|
||
Sorry, nothing in the way app update launches Firefox has changed that I can think of. Maybe this has something to do with the launcher (shot in the dark and I only know of its existence).
Comment 8•6 years ago
|
||
Launcher? I remember :aklotz knowing things about that.
Comment 9•6 years ago
|
||
I don't see how the launcher process could be affecting anything here...
Comment 10•6 years ago
|
||
sessionLength's computation is really straightforward, but it depends on a monotonic time calculated using Timestamp::NowLoRes and Timestamp::ProcessCreation.
Anthony, is telemetry.process_creation_timestamp_inconsistent set in these negative-sessionLength-having pings? There don't appear to be any in the sample of telemetry.main I've looked into.
Comment 11•6 years ago
|
||
There don't appear to be any appearances of process_creation_timestamp_inconsistent in the rejected pings either. In general, the inconsistent timestamp probe is rare with 37 instances in the last 3 months.
Comment 12•6 years ago
|
||
Which means TimeStamp is convinced that the values it's giving us are consistent.
*loses himself into win32 api documentation* There doesn't appear to be any obvious footgun in the APIs being used. And even if we were sandboxed into not being able to get the process creation timestamp (you need specific permission), that'd mean we'd just be getting largish positive values (the value of NowLoRes) because overflow is frankly unlikely given the width of the datatypes involved (64bits across the board).
It seemed more likely that we were getting a NowLoRes smaller than ProcessCreation. This could happen, I suppose, due to resolution, I guess, but the advertised resolution of NowLoRes on Windows is typically about 10-16ms so that would mean that the sessionLength was less than, say, 20ms long.
And that doesn't hold up to the quantiles you posted earlier which range from -1B to -9.5B (ish). The bottom end of the range fits into 32 bits, but the upper end doesn't. And the durations we're off by don't make sense either, being on the order of years.
Absolutely none of this makes sense to me, and I'm running out of experts to stunt in and explain how computers are this weird All The Time and isn't it funny we're only noticing that Now.
Comment 13•6 years ago
|
||
There is bug 1601796, but it doesn't explain the spike.
Comment 14•6 years ago
|
||
This seems like the same issue as bug 1514392, unfortunately :janerik and I didn't come to any definitive conclusions on what was happening there...
| Assignee | ||
Comment 15•6 years ago
|
||
Proposal to allow negative session lengths
Given that we have not yet found a root cause, we need to consider how to work around the issue.
There is likely more harm caused by having these pings rejected (which affects nearly every desktop analysis) vs. allowing in negative values for sessionLength. It's my understanding that sessionLength is generally considered unreliable and not suitable for analysis already (activeTicks is the better alternative) so any analysis relying on sessionLength is already vulnerable to messy data.
The best way forward looks to be relaxing the schema so that negative values are allowed. We can additionally update the user-facing view (telemetry.main) to show null wherever the sessionLength value is negative. We would then backfill from the errors table to restore the missing pings and rerun downstream ETL.
I will plan to discuss with Data Science a bit before we move forward.
| Assignee | ||
Comment 16•6 years ago
|
||
I held a discussion about this bug at today's Data Science team meeting. Opinions on how best to handle this are not uniform, but consensus is that the proposed way forward here is the least bad response. In particular, we will allow negative values but make them null in user-facing views and make sure ETL queries also drop the negative values. Data scientists and other sophisticated data users can still look at the underlying tables as needed to better understand the negative values.
| Assignee | ||
Comment 17•6 years ago
|
||
PR to allow negative values: https://github.com/mozilla-services/mozilla-pipeline-schemas/pull/474
| Assignee | ||
Comment 18•6 years ago
|
||
PR for nulling negative sessionLengths in user-facing views: https://github.com/mozilla/bigquery-etl/pull/649
| Assignee | ||
Comment 19•6 years ago
|
||
The first day with over 1 million rejected pings is 2019-12-04. The last date with rejected pings is 2020-01-09. So the backfill range will be 2019-12-04 to 2020-01-09.
| Assignee | ||
Comment 20•6 years ago
|
||
This data is backfilled to telemetry.main and I'll work on rerunning ETL later this week.
| Assignee | ||
Comment 21•6 years ago
|
||
I've backfill main_summary and clients_daily. I plan to finish remaining ETL backfills today.
| Assignee | ||
Comment 22•6 years ago
|
||
ETL backfills are complete. Discussion has moved to https://bugzilla.mozilla.org/show_bug.cgi?id=1609465 so I think we should close this bug.
Updated•6 years ago
|
Updated•6 years ago
|
Updated•3 years ago
|
Description
•