sitespeedio / sitespeed.io

sitespeed.io is an open-source tool for comprehensive web performance analysis, enabling you to test, monitor, and optimize your website’s speed using real browsers in various environments.
https://www.sitespeed.io/
MIT License
4.75k stars 603 forks source link

Error running yslow for url in docker container #754

Closed tnguyen14 closed 8 years ago

tnguyen14 commented 9 years ago

Hi,

I am trying to run sitespeed inside the sitespeedio/sitespeed.io docker container. Here is the command I'm using

sitespeed.io -f /urls.txt -b firefox --connection cable -n 5 -r /tmp/ --seleniumServer http://127.0.0.1:4444/wd/hub

But I keep getting a bunch of the following errors

error: Yslow output for 'http://my-url.net' (stdout): FAIL to load http://production-sitegenesis-dw.demandware.net/s/SiteGenesis/electronics/digital%20cameras/sony-cybershot-t77.html?lang=en_US#lang=en_US&start=1

error: Error running yslow for url 'http://my-url.net': { [Error: Command failed: ] killed: true, code: null, signal: 'SIGTERM' }

Running the same command on my host Mac machine (without the --seleniumServer flag) seems to work fine. I am not quite sure what I might be doing wrong. Does anyone have any suggestion?

soulgalore commented 9 years ago

hey @tnguyen14 ok, the error is from yslow and it uses phantomjs, could it be different versions in the container and on your mac? do you run phantomjs 2 locally? Best Peter

tnguyen14 commented 9 years ago

thanks @soulgalore. I do not run phantomjs 2 locally. All I did to run locally is npm install sitespeed.io.

soulgalore commented 9 years ago

ok. So the error happens if the page onload function doesn't happend within (killed: true) 4 minutes. The failing URL, is there something special happens there that makes the onload to not happen, like some advertisements or so? Best Peter

tnguyen14 commented 9 years ago

I don't think so. The URL is https://production-sitegenesis-dw.demandware.net/s/SiteGenesis if you'd like to take a look. It's a demo site.

The reason I don't think there's something special to the page is because it works if I just run in on my host machine.

I wonder if it's a problem connecting to the selenium server somehow?

soulgalore commented 9 years ago

ok, and it happens everytime when you run using Docker? The Selenium server is only invoked in a later step when Chrome/Firefox is invoked.

What you can do, is use PhantomJS 2 in the container (it's much faster and generelly works better) it's shipped within the container just add --phantomjsPath /usr/local/phantomjs/bin/phantomjs when you run it. Hope that will work :)

tnguyen14 commented 9 years ago

oh, so by default it tries to use the phantomjs path of the host? I tried what you suggested, and it seems to work. But the regular command works now too... weird.. maybe all I had to do was restart my computer / VM where docker is running...

soulgalore commented 9 years ago

ok, hmm and nothing changed on the page?

about phantom and docker: by default it uses latest 1.9 (in the container) but the container is also shipped with a 2.0 version, but you need to configure to use it.

soulgalore commented 8 years ago

Closing old 3.x issues. Please reopen if you this still is an issue for 4.0.