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

Poltergeist timeout #6

Open
AlreadyTalk opened this issue Jun 20, 2014 · 11 comments
Open

Poltergeist timeout #6

AlreadyTalk opened this issue Jun 20, 2014 · 11 comments

Comments

@AlreadyTalk
Copy link

Good morning,
I have a issue with the webshot.
I'm running the project in my local machine. I try to take a screenshot from my webpage, it gives my a time out from the poltergeist. If I try to take a the same page screenshot from the same page, but in some associate instance, doesn't give me the time out.
I look for the answer in other forums and nothing.
Can someone help me please?
I'm using Poltergeist, Capybara and PhantomJS

@vitalie
Copy link
Owner

vitalie commented Jun 20, 2014

Hi,

Check that you have enough CPU, RAM & bandwidth on your machine, also check that you can open the page from another browser.

Regards,
Vitalie

@AlreadyTalk
Copy link
Author

Hello. Yes I can open the page on all the browsers in my local machine, and from my associate machine too. I just can't take the screenshot.

@manoj2411
Copy link

Hey,

Facing the same issue, any update on this ??

BTW I am getting this on my terminal

Webshot::WebshotError: Capybara error: "Timed out waiting for response to {\"name\":\"visit\",\"args\":[\"http://www.google.com/\"]}. It's possible that this happened because something took a very long time (for example a page load was slow). If so, setting the Poltergeist :timeout option to a higher value will help (see the docs for details). If increasing the timeout does not help, this is probably a bug in Poltergeist - please report it to the issue tracker."
    from /Users/manoj/.rvm/gems/ruby-1.9.3-p484@heroku1/gems/webshot-0.0.7/lib/webshot/screenshot.rb:81:in `rescue in capture'
    from /Users/manoj/.rvm/gems/ruby-1.9.3-p484@heroku1/gems/webshot-0.0.7/lib/webshot/screenshot.rb:30:in `capture'
    from (irb):2
    from /Users/manoj/.rvm/gems/ruby-1.9.3-p484@heroku1/gems/railties-3.2.9/lib/rails/commands/console.rb:47:in `start'
    from /Users/manoj/.rvm/gems/ruby-1.9.3-p484@heroku1/gems/railties-3.2.9/lib/rails/commands/console.rb:8:in `start'
    from /Users/manoj/.rvm/gems/ruby-1.9.3-p484@heroku1/gems/railties-3.2.9/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

@arsenische
Copy link

Same here:

Webshot::WebshotError: Capybara error: "Timed out waiting for response to {\"name\":\"visit\",\"args\":[\"http://seocracking.blogspot.com/\"]}. It's possible that this happened because something took a very long time (for example a page load was slow). If so, setting the Poltergeist :timeout option to a higher value will help (see the docs for details). If increasing the timeout does not help, this is probably a bug in Poltergeist - please report it to the issue tracker."

ruby 2.0
phantomjs 1.9.7
webshot 0.0.7
capybara 2.4.3
poltergeist 1.5.1
ubuntu 14.04.1 LTS

It works fine with most of the other sites though.

@vitalie
Copy link
Owner

vitalie commented Sep 24, 2014

@AlreadyTalk @manoj2411 @arsenische

I'll take a look at this today.

Thank you!

@vgracia
Copy link

vgracia commented May 19, 2015

Yep same here. : ( It seems that timeout is hard to recover from.

@rgo
Copy link
Contributor

rgo commented Sep 16, 2015

It's not the solution for the timeouts(I think it is a poltergeist/phantomJS problem) but it can helps to mitigate it.

@vitalie: You implemented a timeout with sleep in the capture method. You can set it very high to avoid the timeouts but it's a pain to wait for working URLs

I was thinking in replace the sleep with this code:

def wait_until
  require "timeout"
  Timeout.timeout(Capybara.default_wait_time) do
    sleep(0.1) until value = yield
    value
  end
end

Code from: https://gist.github.com/jnicklas/d8da686061f0a59ffdf7

But instead of getting the value from a yield get it from the "visit url" or "page.driver.status_code"

What do you think?

@corehook
Copy link

Yep same here. : (

@mrdougwright
Copy link

Any fix yet?

@rgo
Copy link
Contributor

rgo commented Feb 15, 2017

@mrdougwright have you tried with latest version(0.1.0)?

It upgrades poltergeist and allows to requires phantomjs to 2.x. If I'm not mistaken timeout problem was solved since this phantomjs version.

Regards

@mrdougwright
Copy link

Yes, and still getting timeout. I may open separate issue as I'm now seeing the webshots misplaced when called repeatedly from an each block.

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

8 participants