Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some pages causes JSON error #1654

Closed
kchoi01 opened this issue Jun 30, 2017 · 3 comments
Closed

Some pages causes JSON error #1654

kchoi01 opened this issue Jun 30, 2017 · 3 comments

Comments

@kchoi01
Copy link

kchoi01 commented Jun 30, 2017

Hi, it seems certain pages cause an 'unexpected token in JSON at position 0' error. An example is https://www.macys.com/. WPT also seems to not able to get screenshots and gives error.

Here is part of the log:
INFO - b'Google Chrome 58.0.3029.81 \n'
INFO - b'Mozilla Firefox 53.0\n'
INFO - b'[2017-06-29 21:33:27] INFO: Versions OS: linux 4.4.0-1018-aws nodejs: v6.9.1 sitespeed.io: 5.1.0 browsertime: 1.2.5 coach: 0.34.1\n'
INFO - b'[2017-06-29 21:33:27] INFO: Sending url https://www.macys.com/ to test on xx.xx.xx.xx\n'
INFO - b'[2017-06-29 21:33:27] INFO: Starting chrome for analysing https://www.macys.com/ 3 time(s)\n'
INFO - b'[2017-06-29 21:33:28] INFO: Testing url https://www.macys.com/ run 1\n'
INFO - b'[2017-06-29 21:33:39] ERROR: SyntaxError: Unexpected token \x1f in JSON at position 0\n'
INFO - b'SyntaxError: Unexpected token \x1f in JSON at position 0\n'
INFO - b' at Object.parse (native)\n'
INFO - b' at parsePostData (/usr/src/app/node_modules/chrome-har/index.js:570:37)\n'
INFO - b' at Object.harFromMessages (/usr/src/app/node_modules/chrome-har/index.js:220:23)\n'
INFO - b' at runner.getLogs.timeout.map.tap.tap.then (/usr/src/app/node_modules/browsertime/lib/core/engineDelegate/chromeDelegate.js:66:41)\n'
INFO - b' at tryCatcher (/usr/src/app/node_modules/bluebird/js/release/util.js:16:23)\n'
INFO - b' at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/bluebird/js/release/promise.js:512:31)\n'
INFO - b' at Promise._settlePromise (/usr/src/app/node_modules/bluebird/js/release/promise.js:569:18)\n'
INFO - b' at Promise._settlePromise0 (/usr/src/app/node_modules/bluebird/js/release/promise.js:614:10)\n'
INFO - b' at Promise._settlePromises (/usr/src/app/node_modules/bluebird/js/release/promise.js:693:18)\n'
INFO - b' at Promise._fulfill (/usr/src/app/node_modules/bluebird/js/release/promise.js:638:18)\n'
INFO - b' at Promise._resolveCallback (/usr/src/app/node_modules/bluebird/js/release/promise.js:432:57)\n'
INFO - b' at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/bluebird/js/release/promise.js:524:17)\n'
INFO - b' at Promise._settlePromise (/usr/src/app/node_modules/bluebird/js/release/promise.js:569:18)\n'
INFO - b' at Promise._settlePromise0 (/usr/src/app/node_modules/bluebird/js/release/promise.js:614:10)\n'
INFO - b' at Promise._settlePromises (/usr/src/app/node_modules/bluebird/js/release/promise.js:693:18)\n'
INFO - b' at Promise._fulfill (/usr/src/app/node_modules/bluebird/js/release/promise.js:638:18)\n'
INFO - b' at Promise._resolveCallback (/usr/src/app/node_modules/bluebird/js/release/promise.js:432:57)\n'
INFO - b' at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/bluebird/js/release/promise.js:524:17)\n'
INFO - b' at Promise._settlePromise (/usr/src/app/node_modules/bluebird/js/release/promise.js:569:18)\n'
INFO - b' at Promise._settlePromise0 (/usr/src/app/node_modules/bluebird/js/release/promise.js:614:10)\n'
INFO - b' at Promise._settlePromises (/usr/src/app/node_modules/bluebird/js/release/promise.js:693:18)\n'
INFO - b' at Promise._fulfill (/usr/src/app/node_modules/bluebird/js/release/promise.js:638:18)\n'
INFO - b'From previous event:\n'
INFO - b' at ChromeDelegate.onStopIteration (/usr/src/app/node_modules/browsertime/lib/core/engineDelegate/chromeDelegate.js:66:8)\n'
INFO - b' at Promise.resolve.tap.tap.tap.tap.tap.tap.tap.tap.tap (/usr/src/app/node_modules/browsertime/lib/core/engine.js:285:39)\n'
INFO - b'From previous event:\n'
INFO - b' at runIteration (/usr/src/app/node_modules/browsertime/lib/core/engine.js:285:10)\n'
INFO - b' at Promise.reduce (/usr/src/app/node_modules/browsertime/lib/core/engine.js:326:25)\n'
INFO - b'From previous event:\n'
INFO - b' at Promise.resolve.tap.tap.tap.tap (/usr/src/app/node_modules/browsertime/lib/core/engine.js:325:17)\n'
INFO - b' at runCallback (timers.js:637:20)\n'
INFO - b' at tryOnImmediate (timers.js:610:5)\n'
INFO - b' at processImmediate [as _immediateCallback] (timers.js:582:5)\n'
INFO - b'From previous event:\n'
INFO - b' at Engine.run (/usr/src/app/node_modules/browsertime/lib/core/engine.js:324:8)\n'
INFO - b' at engine.start.then (/usr/src/app/lib/plugins/browsertime/analyzer.js:76:26)\n'
INFO - b'From previous event:\n'
INFO - b' at Object.analyzeUrl (/usr/src/app/lib/plugins/browsertime/analyzer.js:76:8)\n'
INFO - b' at storageManager.createDirForUrl.then.then (/usr/src/app/lib/plugins/browsertime/index.js:134:34)\n'
INFO - b' at /usr/src/app/node_modules/mkdirp/index.js:30:20\n'
INFO - b' at FSReqWrap.oncomplete (fs.js:123:15)\n'
INFO - b'From previous event:\n'
INFO - b' at Object.processMessage (/usr/src/app/lib/plugins/browsertime/index.js:134:14)\n'
INFO - b' at queue.process (/usr/src/app/lib/support/queueHandler.js:155:57)\n'
INFO - b' at drainItem (/usr/src/app/node_modules/concurrent-queue/index.js:92:21)\n'
INFO - b' at Immediate.drain (/usr/src/app/node_modules/concurrent-queue/index.js:73:84)\n'
INFO - b' at runCallback (timers.js:637:20)\n'
INFO - b' at tryOnImmediate (timers.js:610:5)\n'
INFO - b' at processImmediate [as _immediateCallback] (timers.js:582:5)\n'
INFO - b'[2017-06-29 21:39:59] INFO: Got https://www.macys.com/ analysed with id 170629_BX_453857d5d8c7c672c8b5091bf591ed7a from xx.xx.xx.xx\n'
INFO - b'[2017-06-29 21:39:59] ERROR: Couldnt get screenshot for id 170629_BX_453857d5d8c7c672c8b5091bf591ed7a WPTAPIError: Not Found\n'
INFO - b' at Object. (/usr/src/app/node_modules/webpagetest/lib/helper.js:213:25)\n'
INFO - b' at Module._compile (module.js:570:32)\n'
INFO - b' at Object.Module._extensions..js (module.js:579:10)\n'
INFO - b' at Module.load (module.js:487:32)\n'
INFO - b' at tryModuleLoad (module.js:446:12)\n'
INFO - b' at Function.Module._load (module.js:438:3)\n'
INFO - b' at Module.require (module.js:497:17)\n'
INFO - b' at require (internal/module.js:20:19)\n'
INFO - b' at Object. (/usr/src/app/node_modules/webpagetest/lib/webpagetest.js:14:15)\n'
INFO - b' at Module._compile (module.js:570:32)\n'
INFO - b' at Object.Module._extensions..js (module.js:579:10)\n'
INFO - b' at Module.load (module.js:487:32)\n'
INFO - b' at tryModuleLoad (module.js:446:12)\n'
INFO - b' at Function.Module._load (module.js:438:3)\n'
INFO - b' at Module.require (module.js:497:17)\n'
INFO - b' at require (internal/module.js:20:19)\n'
INFO - b' at Object. (/usr/src/app/lib/plugins/webpagetest/analyzer.js:8:17)\n'
INFO - b' at Module._compile (module.js:570:32)\n'
INFO - b' at Object.Module._extensions..js (module.js:579:10)\n'
INFO - b' at Module.load (module.js:487:32)\n'
INFO - b' at tryModuleLoad (module.js:446:12)\n'
INFO - b' at Function.Module._load (module.js:438:3)\n'
INFO - b'From previous event:\n'
INFO - b' at /usr/src/app/lib/plugins/webpagetest/analyzer.js:75:38\n'
INFO - b' at Array.forEach (native)\n'
INFO - b' at /usr/src/app/lib/plugins/webpagetest/analyzer.js:50:15\n'
INFO - b' at resultsCallback (/usr/src/app/node_modules/webpagetest/lib/webpagetest.js:345:7)\n'
INFO - b' at WebPageTest.poll (/usr/src/app/node_modules/webpagetest/lib/webpagetest.js:358:7)\n'
INFO - b' at callbackYield (/usr/src/app/node_modules/webpagetest/lib/webpagetest.js:152:14)\n'
INFO - b' at WebPageTest.apiCallback (/usr/src/app/node_modules/webpagetest/lib/webpagetest.js:221:7)\n'
INFO - b' at unzip (/usr/src/app/node_modules/webpagetest/lib/webpagetest.js:129:15)\n'
INFO - b' at Unzip.onEnd (zlib.js:227:5)\n'
INFO - b' at emitNone (events.js:91:20)\n'
INFO - b' at Unzip.emit (events.js:185:7)\n'
INFO - b' at endReadableNT (_stream_readable.js:974:12)\n'
INFO - b' at _combinedTickCallback (internal/process/next_tick.js:74:11)\n'
INFO - b' at process._tickCallback (internal/process/next_tick.js:98:9)\n'
INFO - b'From previous event:\n'
INFO - b' at Object.analyzeUrl (/usr/src/app/lib/plugins/webpagetest/analyzer.js:30:8)\n'
INFO - b' at Object.processMessage (/usr/src/app/lib/plugins/webpagetest/index.js:85:25)\n'
INFO - b' at queue.process (/usr/src/app/lib/support/queueHandler.js:155:57)\n'
INFO - b' at drainItem (/usr/src/app/node_modules/concurrent-queue/index.js:92:21)\n'
INFO - b' at Immediate.drain (/usr/src/app/node_modules/concurrent-queue/index.js:73:84)\n'
INFO - b' at runCallback (timers.js:637:20)\n'
INFO - b' at tryOnImmediate (timers.js:610:5)\n'
INFO - b' at processImmediate [as _immediateCallback] (timers.js:582:5)\n'
INFO - b' at ClientRequest.once (events.js:301:8)\n'
INFO - b' at new ClientRequest (_http_client.js:78:10)\n'
INFO - b' at Object.exports.request (http.js:31:10)\n'
INFO - b' at Object.exports.get (http.js:35:21)\n'
INFO - b' at WebPageTest.get (/usr/src/app/node_modules/webpagetest/lib/webpagetest.js:94:19)\n'
INFO - b' at WebPageTest.api (/usr/src/app/node_modules/webpagetest/lib/webpagetest.js:191:9)\n'
INFO - b' at WebPageTest.getScreenshotImage (/usr/src/app/node_modules/webpagetest/lib/webpagetest.js:683:14)\n'
INFO - b' at /usr/src/app/lib/plugins/webpagetest/analyzer.js:75:38\n'
INFO - b' at Array.forEach (native)\n'
INFO - b' at /usr/src/app/lib/plugins/webpagetest/analyzer.js:50:15\n'
INFO - b' at resultsCallback (/usr/src/app/node_modules/webpagetest/lib/webpagetest.js:345:7)\n'
INFO - b' at WebPageTest.poll (/usr/src/app/node_modules/webpagetest/lib/webpagetest.js:358:7)\n'
INFO - b' at Unzip.Readable.on (_stream_readable.js:687:35)\n'
INFO - b' at zlibBuffer (zlib.js:195:10)\n'
INFO - b' at Object.exports.unzip (zlib.js:147:10)\n'
INFO - b' at IncomingMessage.onEnd (/usr/src/app/node_modules/webpagetest/lib/webpagetest.js:125:16)\n'
INFO - b' at emitNone (events.js:91:20)\n'
INFO - b' at IncomingMessage.emit (events.js:185:7)\n'
INFO - b' at endReadableNT (_stream_readable.js:974:12)\n'
INFO - b' at _combinedTickCallback (internal/process/next_tick.js:74:11)\n'
INFO - b' at process._tickCallback (internal/process/next_tick.js:98:9)\n'
INFO - b' at IncomingMessage.Readable.on (_stream_readable.js:687:35)\n'
INFO - b' at ClientRequest.getResponse (/usr/src/app/node_modules/webpagetest/lib/webpagetest.js:113:11)\n'
INFO - b' at emitOne (events.js:96:13)\n'
INFO - b' at ClientRequest.emit (events.js:188:7)\n'
INFO - b' at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:474:21)\n'
INFO - b' at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)\n'
INFO - b' at Socket.socketOnData (_http_client.js:363:20)\n'
INFO - b' at emitOne (events.js:96:13)\n'
INFO - b' at Socket.emit (events.js:188:7)\n'
INFO - b' at readableAddChunk (_stream_readable.js:176:18)\n'
INFO - b' at Socket.Readable.push (_stream_readable.js:134:10)\n'
INFO - b' at TCP.onread (net.js:548:20)\n'

@soulgalore
Copy link
Member

Hi @kchoi01 thanks for reporting! Right now it works in Firefox, let us try to fix it this weekend for Chrome.

Best
Peter

@soulgalore
Copy link
Member

Released a fix in 5.4.1 a minute a go. It works for me but please verify you too @kchoi01 so we can close the issue. The problem was that if the server sent a response as content type JSON, we parsed the JSON but it was either not JSON or had an illegal character in it, it failed hard. Now we catch that.

@kchoi01
Copy link
Author

kchoi01 commented Jul 1, 2017

Hi, thanks for the fix. I confirm that it is working.

@kchoi01 kchoi01 closed this as completed Jul 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants