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

PhantomJS keeps timing out. #26

Closed
ghost opened this issue Sep 24, 2015 · 18 comments
Closed

PhantomJS keeps timing out. #26

ghost opened this issue Sep 24, 2015 · 18 comments
Labels

Comments

@ghost
Copy link

ghost commented Sep 24, 2015

I configured Scumblr and Sketchy to work together. I start up the server and take screenshots and it would work but, if I've been idle or something, I'd keep getting an error in the terminal that says:

[2015-09-24 14:48:18,910: ERROR/Worker-1] PhantomJS Capture timeout at 35 seconds

ERROR in tasks [/home/user/sketchy/sketchy/controllers/tasks.py:341]:
Command 'phantomjs capture' timed out after 35 seconds

@sbehrens
Copy link
Contributor

What URL are you trying to capture? Does this happen when you try www.google.com.

@sbehrens
Copy link
Contributor

You can also configure the PHANTOMJS_TIMEOUT in config-default.py

# Maximum time to wait for PhantomJS to generate a screenshot
PHANTOMJS_TIMEOUT = 35

Try changing that to 50 or 60 seconds.

@ghost
Copy link
Author

ghost commented Oct 1, 2015

I've done as you said and changed it to 60 and it still keeps timing out. Here's an example URL I'm trying to capture from pastebin:

http://www.pastebin.com/Xm71fEcf

And the error message is:

[2015-10-01 14:48:18,910: ERROR/Worker-1] PhantomJS Capture timeout at 75 seconds

@sbehrens
Copy link
Contributor

sbehrens commented Oct 1, 2015

Can you tell me a little bit about the host you are running on? Screenshot generation is pretty CPU intensive. That particular pastebin dump would generate a pretty large screenshot. Depending on the system's CPU you may want to set that threshold even higher.

Is Sketchy able to screenshot other sites with less content (google, etc.)?

@ghost
Copy link
Author

ghost commented Oct 1, 2015

Running on Ubuntu 14.04 Trusty.
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 37
model name : Intel(R) Core(TM) i5 CPU M 520 @ 2.40GHz
cpu MHz : 2393.998
cache size : 3072 KB

Yes, sketchy is able to take screenshots of other sites with less content.

@sbehrens
Copy link
Contributor

sbehrens commented Oct 1, 2015

I think it's just maxing out and taking too long to render. Try doubling the PHANTOMJS_TIMEOUT to 120 seconds or even a few minutes. Your Scumblr searches may take a bit longer to run but you may end up with more reliable results for really huge captures. Let me know if doubling to 120 helped.

@ghost
Copy link
Author

ghost commented Oct 1, 2015

Will do and let you know how it goes tomorrow.

@ghost
Copy link
Author

ghost commented Oct 2, 2015

I did double it to 120, still same thing. It keeps timing out. Instead of making Scumblr generate all screenshots including this, this time, I only requested a screenshot of the URL as to see if it was a CPU problem which I'm assuming I can conclude it isn't since this was the only screenshot requested.

@sbehrens
Copy link
Contributor

sbehrens commented Oct 2, 2015

If it's working for other sites it just may be that it contains too much content to render a screenshot. If it's working for other sites that may indicate it's a PhantomJS screenshot generation issue, most likely related to Phantom.

@ghost
Copy link
Author

ghost commented Oct 2, 2015

Understood,

Thanks.

@ghost ghost closed this as completed Oct 2, 2015
@jwilczek
Copy link

jwilczek commented Dec 8, 2015

I'm having the same issue, I think. What's interesting about this particular issue is that it appears that sketchy is stuck on a particular request that is timing out and, as such, is not moving on to other requests. The request in issue has a job_status of "RETRY" and was created on 11/26. In the sketchy.log, I see:

2015-12-08 16:18:24,862 ERROR: PhantomJS Capture timeout at 60 seconds [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:114]
2015-12-08 16:18:24,862 ERROR: Command 'phantomjs capture' timed out after 60 seconds [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:354]
2015-12-08 16:18:26,816 ERROR: [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:374]
2015-12-08 16:18:26,822 ERROR: [in /mnt/data/apps/sketchy/sketchy/init.py:68]
2015-12-08 16:18:27,121 ERROR: [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:374]
2015-12-08 16:18:27,126 ERROR: [in /mnt/data/apps/sketchy/sketchy/init.py:68]
2015-12-08 16:18:27,538 ERROR: [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:374]
2015-12-08 16:18:27,543 ERROR: [in /mnt/data/apps/sketchy/sketchy/init.py:68]
2015-12-08 16:18:29,146 ERROR: [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:374]
2015-12-08 16:18:29,153 ERROR: [in /mnt/data/apps/sketchy/sketchy/init.py:68]

