node-horseman icon indicating copy to clipboard operation
node-horseman copied to clipboard

Unhandled rejection HeadlessError: Phantom immediately exited with: 255

Open ryderlee opened this issue 8 years ago • 12 comments

Hi. First of all, thanks very much for such project.

I am trying to use phantom-prebuilt with horseman and the following error came up when I tried to launch it. Do we have a list of all these error code and what it means? May I also ask how could I debug it? Thanks.

Unhandled rejection HeadlessError: Phantom immediately exited with: 255
    at ChildProcess.immediateExit (http://localhost:3000/dist/bundle.js:210237:24)
    at ChildProcess.g (events.js:286:16)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)

ryderlee avatar Feb 14 '17 14:02 ryderlee

The meanings of the error codes are not from Horseman. You need to look at PhantomJS probably.

awlayton avatar Mar 07 '17 20:03 awlayton

I seem to be bumping into this (or something similar) as well.

Phantom Simple is getting SIGSEGV

I noticed the node-phantom-simple build is failing and I'm wondering if that has anything to do with it.

F1LT3R avatar Mar 29 '17 15:03 F1LT3R

@awlayton Hi, this is cause of Horseman, there is no error code with 255 number in phantomJS, also I have tested phantomJS without Horseman using webdriverio it works as expected.

sharifzadesina avatar Aug 22 '17 08:08 sharifzadesina

It is not horman @sharifzadesina. The message clearly states that phantom is exiting with code 255. Horseman doesn't have or define any exit codes.

awlayton avatar Aug 23 '17 16:08 awlayton

@awlayton of course horseman doesn't. but it does something that cause this. you can test this by yourself, for example try to use horseman in electron or node-webkit, you will get 255 return code, but if you use phantomjs with webdriverio you won't.

sharifzadesina avatar Aug 23 '17 16:08 sharifzadesina

What do you mean use "use horseman in electron or node-webkit"? Horseman doesn't run in anything except NodeJS, and the only browsers it supports are phantom and slimer.

I cannot try it myself because for me phantom-prebuilt works just fine with Horseman. There must be something about your setup.

awlayton avatar Aug 23 '17 16:08 awlayton

@awlayton !!! man electron and node-webkit are node.js way for building desktop applications!!! they are node.js!!!

I told you how you can test, just try to run horseman on electron or node-webkit you will get this error.

Start here, it will take only 10 minute of you.

sharifzadesina avatar Aug 23 '17 16:08 sharifzadesina

I know what electron and node-webkit are. What would you use them with Horseman though? Horseman would still need phantom or slimer to work.

awlayton avatar Aug 23 '17 17:08 awlayton

@awlayton Yes, I install phantomjs-prebuilt, horseman can access to the phantomjs binary and it can run it, but it doesn't work and throws 255 error, for unknown reason, in the other hand phantomjs works well with webdriverio.

sharifzadesina avatar Aug 23 '17 17:08 sharifzadesina

I understand webdriverio. I do not understand what electron and node-webkit have to do with this.

awlayton avatar Aug 23 '17 17:08 awlayton

@awlayton I want to use horseman through electron/node-webkit desktop applications. but it throws 255 error.

sharifzadesina avatar Aug 23 '17 17:08 sharifzadesina

I do not really have time lately for debugging Horseman issues, which is why there are so many.

Using electron should have no effect on horseman. If I had time to debug, I would start by figuring out under what circumstances phantom exits with code 255.

If you post code I can run to try to reproduce the error on my system, I will try to run it. Or you could try the phamtomjs npm package, or installing phantomjs globally for horseman to find (it checks the $PATH).

awlayton avatar Aug 23 '17 18:08 awlayton