{ "id": "170140", "key": "DAEMON-110", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12519", "key": "DAEMON", "name": "Appcelerator Daemon" }, "fixVersions": [ { "id": "18407", "description": "", "name": "Appc Daemon 1.0.0", "archived": false, "released": true, "releaseDate": "2017-12-05" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-10-26T16:59:30.000+0000", "created": "2017-10-26T13:11:16.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "18407", "description": "", "name": "Appc Daemon 1.0.0", "archived": false, "released": true, "releaseDate": "2017-12-05" } ], "issuelinks": [], "assignee": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "updated": "2017-10-26T16:59:30.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "15618", "name": "appcd-telemetry" } ], "description": "h5.Description\r\n\r\nI see this error occuring in my logs quite a lot, I've somehow ended up with an empty file in my {{C:\\Users\\ewan\\.appcelerator\\appcd\\telemetry}} dir, when trying to send the events appcd-telemetry chokes on this and fails to send. What we should do is wrap the JSON.parse in a try/catch if it throws nuke the file so we dont keep dying (the file on my machine is 2 days old)\r\n\r\n{code}\r\n2017-10-26T13:03:44.211Z error at JSON.parse ()\r\n2017-10-26T13:03:44.211Z error at json.batch.map.file (C:\\Users\\ewan\\Documents\\git\\appc-daemon\\packages\\appcd-telemetry\\src\\telemetry.js:251:20)\r\n2017-10-26T13:03:44.211Z error at Array.map ()\r\n2017-10-26T13:03:44.211Z error at pending.resolve (C:\\Users\\ewan\\Documents\\git\\appc-daemon\\packages\\appcd-telemetry\\src\\telemetry.js:249:22)\r\n2017-10-26T13:03:44.211Z error at new Promise ()\r\n2017-10-26T13:03:44.211Z error at sendBatch (C:\\Users\\ewan\\Documents\\git\\appc-daemon\\packages\\appcd-telemetry\\src\\telemetry.js:247:20)\r\n2017-10-26T13:03:44.211Z error at Timeout.sendTimer.setTimeout [as _onTimeout] (C:\\Users\\ewan\\Documents\\git\\appc-daemon\\packages\\appcd-telemetry\\src\\telemetry.js:285:4)\r\n2017-10-26T13:03:44.211Z error at ontimeout (timers.js:471:11)\r\n2017-10-26T13:03:44.211Z error at tryOnTimeout (timers.js:306:5)\r\n2017-10-26T13:03:44.211Z error at Timer.listOnTimeout (timers.js:266:5) } SyntaxError: Unexpected end of JSON input\r\n2017-10-26T13:03:44.211Z error at JSON.parse ()\r\n2017-10-26T13:03:44.211Z error at json.batch.map.file (C:\\Users\\ewan\\Documents\\git\\appc-daemon\\packages\\appcd-telemetry\\src\\telemetry.js:251:20)\r\n2017-10-26T13:03:44.211Z error at Array.map ()\r\n2017-10-26T13:03:44.211Z error at pending.resolve (C:\\Users\\ewan\\Documents\\git\\appc-daemon\\packages\\appcd-telemetry\\src\\telemetry.js:249:22)\r\n2017-10-26T13:03:44.211Z error at new Promise ()\r\n2017-10-26T13:03:44.211Z error at sendBatch (C:\\Users\\ewan\\Documents\\git\\appc-daemon\\packages\\appcd-telemetry\\src\\telemetry.js:247:20)\r\n2017-10-26T13:03:44.211Z error at Timeout.sendTimer.setTimeout [as _onTimeout] (C:\\Users\\ewan\\Documents\\git\\appc-daemon\\packages\\appcd-telemetry\\src\\telemetry.js:285:4)\r\n2017-10-26T13:03:44.211Z error at ontimeout (timers.js:471:11)\r\n2017-10-26T13:03:44.211Z error at tryOnTimeout (timers.js:306:5)\r\n{code}\r\n\r\nh5.Steps to reproduce\r\n\r\n# Run {{touch ~/.appcelerator/appcd/telemetry/c9bc717a-eeb1-4740-81cc-db5525c25ac4.json}} (might not work on Windows)\r\n# Watch the logs for events being sent\r\n\r\nh5.Actual\r\n\r\nChokes parsing a file\r\n\r\nh5.Expected\r\n\r\nShould not choke and should remove file", "attachment": [], "flagged": false, "summary": "appcd-telemetry: JSON.parse error causing unhandled promise rejection", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": null, "closedSprints": [ { "id": 964, "state": "closed", "name": "2017 Sprint 22 Tooling", "startDate": "2017-10-22T21:42:00.037Z", "endDate": "2017-11-05T22:42:00.000Z", "completeDate": "2017-11-06T16:36:21.766Z", "originBoardId": 219 } ], "comment": { "comments": [ { "id": "429660", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "https://github.com/appcelerator/appc-daemon/pull/98", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2017-10-26T13:33:14.000+0000", "updated": "2017-10-26T13:33:14.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }