okfn / webshot

A web service to take screenshots
http://webshot.okfnlabs.org/
Other
21 stars 13 forks source link

Question from node noob: Why does it output 500 and "Unable to take screenshot"? #11

Closed ncserny closed 10 years ago

ncserny commented 10 years ago

Hey there,

I am trying to get this to run as my first node app ever. All on Ubuntu 12.04 LTS and the newest nodejs version.

Modules should be all installed, file permissions as well. I put a console.log to debug and this seems to happen:

/home/ubuntu/tmp/1131012-27438-y2zl70.png GET /api/generate?url=http%3A%2F%2Fwww.dasauto-magazine.com&width=1024&height=768&full=false 500 18ms - 27b

directory is there and has write permissions.

Would be great if you could point me to the right direction.

rufuspollock commented 10 years ago

Can you give more info about the error - what do you see in the console?

simong commented 10 years ago

Can you also specify which OS you're using? There's a pretty annoying bug in phantomjs right now on OS X: https://github.com/ariya/phantomjs/issues/11612

ncserny commented 10 years ago

In what console exactly? I just inserted a console.log and tried to find out where it wants to save the image temporarily.

We installed this on an Ubuntu 12.04 LTS so (un)fortunately not affected by the phantomjs on OS X bug. :)

simong commented 10 years ago

The app uses node-temp to generate a temporary path. On Ubuntu this is typically in /tmp. I've recently ran into 500 errors, when I was trying to screengrab a server behind HTTPS that was using SNI.

I'll add some more detailing error logging but IIRC phantomjs doesn't really give you a lot of useful information on errors unfortunately :(.

rufuspollock commented 10 years ago

@simong shall we close?

simong commented 10 years ago

Yeah this can be closed, I'll open another ticket to return debugging output back in the response.