Hi Everyone
We have a snowplow setup with BigQuery Loader and in our mobile app.
We use Flutter Tracker to track and send the event to the collector endpoint.
We have a custom event setup on Iglu and is able to send the event to the endpoint and insert to BigQuery without issue.
But we found some failed event that was inserted into the dead letter bucket.
Example below
{
"schema": "iglu:com.snowplowanalytics.snowplow.badrows/tracker_protocol_violations/jsonschema/1-0-1",
"data": {
"processor": {
"artifact": "snowplow-enrich-pubsub",
"version": "3.9.0"
},
"failure": {
"timestamp": "2024-07-08T04:56:34.405806Z",
"vendor": "com.snowplowanalytics.snowplow",
"version": "tp2",
"messages": [
{
"json": {
"eid": "20e15d95-f848-4825-9149-472b3110a893",
"res": "1080x2408",
"tv": "andr-6.0.4 flutter-0.6.0",
"e": "ue",
"tna": "test-ns-qa",
"tz": "Asia/Bangkok",
"stm": "1720414593939",
"p": "mob",
"cx": "Encode payload",
"ue_px": "Encode payload",
"dtm": "1720414592531",
"lang": "\u0e44\u0e17\u0e22",
"aid": "com.example.qa"
},
"error": "INVALID_DATA_PAYLOAD"
}
]
},
"payload": {
"vendor": "com.snowplowanalytics.snowplow",
"version": "tp2",
"querystring": [],
"contentType": "application/json; charset=utf-8",
"body": "{\"eid\":\"20e15d95-f848-4825-9149-472b3110a893\",\"res\":\"1080x2408\",\"tv\":\"andr-6.0.4 flutter-0.6.0\",\"e\":\"ue\",\"tna\":\"test-ns-qa\",\"tz\":\"Asia\\/Bangkok\",\"stm\":\"1720414593939\",\"p\":\"mob\",\"cx\":\"Encoded payload\",\"ue_px\":\"Encoded payload\",\"dtm\":\"1720414592531\",\"lang\":\"\u0e44\u0e17\u0e22\",\"aid\":\"com.example.qa\"}",
"collector": "ssc-3.0.1-pubsubsink",
"encoding": "UTF-8",
"hostname": null,
"timestamp": "2024-07-08T04:56:33.873Z",
"ipAddress": "",
"useragent": "snowplow/andr-6.0.4 android/14",
"refererUri": null,
"headers": [
"Host: example.qa.test.com",
"user-agent: snowplow/andr-6.0.4 android/14",
"content-type: application/json; charset=utf-8",
"Content-Length: 56747",
"accept-encoding: gzip",
"X-Cloud-Trace-Context: ''",
"Cookie: ''",
"Via: 1.1 google",
"X-Forwarded-For: '' , ''",
"X-Forwarded-Proto: https",
"Connection: Keep-Alive",
"application/json; charset=utf-8"
],
"networkUserId": ""
}
}
}
In the example above, we remove the ipAddress, cx, Cookie etc. but in the actual payload these data exist.
This is a custom schema we have setup and not the preset schema from snowplow.
The error only mentions INVALID_DATA_PAYLOAD and tracker_protocol_violations
Seem the payload violates some schema rule
And in this github
It only mentions that there is an issue with json self-describing
Weird thing we don’t understand is we try to resend this event with Python Tracker and it work we use the failed payload from the data failure key and send the same cx and ue_px and it can insert into BQ
We also try send the payload with postman and it also work.
So the issue is likely not from the payload
We also verify each field base in the github above on the payload section is not violate the rule set. the type is correct and the length is not over the limit
At first we through it some sort of length limit or size limit as the “Content-Length: 56747”, but we have send payload with way more data and way more length and is able to write to the BQ
We also tried to disable encoding in Flutter and send the payload still didn’t work and failed with the same error.
What we don’t understand is
- Why is the payload failed.
- If it failed due to json not self-describing why does send it via python SDK or postman work?
Anything we might have miss or any guidance on this matter would be very appreciated
We also try to look at the log from the enrich docker but it only output bad row without any detail on what is the error found.