## System
* Version: 0.19.1
* Platform: Windows 10
* Firefox: 57.0
* Seleniu…m: 3.7.1 (Java)
## Testcase
1. Set up Selenium hub + node
2. Prepare Firefox profile on the node (optionally install an extension)
3. Create a browser on the grid with passing in the args to load the profile from local file system:
```
FirefoxOptions fo = new FirefoxOptions();
fo.addArguments("-profile", "./firefoxprofile");
DesiredCapabilities c = DesiredCapabilities.firefox();
c.setCapability(FirefoxOptions.FIREFOX_OPTIONS, fo);
RemoteWebDriver wd = new RemoteWebDriver(hubUrl, c);
```
### Expected result
1. Browser opened
2. Profile is loaded from the node's local file system
3. Session is created
4. Browser can be interacted with using the RemoteWebDriver object from the tests
### Actual result
1. Browser opened
2. Profile is loaded from the node's local file system
3. RemoteWebDriver.createSession() never returns, session is not created
### Notes
- The Firefox profile was created on the same node, with the same version of Firefox
- There is only one extension installed, but I tried it without that, same result
- Starting Firefox through selenium grid works as expected without `fo.addArguments("-profile", "./firefoxprofile");`
- Firefox does not hang when started, it can be interacted with manually.
- Launching Firefox with `firefox.exe -profile "path/to/profile"` also works.
## Stacktrace
```
10:50:23.300 INFO - Got a request to create a new session: Capabilities {acceptInsecureCerts: true, androidServerPort: 7100, appInstall: true, browserName: firefox, moz:firefoxOptions: {args: [-profile, ./firefoxprofile], log: {level: trace}, prefs: {}}, serverPort: 5769, uuid: f39b5203-64ca-4b0f-b4c2-b0c..., version: }
10:50:23.300 INFO - Trying to create a new session on test slot {firefox_binary=C:\Program Files\Mozilla Firefox\firefox.exe, seleniumProtocol=WebDriver, browserName=firefox, maxInstances=1, platform=WIN10}
11:00:23.363 INFO - Error forwarding the new session new session request for webdriver should contain a location header or an 'application/json;charset=UTF-8' response body with the session ID.
org.openqa.grid.common.exception.GridException: new session request for webdriver should contain a location header or an 'application/json;charset=UTF-8' response body with the session ID.
at org.openqa.grid.internal.TestSession.updateHubIfNewWebDriverSession(TestSession.java:426)
at org.openqa.grid.internal.TestSession.forward(TestSession.java:248)
at org.openqa.grid.web.servlet.handler.RequestHandler.forwardNewSessionRequestAndUpdateRegistry(RequestHandler.java:90)
at org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:113)
at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:84)
at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:841)
at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.seleniumhq.jetty9.server.Server.handle(Server.java:564)
at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:317)
at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:110)
at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.seleniumhq.jetty9.util.thread.Invocable.invokePreferred(Invocable.java:128)
at org.seleniumhq.jetty9.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
at java.lang.Thread.run(Unknown Source)
```
## Trace-level log
```
C:\SeleniumGrid>java -Dwebdriver.chrome.driver="./chromedriver.exe" -Dwebdriver.gecko.driver="./geckodriver.exe" -jar selenium-server-standalone.jar -role node -hub http://lpselgrid3001.noclab.local:4444/grid/register/ -nodeConfig nodeconfig.json
10:49:54.363 INFO - Selenium build info: version: '3.7.1', revision: '8a0099a'
10:49:54.363 INFO - Launching a Selenium Grid node
2017-11-15 10:49:55.050:INFO::main: Logging initialized @1133ms to org.seleniumhq.jetty9.util.log.StdErrLog
10:49:55.113 INFO - Driver class not found: com.opera.core.systems.OperaDriver
10:49:55.128 INFO - Driver provider class org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities {browserName: safari, platform: MAC, version: } does not match the current platform WIN10
10:49:55.175 INFO - Using the passthrough mode handler
2017-11-15 10:49:55.206:INFO:osjs.Server:main: jetty-9.4.5.v20170502
2017-11-15 10:49:55.222:WARN:osjs.SecurityHandler:main: ServletContext@o.s.j.s.ServletContextHandler@1c9d8e2{/,null,STARTING} has uncovered http methods for path: /
2017-11-15 10:49:55.238:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@1c9d8e2{/,null,AVAILABLE}
2017-11-15 10:49:55.253:INFO:osjs.AbstractConnector:main: Started ServerConnector@13eba10{HTTP/1.1,[http/1.1]}{0.0.0.0:5555}
2017-11-15 10:49:55.253:INFO:osjs.Server:main: Started @1331ms
10:49:55.253 INFO - Selenium Grid node is up and ready to register to the hub
10:49:55.253 INFO - Starting auto registration thread. Will try to register every 5000 ms.
10:49:55.253 INFO - Registering the node to the hub: http://lpselgrid3001.noclab.local:4444/grid/register
10:49:55.363 INFO - The node is registered to the hub and ready to use
2017-11-15 10:50:23.331:INFO:osjshC.ROOT:qtp25671582-16: org.openqa.selenium.remote.server.WebDriverServlet-691363: Initialising WebDriverServlet
10:50:23.347 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession@b3462b
10:50:23.347 INFO - /session: Executing POST on /session (handler: BeginSession)
10:50:23.425 INFO - Capabilities are: Capabilities {acceptInsecureCerts: true, androidServerPort: 7100, appInstall: true, browserName: firefox, firefox_binary: C:\Program Files\Mozilla Fi..., moz:firefoxOptions: {args: [-profile, ./firefoxprofile], binary: C:\Program Files\Mozilla Fi..., log: {level: trace}, prefs: {}}, serverPort: 5769, uuid: f39b5203-64ca-4b0f-b4c2-b0c..., version: }
10:50:23.441 INFO - Capabilities {acceptInsecureCerts: true, androidServerPort: 7100, appInstall: true, browserName: firefox, firefox_binary: C:\Program Files\Mozilla Fi..., moz:firefoxOptions: {args: [-profile, ./firefoxprofile], binary: C:\Program Files\Mozilla Fi..., log: {level: trace}, prefs: {}}, serverPort: 5769, uuid: f39b5203-64ca-4b0f-b4c2-b0c..., version: } matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.firefox.GeckoDriverService)
1510771823519 geckodriver INFO geckodriver 0.19.1
1510771823519 geckodriver INFO Listening on 127.0.0.1:35467
1510771824050 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "./firefoxprofile"
1510771826113 geckodriver::marionette TRACE connection attempt 0/600
1510771828253 geckodriver::marionette TRACE connection attempt 1/600
1510771830410 geckodriver::marionette TRACE connection attempt 2/600
1510771832550 geckodriver::marionette TRACE connection attempt 3/600
[...]
```