symfony / panther

A browser testing and web crawling library for PHP and Symfony
MIT License
2.93k stars 220 forks source link

Could not connect to chrome after 5 seconds #200

Open weeger opened 5 years ago

weeger commented 5 years ago

Hi,

Maybe my question is stupid as I'm just getting started with panther. When I create any client I have this error :

RuntimeException: Could not connect to chrome after 5 seconds (Status code: 406).

I run panther in a Docker image, I installed chromium-bsu in place of chromium.

Many thanks,

doug7410 commented 5 years ago

I'm having the same issue. I'm running Ubuntu 18:04 in a Docker container

rimoi commented 5 years ago

Same issue, Ubuntu 18.04 and Symfony 4.3

Edit but I have the status code 404 and not 406 RuntimeException: Could not connect to chrome after 5 seconds (Status code: 404).

dunglas commented 5 years ago

Could you please try if downgrading to 0.3.0 fixes the issue? @lyrixx do you think it can be related to the migration to HttpClient?

lyrixx commented 5 years ago

It occurs when chrome crash...

landreaubis commented 5 years ago

I had the same problem. I'm increasing my timeout to 30sec in method waitUntilReady in file WebServerReadinessProbeTrait.php

My result is OK with this value : Time: 26.09 seconds, Memory: 42.00MB

lyrixx commented 5 years ago

Ouch. This is very slow ! We may add a parameter for this

yceruto commented 5 years ago

I don't know what is causing this, but I solved it replacing the default homepage https://127.0.0.1:8000/ 404 by an empty page (status code 200).

Note: I'm not testing the homepage though.

lyrixx commented 5 years ago

@yceruto I don't get it. on :8000 this is your application right ? Here we are talking about chrome dial, it's on another port.

yceruto commented 5 years ago

@lyrixx sure, that's just an example, I meant the root route path / configured as default homepage 404

yceruto commented 5 years ago
/**
 * @Route("/", name="app_home")
 */
public function home(): Response
{
    return new Response('OK');
}
"http://127.0.0.1:9080"
"OK"
"http://127.0.0.1:9515/status"
"{"sessionId":"","status":0,"value":{"build":{"version":"alpha"},"os":{"arch":"x86_64","name":"Linux","version":"4.15.0-52-generic"}}}"

If I remove the route / or don't return a status code 200, it crash.

"http://127.0.0.1:9080"
RuntimeException : Could not connect to chrome after 5 seconds (Status code: 404).
lyrixx commented 5 years ago

Ok, I got it. It comes from panther is used when using the "buildin web server". I never us that. That's why it fixes your issue. and that's why I added https://github.com/symfony/panther/pull/181#discussion_r275900631

raquinos commented 5 years ago

I don't know what is causing this, but I solved it replacing the default homepage https://127.0.0.1:8000/ 404 by an empty page (status code 200).

Note: I'm not testing the homepage though.

Same here. Created an "/" empty page and it worked, even if I'm not a accessing that route at all!

I also noted that when specifying external_base_uri parameter everything works fine, no need to create an empty "/" page (PHP web server issue??).

Note: I'm using Panther within Symfony PHPUnit bridge tests, on a machine running Windows 10 x64 and PHP 7.2.2

rvanlaak commented 4 years ago

I run panther in a Docker image, I installed chromium-bsu in place of chromium.

Interesting @weeger !

Chromium is a top down fast paced high action scrolling space shooter.

https://packages.debian.org/sid/chromium-bsu