simagix / hatchet

MongoDB JSON Log Analyzer
Apache License 2.0
165 stars 22 forks source link

unhandled data type primitive.Decimal128, 0 error on parsing mongod log #13

Closed tobennelson closed 1 year ago

tobennelson commented 1 year ago

There's another unhandled data type I discovered in a new log:

$ hatchet -web mongodb.log
2023/03/01 12:42:30 processing mongodb.log
2023/03/01 12:42:30 hatchet name is ssssad_0d2ef4
2023/03/01 12:42:30 fast counting mongodb.log ...
...
...
2023/03/01 12:42:30 unhandled data type primitive.Decimal128, 0
2023/03/01 12:42:30 unhandled data type primitive.Decimal128, 0
...

I isolated the first two lines that were being processed which threw this error (attached), however unilke the data type error seen on minKey, this "primitive" isn't explicitly listed as "Decimal128" in the log lines, e.g.:

[{"t":{"$date":"2023-01-30T04:41:31.770+00:00"},"s":"I",  "c":"WRITE",    "id":51803,   "ctx":"conn2780","msg":"Slow query","attr":{"type":"update","ns":"STFPIMSQS.PurchaseOrder","command":{"q":{"_id":{"$oid":"63d32d03e6b07c1af9168e5b"}},"u":{"$set":{"_id":{"$oid":"63d32d03e6b07c1af9168e5b"},"orderNumber":"8230628","orderDate":"2020-06-16T00:00","orderStatusCode":"I","orderStatusDescription":"RECEIVED","mpnOrdered":"C419406-17","mpnReceived":"C419406-17","mepn":"78-5010-3-0104","isAOG":false,"stationCode":"D00","shipToStation":"1","supplierNumber":"131997","supplierSequence":"1","buyerCode":"555","expediteIndicator":"","isSpec2000S1Booked":true,"exceptionQuantity":0,"newPartIndicator":false,"hasBlanketOrder":false,"orderQuantity":6,"receivedQuantity":6,"reopenQuantity":0,"underReceiptQty":0,"queueBypassIndicator":"B","planner":"100599","receipts":2,"receiptDate":"2020-07-07T00:00","requiredDate":"2020-07-12T00:00","aircraftNumber":"0","scheduledShipQuantity":0,"requistionNumber":"0","receivedDate":"2020-11-13T00:00","minimumOrderAmount":0,"averageLeadTime":"0","carrier":"","waybill":"FEDX              ","packingSlip":"1537778","averageCost":{"$numberDecimal":"0"},"metadata":{"id":{"$oid":"63d32d03e6b07c1af9168e5b"},"tms":{"$date":"2023-01-30T04:41:24.722Z"},"user":"po-data-processor","sourceTms":{"$date":"2023-01-30T04:41:24.722Z"}}}},"multi":false,"upsert":true},"planSummary":"IDHACK","keysExamined":0,"docsExamined":0,"nMatched":0,"nModified":0,"nUpserted":1,"keysInserted":2,"numYields":0,"locks":{"ParallelBatchWriterMode":{"acquireCount":{"r":8676}},"FeatureCompatibilityVersion":{"acquireCount":{"w":8676}},"ReplicationStateTransition":{"acquireCount":{"w":8677}},"Global":{"acquireCount":{"w":8676}},"Database":{"acquireCount":{"w":8676}},"Collection":{"acquireCount":{"w":8676}},"Mutex":{"acquireCount":{"r":8676}}},"flowControl":{"acquireCount":4338,"timeAcquiringMicros":5145},"readConcern":{"level":"local","provenance":"implicitDefault"},"storage":{"data":{"bytesRead":227014,"timeReadingMicros":318}},"remote":"192.168.254.9:2436","durationMillis":363}}

Assuming it's similar to Go's Decimal128.BigInt() type, but can't discern from above lines which field is the culprit.

FrancescoKa commented 1 year ago

Hi, when i open a hatchet from the browser i get this error

{"error":"template: hatchet:545: function \"break\" not defined","ok":0}

2023/03/03 18:12:10 GIT/hatchet v0.3.2-20230303 mongodb 4.4.18

simagix commented 1 year ago

What’s your go version? Upgrade to v1.18 or later, https://tip.golang.org/doc/go1.18. If it doesn’t work, create a new issue.

FrancescoKa commented 1 year ago

Hi, I had go1.16.1 . I can confirm that , hafter having upgraded to go1.20.1, the issue has been resolved .