aerokube / ggr

A lightweight load balancer used to create big Selenium clusters
https://aerokube.com/ggr/latest/
Apache License 2.0
314 stars 74 forks source link

GGR interrupts the session if there are extensions in capabilities #255

Open azapevalov opened 5 years ago

azapevalov commented 5 years ago

preconditions: java, selenium, desireCapabilities with extensions

when I create session through RemoteWebDriver, I get error:

org.openqa.selenium.WebDriverException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

there is nothing in grr logs

problem is not observed for guest quota, only auth connection

kevinwee0712 commented 5 years ago

Encounter exactly the same issue, without ggr, selenoid grid itself works fine.

Sample code:

        //Create capabilities
        Map<String, Object> capabilities = new HashMap<>();

        //Create chrome options and add extension
        ChromeOptions chromeOptions = new ChromeOptions();
         final File tempFile = File.createTempFile("extension", ".crx");
         tempFile.deleteOnExit();
         FileOutputStream out = new FileOutputStream(tempFile);
         IOUtils.copy(this.getClass().getClassLoader().getResourceAsStream("extension.crx"), out);
         chromeOptions.addExtensions(tempFile);

        capabilities.put(ChromeOptions.CAPABILITY, chromeOptions);

        //Add capabilities to desired capability
        new DesiredCapabilities(capabilities)
        new RemoteWebDriver("http://test:test@ggr:4445/wd/hub/", capabilities);

Exception we met: 1) Error in custom provider, org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

vania-pooh commented 5 years ago

@azapevalov Ggr proxies all requests and interrupts the request if requested browser is not found. Authentication is always extracted from respective HTTP header. So don't get the issue.

azapevalov commented 5 years ago

I can not understand where browsers. There is a clear relationship between the presence or absence of authentication in GGR for the same quota file and the entire system outside the GGR(selenoid with browsers.json)

vania-pooh commented 5 years ago

@azapevalov need HTTP traffic between Ggr and test then.

abhitrivedi2006 commented 4 years ago

@azapevalov were you able to conclude this issue ?

azapevalov commented 4 years ago

yes and no. i use guest quota. cheap and dirty workaround but works

Solyankin commented 4 years ago

The issue is reproduced for me with preconditions from @kevinwee0712

kevinwee0712 commented 4 years ago

The issue is reproduced for me with preconditions from @kevinwee0712

Try to use -guests-allowed to bypass it and then your addon could work again. Also try to login as guest, like http://ggr_host:4445/wd/hub. Don't use http://user_name@ggr_host:4445/wd/hub.

Following is my ggr service part in docker compose file. ggr: restart: always image: aerokube/ggr:1.6.6 network_mode: bridge links: