question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Phantom Process died

See original GitHub issue

I have met a problem:

Unhandled rejection HeadlessError: Phantom Process died
    at ClientRequest.<anonymous> (/Users/zhuyingda/nodejs/veneno/node_modules/node-phantom-simple/node-phantom-simple.js:655:12)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at Socket.socketOnEnd (_http_client.js:288:9)
    at emitNone (events.js:72:20)
    at Socket.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:905:12)
    at doNTCallback2 (node.js:441:9)
    at process._tickCallback (node.js:355:17)

I just run this code:

var Horseman = require('node-horseman');
var horseman = new Horseman();
horseman
    .userAgent("Mozilla/5.2 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0")
    .on('resourceRequested', function (requestData, networkRequest) {
        if(!/[png|jpg|js|css]$/.test(requestData.url)){
            console.log(requestData.url);
        }
    })
    .open('http://www.zhuyingda.com')
    .log() // prints out the number of results
    .close();

I am sure that my network is fine and I can connect this website in my browser. If I open charles or other vpn program, the problem would be fixed. I wanna know why?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:27 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ultratoastcommented, Mar 14, 2016

So after trying all the fixes listed above and testing several horseman functions I’ve been able to resolve this issue by removing all calls to horseman.close() from my code. Not sure what the implications of doing this would be if my app was running for a long time (memory leaks, etc).

Hopefully this helps shed some light on what’s happening here.

0reactions
andrerpenacommented, Aug 28, 2016

I was having the exact problem since 11:00h. It is 17:00h now my time. It turns out @ultratoast was right and saved my day. I just removed all calls to close() and it suddenly worked. What I’m doing now is that I’m sharing a single Horseman instance and closing it at the end.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pa11y example failing due to Phantom process died error #237
Phantom Process died. Because of this, I am not able to implement pa11y. Checked the previous issues but wasnt able to find a...
Read more >
Phantom Process Killing In Android 12 Is Breaking Apps ...
The app or phantom processes may also be killed if they use excessive CPU, which was done previously too, but only for app...
Read more >
Android 12 Is Killing Phantom Background Processes Of Apps
The app or phantom processes may also be killed if they use excessive CPU, which was done previously too, but only for app...
Read more >
phantom process died when I use node ... - Stack Overflow
No information is available for this page.
Read more >
Phantom process killing - Server Fault
I have a java application running on a CentOS 5.4 server. Randomly, and seemingly without cause, these processes will die, not through the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found