CreatePlatformSocket() 返回错误:提供的参数无效.(0x2726) 尝试通过网络路径访问 chromedriver [英] CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726) when trying to access chromedriver through network path
问题描述
我了解操作系统更新导致此问题不仅适用于 chromedriver,也适用于 geckodriver.
I understand that the OS update caused to this issue not only for the chromedriver but also for the geckodriver.
chromedriver 和 geckodriver 启动时都没有任何问题,更新的工作站在本地运行它们(例如驱动器 C:).当在网络路径中找到这两个时,就会出现问题.
Both chromedriver and geckodriver start without any problem when, the station that was updated, runs them locally (drive C: for instance). The issues arises when these two are found in a network path.
我检查了运行这些驱动程序的特定用户的权限,还检查了 UAC 和防火墙,但它们似乎与问题无关.
I have checked the permissions for the specific user, that runs these drivers, and I also checked the UAC and the Firewall but they don't seem to be related to the issue.
为了维护,我更喜欢从网络路径运行驱动程序.因为,我有几个自动化站,我想集中基础设施.这样我就不需要维护每个站点的基础设施了.
I prefer running the drivers from a network path for the sake of Maintenance. Because, I have several automation stations I want to centralize the infrastructure. This way I don't need to maintain the infrastructure in each one of the stations.
我在没有使用它们的选项的情况下使用默认设置运行这两个驱动程序,我相信也许使用这些选项可以解决问题.
I am running both drivers with their default settings without using their options and I believe that maybe using these options can solve the issue.
有人熟悉这类问题吗?是否有可能通过使用驱动程序的选项,我可以安全地解决这些问题?
Is someone familiar with these kind of issues ? Is it possible that by using the driver's options I can pass these issues safely ?
顺便说一句,我在 Windows 10 Pro 版本上运行:1803 OS build:17134.1
By the way I am running over a Windows 10 Pro Version: 1803 OS build: 17134.1
chromedriver 版本为 2.40.565498 win32geckodriver 是 v0.20.1-win64
The chromedriver is version 2.40.565498 win32 and the geckodriver is v0.20.1-win64
我收到的错误消息是:
chromedriver
[1530079175.164][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
[1530079175.165][INFO]: listen on IPv4 failed with error ERR_INVALID_ARGUMENT
[1530079175.166][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
[1530079175.166][INFO]: listen on IPv6 failed with error ERR_INVALID_ARGUMENT
geckodriver
An invalid argument was supplied. (os error 10022)
推荐答案
如你所说:
- ChromeDriver 和 GeckoDriver 在本地(例如
C:
驱动器)执行时都可以正常启动 - 在网络路径中发现 ChromeDriver 和 GeckoDriver 时会出现问题.
- Both ChromeDriver and GeckoDriver starts without any problem when executed locally ( e.g.
C:
drive) - The issues arises when ChromeDriver and GeckoDriver are found in a network path.
从历史上看,根据讨论:
Historically, as per the discussions:
- CreatePlatformSocket() 返回错误:无效提供了参数.(0x2726) 端口不可用.退出……使用 chromedriver 和 Selenium 3.2
- CreatePlatformSocket() 返回错误:无效提供了参数.(0x27t6) 端口不可用.在 Selenium Webdriver 中退出……
观察到 ChromeDriver 和 GeckoDriver 在网络上共享时,在初始化各自的 Browser Clients 时观察到以下错误:
It had been observed that both ChromeDriver and GeckoDriver when shared over the network, while initializing the respective Browser Clients the following errors were observed:
样品 A:
Sample A:
Starting ChromeDriver 2.28.455520 (cc17746adff54984afff480136733114c6b3704b) on port 12121
Only local connections are allowed.
[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
Port not available. Exiting...
Mar 11, 2017 9:13:06 PM org.openqa.selenium.os.UnixProcess checkForError
SEVERE: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
样品 B:
Sample B:
[0.147][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
[0.147][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x27t6)
Port not available. Exiting...
样品 C:
Sample C:
Starting ChromeDriver 2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb) on port 17873
Only local connections are allowed.
[1525873930.811][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
[1525873930.816][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
Port not available. Exiting...
May 09, 2018 7:22:30 PM org.openqa.selenium.os.UnixProcess checkForError
SEVERE: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
Exception in thread "main" 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.
甚至:
And even:
//chromedriver
[1530079175.164][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
[1530079175.165][INFO]: listen on IPv4 failed with error ERR_INVALID_ARGUMENT
//geckodriver
An invalid argument was supplied. (os error 10022)
//IEDriverServer
Failed to start the server with: port = '2305', host = '', log level = '', log file = '', whitelisted ips = ''
因此,一个通用的解决方案是通过将 ChromeDriver 和 GeckoDriver 放入主机的本地驱动器来访问它们.
So a generalized solution would be to access ChromeDriver and GeckoDriver by putting them into the local drives of the host machine.
这篇关于CreatePlatformSocket() 返回错误:提供的参数无效.(0x2726) 尝试通过网络路径访问 chromedriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!