-
Notifications
You must be signed in to change notification settings - Fork 131
PhantomJS failed 2 times (timeout). Giving up. #84
Comments
Same issue here... Node: 4.2.2 This is how we run it karma start "web/js2/test/karma.conf.js" --no-colors --single-run --log-level info --reporters dots
19 11 2015 15:22:07.682:INFO [karma]: Karma v0.13.15 server started at http://localhost:9877/
19 11 2015 15:22:07.695:INFO [launcher]: Starting browser PhantomJS
19 11 2015 15:22:27.706:WARN [launcher]: PhantomJS have not captured in 20000 ms, killing.
19 11 2015 15:22:27.722:INFO [launcher]: Trying to start PhantomJS again (1/2).
19 11 2015 15:22:47.729:WARN [launcher]: PhantomJS have not captured in 20000 ms, killing.
19 11 2015 15:22:47.739:INFO [launcher]: Trying to start PhantomJS again (2/2).
19 11 2015 15:23:07.743:WARN [launcher]: PhantomJS have not captured in 20000 ms, killing.
19 11 2015 15:23:07.749:ERROR [launcher]: PhantomJS failed 2 times (timeout). Giving up. Also tried with longer timeouts of 2 minutes, but it just doesn't work. Running phantomjs manually like this seems to work since it just gives me the node_modules/phantomjs/bin/phantomjs
phantomjs> Also reported the issue over here karma-runner/karma#558 (comment) |
I figured out that we still had config in place which doesn't work in karma 0.13. In karma 0.8 we have been using I have changed that to |
I upgraded from 0.1.4 to 0.2.1, and PhantomJS is failing to launch. Reverting for now. |
Check to be sure something like xampp or another local web server isn't running on the same port. |
Hello guys, I had the same problem today and I did some extensive debugging and testing of the karma and karma-phantomjs-launcher packages. The issue here was actually in my /etc/hosts file which I edited earlier today. I seem to have removed the "localhost" entry, and Karma by default tries to listen on http://localhost:9876/ and waits for PhantomJS to open the page which seems to fail without a meaningful error if localhost could not be resolved. If you have the same issue as mine you have two options:
Lots of pseudo-bugs could be escaped if karma had "127.0.0.1" as the default IP it's listening instead of "localhost" by the way :) |
@zewish this fixed the issue for me - I added
Node version: v4.2.2 No errors were output that indicated that this was the issue. |
I had to change the port to resolve this issue. Odd because the browser runners were still working and were using the same port. |
I had the same issue For some reason my hosts file was deleted, after restoring a basic hosts file to /private/etc/hosts things started working again. |
I am seeing this same problem on Windows even when the HOSTS file contains localhost. We're trying to get things working in a CI environment - Specifically Visual Studio Team Services. Environment details: Node: 0.12.7 (64-bit) Karma is starting on http://localhost:9876/ which appears to be free. This repros with 1.0.0 and ^0.2 of karma-phantomjs-launcher but not ~0.1 Edit: ~0.1 works not ^0.1 obviously. |
Adding |
@zewish thanks for that post. After hours of searching for info this fixed the issue for me as well. |
FYI, |
I'm having the same problem as this, but none of the suggested items here of messing with node v6.2.2
Edit: Forgot to mention this, but launchers like Chrome, Safari and such work fine. Additionally, PhantomJS actually works fine when used by other methods such as just running Mocha separately or through a different runner such as testem. |
Seeing the same thing as @jwang. Works fine in the latest versions of Node 4 and 5 |
Had the same issue. Tried hostname: '127.0.0.1' with mapping 127.0.0.1 to localhost in hosts file. Ended up with changing the port: 9876 to port: 19876. After checking ports in use (with netstat -a under Windows) it was indeed already taken |
Had the same issue. When I stopped my Golang Web server, problem disappeared. |
This is happening for me as well on Shippable Ci. Any ideas? |
I was having the same issue after upgrading to macos sierra. Upgrading to the latest karma-phantomjs-launcher (and so phantomjs) fixed the issue. Was using: Upgraded to: |
Will test updates on my end to confirm! Thanks! |
I'm seeing the same problem. The configuration works fine on MacOS 10.11.6 (El Capitan), with Node v6.0.0 / npm 3.8.6, but on a TeamCity 9.1.6 agent running Windows with Node v4.2.2 / npm 2.14.7, it fails miserably with an error of Here's an example stacktrace on TeamCity:
Here's a snippet of package.json:
And here's a snippet of karma.conf.js:
|
@andrewphahn thanks! |
Issue solved! In our CI environment, we aren't getting the node modules by running Zipping it on a Mac and exploding it on Windows and attempting to use those modules, especially I zipped it from Windows instead and it worked perfectly. |
@andrewphahn Yes, I updated karma-phantomjs-launcher (1.0.2), and it works fine now. Thanks! |
I had this issue due to me having an instance of HttpDebugger open. Not a common issue, but adding here in case others with a similar setup experience the problem. |
same issue with "karma-phantomjs-launcher": "1.0.2" 21 02 2017 14:54:51.066:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency |
Is there any way to set it up so that karma checks if something is running on the specified port before launching and then tries to find another open port? |
Same problems here: node: Chrome runs fine, but Firefox and Safari both get timeout messages until the tests abort:
|
[ @silverbucket ] I have almost same versions as you have: node:
If I downgrade to karma |
I've just updated karma-phantomjs-launcher in my devDependencies and it worked... "devDependencies": { |
For me this is working or running "karma": "1.3.0",
"karma-phantomjs-launcher": "^1.0.4", |
I fixed this by fixing karma version at 1.3.0 There must be a bug in 1.5.0, which it was using before. @SRferrero I've added the issue at karma-runner/karma#2647 - feel free to add more info. |
For me it was an older version of karma while running a newer version of nodejs -- socket.io was using a deprecated way to get EventEmitter, and instead of crashing it was just hanging trying to establish the connection to phantomjs I guess. Solution was to downgrade node to <v6 (easier than upgrading all our packages in our relatively maintenance mode project) |
Have the same issue. I don't know what went wrong, as of yesterday it was working fine. But this morning when I opened my laptop to continue writing tests, the browser was not starting. I didn't think of it much, but added |
PhantomJS does this for me. Removing all |
I solved this problem. Link: #126 |
@bkotrys - issue #126 has 10^32934 variations and solution attempts ... you could be more specific. but thanks anyway, I stumbled upon a solution in a comment on that issue: folks, if you're running this in a docker container, don't use an Alpine image. for details, see issue comments: |
It works by deleting the node_modules and installed it again 👍 |
karma-runner/karma-phantomjs-launcher#84 (comment) If localhost is removed from /etc/hosts phantomjs won't start
Easy solve. I had a service that was already bound to the port. So I modified the port in my karma.conf.js and it worked. |
To help others who want to add the IP to source control without an extra package for .env, add |
PhantomJS is not starting for some reason:
nodejs: 0.12.0
phantomjs: 1.9.8
The text was updated successfully, but these errors were encountered: