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

HTML report erroring out frequently with --chrome.timeline flag #2310

Open
gidztech opened this Issue Feb 13, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@gidztech
Copy link
Contributor

gidztech commented Feb 13, 2019

I'm noticing that the HTML reports errors out frequently with the following error:

[2019-02-13 11:28:18] ERROR: TypeError: /usr/src/app/lib/plugins/html/templates/url/metrics/cpu.pug:6
    4| .row
    5|   .one-half.column
  > 6|    if browsertime.cpu.categories
    7|      table
    8|        tr
    9|          th(colspan='2') Categories (ms)

Cannot read property 'categories' of undefined
    at eval (eval at wrap (/usr/src/app/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:3331:21)
    at template (eval at wrap (/usr/src/app/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:4646:199)
    at Object.renderTemplate (/usr/src/app/lib/plugins/html/renderer.js:27:37)
    at HTMLBuilder._renderUrlPage (/usr/src/app/lib/plugins/html/htmlBuilder.js:369:16)
    at HTMLBuilder.render (/usr/src/app/lib/plugins/html/htmlBuilder.js:286:18)

I'm running this command (modified the path and website for example):

 docker run --shm-size=1g --rm -v "%cd%":/sitespeed.io sitespeedio/sitespeed.io:8.4.0 --outputFolder my-output-folder --budget.configPath sitespeed.io/budget.json --budget.output junit --preScript sitespeed.io/login.js https://mywebsite.com/dashboard -n 1 --chrome.timeline -b chrome

I've not figured out why. It could be a memory issue or some race condition.

@gidztech

This comment has been minimized.

Copy link
Contributor Author

gidztech commented Feb 13, 2019

I think it's related to the usage of the --chrome.timeline flag.

The cpu.pug file is only imported when that flag exists:

if options.browsertime.chrome && options.browsertime.chrome.timeline

I'm not getting the error when I omit the flag. Looks like browsertime.cpu is undefined.

@gidztech gidztech changed the title HTML report erroring out most of the time HTML report erroring out frequently with --chrome.timeline flag Feb 13, 2019

soulgalore added a commit that referenced this issue Feb 13, 2019

Extra guard for missing CPU data
This will not fix the original problem but at least make sure
we don't fail. #2310

@soulgalore soulgalore referenced this issue Feb 13, 2019

Merged

Extra guard for missing CPU data #2312

0 of 5 tasks complete
@soulgalore

This comment has been minimized.

Copy link
Member

soulgalore commented Feb 13, 2019

Hi @gidztech I'll push just a guard to make sure it doesn't fail but it is something else that's the root of the problem.

I run the same for the setup used here: https://dashboard.sitespeed.io/d/000000044/page-timing-metrics?orgId=1&var-base=sitespeed_io&var-path=desktopLoggedIn&var-group=en_wikipedia_org&var-page=_wiki_Barack_Obama&var-browser=chrome&var-connectivity=cable&var-function=median where I login the user and then test a couple of pages + collect the chrome timeline data.

Either there's a specific problem with how we use the --preScript or it's something with a combination of the preScript and the page you test. Any chance you could share that with me (peter [AT] soul galore [dot] com) then I can better get an understanding.

One thing I would look at first would to verify that the page finished loading in your preScript where you login the user (like if there's a redirect or something like that).

Best
Peter

soulgalore added a commit that referenced this issue Feb 13, 2019

Extra guard for missing CPU data (#2312)
This will not fix the original problem but at least make sure
we don't fail. #2310
@soulgalore

This comment has been minimized.

Copy link
Member

soulgalore commented Feb 25, 2019

@gidztech have you had time to test out the new version, and do you still get the error?

@gidztech

This comment has been minimized.

Copy link
Contributor Author

gidztech commented Feb 26, 2019

Hi @soulgalore. Just got around to looking at this again. Been a busy few weeks.

Thanks for adding the guard. It no longer errors out. However, when I download the Timeline, the data inside the file is not valid JSON. It's a load of random encodings by the looks of it.

Timeline

The rest of the report looks fine. I can see the page rendered correctly, the video and filmstrip look correct to, so I can't see any reason why the login script is at fault. All it does is navigate the page, input some username and password, click submit, and wait for a selector.

@soulgalore

This comment has been minimized.

Copy link
Member

soulgalore commented Feb 26, 2019

Aha, interesting, looks like an upstream bug then, either in Chrome or Chromedriver. I've seen that we sometimes on dashboard.sitespeed.io also gets problems getting the trace log but I haven't actually looked into the actual log. I've check next time it happens and if it is the same I'll create an Chromedriver bug and ask for help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.