{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/geckodriver/issues/1408","repository_url":"https://api.github.com/repos/mozilla/geckodriver","labels_url":"https://api.github.com/repos/mozilla/geckodriver/issues/1408/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/geckodriver/issues/1408/comments","events_url":"https://api.github.com/repos/mozilla/geckodriver/issues/1408/events","html_url":"https://github.com/mozilla/geckodriver/issues/1408","id":373919899,"node_id":"MDU6SXNzdWUzNzM5MTk4OTk=","number":1408,"title":" WebDriver permission denied with geckodriver","user":{"login":"barcmoehm","id":26359410,"node_id":"MDQ6VXNlcjI2MzU5NDEw","avatar_url":"https://avatars1.githubusercontent.com/u/26359410?v=4","gravatar_id":"","url":"https://api.github.com/users/barcmoehm","html_url":"https://github.com/barcmoehm","followers_url":"https://api.github.com/users/barcmoehm/followers","following_url":"https://api.github.com/users/barcmoehm/following{/other_user}","gists_url":"https://api.github.com/users/barcmoehm/gists{/gist_id}","starred_url":"https://api.github.com/users/barcmoehm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barcmoehm/subscriptions","organizations_url":"https://api.github.com/users/barcmoehm/orgs","repos_url":"https://api.github.com/users/barcmoehm/repos","events_url":"https://api.github.com/users/barcmoehm/events{/privacy}","received_events_url":"https://api.github.com/users/barcmoehm/received_events","type":"User","site_admin":false},"labels":[{"id":490262122,"node_id":"MDU6TGFiZWw0OTAyNjIxMjI=","url":"https://api.github.com/repos/mozilla/geckodriver/labels/waiting%20for%20reporter%20feedback","name":"waiting for reporter feedback","color":"dedede","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-25T12:21:56Z","updated_at":"2018-10-29T13:52:36Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\nI currently face problems when trying to run my tests in headless mode. The test suite stops execution and I do get a WebDriverException with message 'permission denied'. \r\n\r\nWhen googling this issue, I found that this used to be a problem with firefox security settings. This is why I included the profile for firefox. I also thought that it could have to do with insufficient permissions on the driver executable but I verified that the geckodriver.exe can be executed from within java.\r\n\r\nRunning headless mode in chrome does work, and running the tests in a non-headless firefox it works too. \r\n\r\n## System\r\n\r\n* Version: 0.23.0\r\n* Platform: Windows 10\r\n* Firefox: 63 + Nightly\r\n* Selenium: 3.14.0\r\n\r\n\r\n## Testcase\r\n(Note: I did assume that if there was something wrong with my test cases, the exception would occur in them and not when creating a new WebDriver instance)\r\n```\r\nFirefoxOptions options = new FirefoxOptions();\r\noptions.setProfile(createFirefoxProfile());\r\noptions.setHeadless(true);\r\noptions.addArguments(\"-silent\");\r\noptions.setLogLevel(FirefoxDriverLogLevel.TRACE);\r\nreturn new FirefoxDriver(options); <<< Exception\r\n\r\n  private FirefoxProfile createFirefoxProfile() {\r\n        FirefoxProfile profile = new FirefoxProfile();\r\n        profile.setPreference(\"capability.policy.default.HTMLDocument.readyState\", \"allAccess\");\r\n        profile.setPreference(\"capability.policy.default.HTMLDocument.compatMode\", \"allAccess\");\r\n        profile.setPreference(\"capability.policy.default.Document.compatMode\", \"allAccess\");\r\n        profile.setPreference(\"capability.policy.default.Location.href\", \"allAccess\");\r\n        profile.setPreference(\"capability.policy.default.Window.pageXOffset\", \"allAccess\");\r\n        profile.setPreference(\"capability.policy.default.Window.pageYOffset\", \"allAccess\");\r\n        profile.setPreference(\"capability.policy.default.Window.frameElement\", \"allAccess\");\r\n        profile.setPreference(\"capability.policy.default.Window.frameElement.get\", \"allAccess\");\r\n        profile.setPreference(\"capability.policy.default.Window.QueryInterface\", \"allAccess\");\r\n        profile.setPreference(\"capability.policy.default.Window.mozInnerScreenY\", \"allAccess\");\r\n        profile.setPreference(\"capability.policy.default.Window.mozInnerScreenX\", \"allAccess\");\r\n        return profile;\r\n    }\r\n```\r\n\r\n## Stacktrace\r\n\r\n```\r\norg.openqa.selenium.WebDriverException: permission denied\r\nBuild info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'\r\nSystem info: host: 'ITEM-S71517', ip: '172.16.10.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181'\r\nDriver info: driver.version: FirefoxDriver\r\nremote stacktrace: \r\n\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n\tat java.lang.reflect.Constructor.newInstance(Constructor.java:423)\r\n\tat org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new$0(W3CHandshakeResponse.java:57)\r\n\tat org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction$2(W3CHandshakeResponse.java:104)\r\n\tat org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:122)\r\n\tat java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)\r\n\tat java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)\r\n\tat java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)\r\n\tat java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)\r\n\tat java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)\r\n\tat java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)\r\n\tat java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)\r\n\tat java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\r\n\tat java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)\r\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:125)\r\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)\r\n\tat org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)\r\n\tat org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)\r\n\tat org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)\r\n\tat org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:212)\r\n\tat org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)\r\n\tat org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)\r\n\tat com.project.test.selenium.SeleniumBase.setUp(SeleniumBase.java:184)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)\r\n\tat org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)\r\n\tat org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)\r\n\tat org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)\r\n\tat org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175)\r\n\tat org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107)\r\n\tat org.testng.TestRunner.privateRun(TestRunner.java:767)\r\n\tat org.testng.TestRunner.run(TestRunner.java:617)\r\n\tat org.testng.SuiteRunner.runTest(SuiteRunner.java:334)\r\n\tat org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)\r\n\tat org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)\r\n\tat org.testng.SuiteRunner.run(SuiteRunner.java:240)\r\n\tat org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)\r\n\tat org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)\r\n\tat org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)\r\n\tat org.testng.TestNG.runSuitesLocally(TestNG.java:1123)\r\n\tat org.testng.TestNG.run(TestNG.java:1031)\r\n\tat org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)\r\n\tat org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)\r\n\r\n```\r\n\r\n\r\n## Trace-level log\r\n\r\n[tracelog.txt](https://github.com/mozilla/geckodriver/files/2514696/tracelog.txt)"},"comment":{"url":"https://api.github.com/repos/mozilla/geckodriver/issues/comments/433917550","html_url":"https://github.com/mozilla/geckodriver/issues/1408#issuecomment-433917550","issue_url":"https://api.github.com/repos/mozilla/geckodriver/issues/1408","id":433917550,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzkxNzU1MA==","user":{"login":"whimboo","id":129603,"node_id":"MDQ6VXNlcjEyOTYwMw==","avatar_url":"https://avatars2.githubusercontent.com/u/129603?v=4","gravatar_id":"","url":"https://api.github.com/users/whimboo","html_url":"https://github.com/whimboo","followers_url":"https://api.github.com/users/whimboo/followers","following_url":"https://api.github.com/users/whimboo/following{/other_user}","gists_url":"https://api.github.com/users/whimboo/gists{/gist_id}","starred_url":"https://api.github.com/users/whimboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whimboo/subscriptions","organizations_url":"https://api.github.com/users/whimboo/orgs","repos_url":"https://api.github.com/users/whimboo/repos","events_url":"https://api.github.com/users/whimboo/events{/privacy}","received_events_url":"https://api.github.com/users/whimboo/received_events","type":"User","site_admin":false},"created_at":"2018-10-29T13:52:36Z","updated_at":"2018-10-29T13:52:36Z","author_association":"COLLABORATOR","body":"@barcmoehm that referenced trace log in your last comment is interesting! It shows that Marionette doesn't see the `sessionstore-windows-restored` notification during the startup of Firefox. As such it continues to wait, and it finally fails to create the session.\r\n\r\nNote that we also see this problem in our CI more or less: https://bugzilla.mozilla.org/show_bug.cgi?id=1382162. Sadly we haven't been able yet to constantly reproduce the issue.\r\n\r\nCan you please clearly describe your system setup, and which version of tools you are using (including if those are 32bit or 64bits)? Maybe we can narrow down what might cause it. Thanks!"}}
{"actor":{"display_login":"whimboo"}}