I'm not sure what to make of this yet, but I think a few things are seeming possible. First, it seems like sketchy was stuck in some weird loop as the moment I deleted the offended request (flagged as RETRY), all subsequent requests were made and completed. Second, this doesn't seem to be a timeout issue per se as the offending site had been collected before without any issue.

All that said, I don't have enough time with the sketchy code to really offer anything significant. Thoughts?

Thank you!

Josh

@jwilczek
Copy link

jwilczek commented Dec 8, 2015

Also, anyone know what the ERRORS are related to? If I tail sketchy.log I see output similar to below all the time.

2015-12-08 16:26:36,377 ERROR: PhantomJS Capture timeout at 60 seconds [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:114]
2015-12-08 16:26:36,378 ERROR: Command 'phantomjs capture' timed out after 60 seconds [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:354]
2015-12-08 16:26:38,531 ERROR: [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:374]
2015-12-08 16:26:38,540 ERROR: [in /mnt/data/apps/sketchy/sketchy/init.py:68]
2015-12-08 16:26:38,901 ERROR: [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:374]
2015-12-08 16:26:38,908 ERROR: [in /mnt/data/apps/sketchy/sketchy/init.py:68]
2015-12-08 16:26:39,388 ERROR: [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:374]
2015-12-08 16:26:39,395 ERROR: [in /mnt/data/apps/sketchy/sketchy/init.py:68]
2015-12-08 16:26:43,545 ERROR: [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:374]
2015-12-08 16:26:43,552 ERROR: [in /mnt/data/apps/sketchy/sketchy/init.py:68]
2015-12-08 16:26:44,028 ERROR: [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:374]
2015-12-08 16:26:44,034 ERROR: [in /mnt/data/apps/sketchy/sketchy/init.py:68]
2015-12-08 16:26:44,479 ERROR: [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:374]
2015-12-08 16:26:44,486 ERROR: [in /mnt/data/apps/sketchy/sketchy/init.py:68]
2015-12-08 16:26:54,482 ERROR: [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:374]
2015-12-08 16:26:54,489 ERROR: [in /mnt/data/apps/sketchy/sketchy/init.py:68]
2015-12-08 16:26:54,975 ERROR: [in /mnt/data/apps/sketchy/sketchy/controllers/tasks.py:374]
2015-12-08 16:26:54,984 ERROR: [in /mnt/data/apps/sketchy/sketchy/init.py:68]

@sbehrens sbehrens reopened this Dec 11, 2015
@sbehrens
Copy link
Contributor

@jwilczek Hi Josh, can you send me over the URL that was acting up? Also I think the errors are benign, I'll push a fix up to remove the logging (I think those were supposed to be informational logs not error).

@sbehrens
Copy link
Contributor

sbehrens commented Jan 5, 2016

@jwilczek Please reopen this issue if you can provide the URL that was causing issues. w

@jwilczek
Copy link

jwilczek commented Jan 9, 2016

Sorry for the slow reply! In debugging the issue, I deleted the offending URL (without documenting it) and have yet to have another issue. I will reopen if this occurs again. Thanks!

@jwilczek
Copy link

Ok, I'm seeing the issues again. I can share a URL (and my /api/v1.0/capture file), but I'd rather do it privately. Is that OK?

Also, when I delete the offending entries from within Scumblr, it seems sketchy is still trying to grab screenshots.

@sbehrens
Copy link
Contributor

Sure you can email me directly sbehrens @ gmail

On Wed, Jan 13, 2016 at 7:55 AM, jwilczek notifications@github.com wrote:

Ok, I'm seeing the issues again. I can share a URL (and my
/api/v1.0/capture file), but I'd rather do it privately. Is that OK?


Reply to this email directly or view it on GitHub
#26 (comment).

@jwilczek
Copy link

Email sent. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants