{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/1033","labels_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/1033/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/1033/comments","events_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/1033/events","html_url":"https://github.com/mozilla/thimble.webmaker.org/issues/1033","id":104511504,"number":1033,"title":"Investigate frequent crashes due to publish.wm.org sending html vs. JSON","user":{"login":"gideonthomas","id":5816130,"avatar_url":"https://avatars.githubusercontent.com/u/5816130?v=3","gravatar_id":"","url":"https://api.github.com/users/gideonthomas","html_url":"https://github.com/gideonthomas","followers_url":"https://api.github.com/users/gideonthomas/followers","following_url":"https://api.github.com/users/gideonthomas/following{/other_user}","gists_url":"https://api.github.com/users/gideonthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/gideonthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gideonthomas/subscriptions","organizations_url":"https://api.github.com/users/gideonthomas/orgs","repos_url":"https://api.github.com/users/gideonthomas/repos","events_url":"https://api.github.com/users/gideonthomas/events{/privacy}","received_events_url":"https://api.github.com/users/gideonthomas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/labels/BLOCKED","name":"BLOCKED","color":"eb6420"},{"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/labels/P1","name":"P1","color":"e11d21"},{"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/labels/publish.webmaker.org","name":"publish.webmaker.org","color":"bfdadc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-09-02T15:42:35Z","updated_at":"2015-09-18T20:13:18Z","closed_at":"2015-09-18T20:13:18Z","body":"We have gotten into this a couple of times now where the express app crashes because `JSON.parse` fails. We have a fix in that surrounds every `JSON.parse` with a try/catch so that we don't crash.\r\n\r\nHowever, the issue still remains that we shouldn't be failing to `JSON.parse` anything. We get an error resembling this:\r\n```\r\nSep 02 08:25:57 bramble-production app/web.2:  undefined:1 \r\nSep 02 08:25:57 bramble-production app/web.2:  <!DOCTYPE html> \r\nSep 02 08:25:57 bramble-production app/web.2:  ^ \r\nSep 02 08:25:57 bramble-production app/web.2:  SyntaxError: Unexpected token < \r\nSep 02 08:25:57 bramble-production app/web.2:      at Object.parse (native) \r\nSep 02 08:25:57 bramble-production app/web.2:      at IncomingMessage.<anonymous> (/app/routes/files/create-update.js:78:21) \r\nSep 02 08:25:57 bramble-production app/web.2:      at IncomingMessage.emit (events.js:129:20) \r\nSep 02 08:25:57 bramble-production app/web.2:      at _stream_readable.js:908:16 \r\nSep 02 08:25:57 bramble-production app/web.2:      at process._tickCallback (node.js:355:11) \r\n```\r\n\r\nSeems like publish.webmaker.org is somehow sending us HTML (probably due to a crash) and we fail to `JSON.parse` it."},"comment":{"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/comments/141554901","html_url":"https://github.com/mozilla/thimble.webmaker.org/issues/1033#issuecomment-141554901","issue_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/1033","id":141554901,"user":{"login":"humphd","id":427398,"avatar_url":"https://avatars.githubusercontent.com/u/427398?v=3","gravatar_id":"","url":"https://api.github.com/users/humphd","html_url":"https://github.com/humphd","followers_url":"https://api.github.com/users/humphd/followers","following_url":"https://api.github.com/users/humphd/following{/other_user}","gists_url":"https://api.github.com/users/humphd/gists{/gist_id}","starred_url":"https://api.github.com/users/humphd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humphd/subscriptions","organizations_url":"https://api.github.com/users/humphd/orgs","repos_url":"https://api.github.com/users/humphd/repos","events_url":"https://api.github.com/users/humphd/events{/privacy}","received_events_url":"https://api.github.com/users/humphd/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T20:13:18Z","updated_at":"2015-09-18T20:13:18Z","body":"I'm going to close this, and we can file new bugs as we find things with the improved logging."}}