Webjob - 尝试打开chromedriver.exe时超时 [英] Webjob - Timeout when trying to open chromedriver.exe

查看:133
本文介绍了Webjob - 尝试打开chromedriver.exe时超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显然找到了文件,但是在超时之前它一直在徘徊。


有人知道如何解决这个问题吗?
b $ b我正在使用C#Selenium WebDriver。


日志:

===


[02/10/2019 12:27:51 > 7f9c27:SYS INFO]状态已更改为正在初始化

[02/10/2019 12:27:51> 7f9c27:SYS INFO]检测到作业目录更改:作业文件'Ololu_WebJob.exe'时间戳在源目录和工作目录之间不同。

[02/10/2019 12:27:53> 7f9c27:SYS INFO]使用脚本主机运行脚本'chromedriver.exe' - 'WindowsScriptHost'

[02/10/2019 12:27:53> 7f9c27:SYS INFO]状态变为运行

[02/10/2019 12:27:53> 7f9c27:INFO]在端口9515上启动ChromeDriver 2.46.628402(536cd7adbad73a3783fdc2cab92ab2ba7ec361e1)

[02/10/2019 12:27:53> 7f9c27:INFO]仅允许本地连接。

[02/10/2019 12:27:53> 7f9c27:INFO]请保护ChromeDriver和相关测试框架使用的端口,以防止恶意代码访问。

[02/10/2019 12:31:55> 7f9c27:ERR]命令'cmd / c"" chromedriv ...'由于121秒没有输出或CPU活动而中止。如果需要,您可以增加SCM_COMMAND_IDLE_TIMEOUT应用程序设置(如果这是WebJob,则增加WEBJOBS_IDLE_TIMEOUT)。

cmd / c"" chromedriver.exe""

[02 / 10/2019 12:31:55> 7f9c27:SYS INFO]状态已更改为失败

[02/10/2019 12:31:55> 7f9c27:SYS ERR] System.AggregateException:发生一个或多个错误。 ---> Kudu.Core.Infrastructure.CommandLineException:命令'cmd / c"" chromedriv ...'由于121秒没有输出或CPU活动而中止。
如果需要,您可以增加SCM_COMMAND_IDLE_TIMEOUT应用程序设置(如果这是WebJob,则增加WEBJOBS_IDLE_TIMEOUT)。

cmd / c"" chromedriver.exe""

   在C:\ Kudu中的Kudu.Core.Infrastructure.IdleManager.WaitForExit(IProcess进程)文件\ Private \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ />
  &NBSP;在Kudu.Core.Infrastructure.ProcessExtensions<开始> d__12.MoveNext()在C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\ProcessExtensions.cs:第212行$
---从抛出异常的先前位置开始的堆栈追踪结束---

    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   在Kudu.Core.Infrastructure.Executable。< ExecuteAsync> d__31.MoveNext()在C:\Kudu Files \Private\src\master\Kudu.Core \Infrastructure \Executable.cs:第255行¥b $ b    ---内部异常堆栈跟踪结束---

    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)

    at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)

    at System.Threading.Tasks.Task`1.get_Result()

  &NBSP;在Kudu.Core.Infrastructure.Executable.ExecuteInternal(的ITracer示踪剂,Func`2 onWriteOutput,Func`2 onWriteError,编码方式进行编码,字符串参数,对象[]参数)在C:\Kudu Files\Private\src \ master\Kudu.Core \Intructrastructure \Executable.cs:line
216

  &NBSP;在Kudu.Core.Infrastructure.Executable.ExecuteReturnExitCode(的ITracer示踪剂,Action`1 onWriteOutput,Action`1 onWriteError,字符串参数,对象[]参数)在C:\Kudu Files\Private\src\master \ Kudu.Core \Infrastructure \Executable.cs:第165行¥b $ b  &NBSP;在Kudu.Core.Jobs.BaseJobRunner.RunJobInstance(JobBase作业,IJobLogger记录器,字符串的runid,字符串触发,的ITracer示踪剂的Int32端口)在C:\Kudu Files\Private\src\master\Kudu .Core\Jobs\BaseJobRunner.cs:第272行$
---> (内部异常#0)ExitCode:-1,输出:命令'cmd / c"" chromedriv ...'由于121秒没有输出或CPU活动而中止。您可以增加SCM_COMMAND_IDLE_TIMEOUT应用程序设置(如果这是WebJob,则为WEBJOBS_IDLE_TIMEOUT)
如果需要。错误:命令'cmd / c"" chromedriv ...'由于没有输出或CPU活动而中止121秒您可以增加SCM_COMMAND_IDLE_TIMEOUT应用程序设置(或WEBJOBS_IDLE_TIMEOUT如果这是一个WebJob)如果需要的话,Kudu.Core.Infrastructure.CommandLineException:
命令 'CMD / C"" chromedriv ......' 是由于中止121秒无输出或CPU活动。如果需要,您可以增加SCM_COMMAND_IDLE_TIMEOUT应用程序设置(如果这是WebJob,则增加WEBJOBS_IDLE_TIMEOUT)。

cmd / c"" chromedriver.exe""

   在C:\ Kudu中的Kudu.Core.Infrastructure.IdleManager.WaitForExit(IProcess进程)文件\ Private \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ />
   在Kudu.Core.Infrastructure.ProcessExtensions。<开始> d__12.MoveNext()在C:\ Kudu Files \Private\src\master\Kudu.Core \Infrastructure \ProcessExtensions.cs:第212行$
---从抛出异常的先前位置开始的堆栈追踪结束---

    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   在Kudu.Core.Infrastructure.Executable。< ExecuteAsync> d__31.MoveNext()在C:\Kudu Files \Private\src\master\Kudu.Core \Infrastructure \Executable.cs:第255行< ---

解决方案

所有Azure Web应用程序(以及移动应用程序/服务,WebJobs和函数)运行在称为
的安全环境中
sandbox
每个应用程序都在我的内部运行ts拥有沙盒,将其执行与同一台机器上的其他实例隔离,并提供额外的安全性和隐私,否则将无法使用。



请参阅  GitHub
wiki   for
a目前已知无效的事项列表,其他不受支持的场景 -
PhantomJS / Selenium:尝试连接到本地地址,也使用GDI +。


此外,
默认情况下,WebApps在空闲一段时间后会被卸载。这样,系统可以节省资源。您可以启用Always On。


  1. 从Azure门户,转到您的WebApp。
  2. 选择  应用程序设置
  3. 对于  始终开启 ,请选择  开启


< p style ="margin-bottom:12.0pt; background:white"> 默认情况下,当你的构建过程启动一些命令时,它允许运行最多60秒而不产生任何输出。
如果这不够长,你可以使它更长,例如到让它10分钟:


SCM_COMMAND_IDLE_TIMEOUT = 600


请注意,在Azure上,有一个常规的空闲请求超时,会导致客户端在230秒后断开连接。但是,
命令在此之后仍将继续运行服务器端。


WEBJOBS_IDLE_TIMEOUT   - 以秒为单位的时间我们将
中止正在运行的触发作业进程,如果它处于空闲状态,没有CPU时间或输出(仅适用于已触发的作业)。
< /跨度>


Apperently the file was found, but it stays wainting until timeout.

Does anybody knows how to solve this?
I'm useing C# Selenium WebDriver.

Log:
===

[02/10/2019 12:27:51 > 7f9c27: SYS INFO] Status changed to Initializing
[02/10/2019 12:27:51 > 7f9c27: SYS INFO] Job directory change detected: Job file 'Ololu_WebJob.exe' timestamp differs between source and working directories.
[02/10/2019 12:27:53 > 7f9c27: SYS INFO] Run script 'chromedriver.exe' with script host - 'WindowsScriptHost'
[02/10/2019 12:27:53 > 7f9c27: SYS INFO] Status changed to Running
[02/10/2019 12:27:53 > 7f9c27: INFO] Starting ChromeDriver 2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1) on port 9515
[02/10/2019 12:27:53 > 7f9c27: INFO] Only local connections are allowed.
[02/10/2019 12:27:53 > 7f9c27: INFO] Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[02/10/2019 12:31:55 > 7f9c27: ERR ] Command 'cmd /c ""chromedriv ...' was aborted due to no output nor CPU activity for 121 seconds. You can increase the SCM_COMMAND_IDLE_TIMEOUT app setting (or WEBJOBS_IDLE_TIMEOUT if this is a WebJob) if needed.
cmd /c ""chromedriver.exe""
[02/10/2019 12:31:55 > 7f9c27: SYS INFO] Status changed to Failed
[02/10/2019 12:31:55 > 7f9c27: SYS ERR ] System.AggregateException: One or more errors occurred. ---> Kudu.Core.Infrastructure.CommandLineException: Command 'cmd /c ""chromedriv ...' was aborted due to no output nor CPU activity for 121 seconds. You can increase the SCM_COMMAND_IDLE_TIMEOUT app setting (or WEBJOBS_IDLE_TIMEOUT if this is a WebJob) if needed.
cmd /c ""chromedriver.exe""
   at Kudu.Core.Infrastructure.IdleManager.WaitForExit(IProcess process) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\IdleManager.cs:line 45
   at Kudu.Core.Infrastructure.ProcessExtensions.<Start>d__12.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\ProcessExtensions.cs:line 212
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Kudu.Core.Infrastructure.Executable.<ExecuteAsync>d__31.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\Executable.cs:line 255
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Kudu.Core.Infrastructure.Executable.ExecuteInternal(ITracer tracer, Func`2 onWriteOutput, Func`2 onWriteError, Encoding encoding, String arguments, Object[] args) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\Executable.cs:line 216
   at Kudu.Core.Infrastructure.Executable.ExecuteReturnExitCode(ITracer tracer, Action`1 onWriteOutput, Action`1 onWriteError, String arguments, Object[] args) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\Executable.cs:line 165
   at Kudu.Core.Jobs.BaseJobRunner.RunJobInstance(JobBase job, IJobLogger logger, String runId, String trigger, ITracer tracer, Int32 port) in C:\Kudu Files\Private\src\master\Kudu.Core\Jobs\BaseJobRunner.cs:line 272
---> (Inner Exception #0) ExitCode: -1, Output: Command 'cmd /c ""chromedriv ...' was aborted due to no output nor CPU activity for 121 seconds. You can increase the SCM_COMMAND_IDLE_TIMEOUT app setting (or WEBJOBS_IDLE_TIMEOUT if this is a WebJob) if needed., Error: Command 'cmd /c ""chromedriv ...' was aborted due to no output nor CPU activity for 121 seconds. You can increase the SCM_COMMAND_IDLE_TIMEOUT app setting (or WEBJOBS_IDLE_TIMEOUT if this is a WebJob) if needed., Kudu.Core.Infrastructure.CommandLineException: Command 'cmd /c ""chromedriv ...' was aborted due to no output nor CPU activity for 121 seconds. You can increase the SCM_COMMAND_IDLE_TIMEOUT app setting (or WEBJOBS_IDLE_TIMEOUT if this is a WebJob) if needed.
cmd /c ""chromedriver.exe""
   at Kudu.Core.Infrastructure.IdleManager.WaitForExit(IProcess process) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\IdleManager.cs:line 45
   at Kudu.Core.Infrastructure.ProcessExtensions.<Start>d__12.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\ProcessExtensions.cs:line 212
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Kudu.Core.Infrastructure.Executable.<ExecuteAsync>d__31.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\Executable.cs:line 255<---

解决方案

All Azure Web Apps (as well as Mobile App/Services, WebJobs and Functions) run in a secure environment called a sandbox. Each app runs inside its own sandbox, isolating its execution from other instances on the same machine as well as providing an additional degree of security and privacy which would otherwise not be available.

Kindly see the GitHub wiki for a list of things that are known to not work currently, other scenarios that are unsupported - PhantomJS/Selenium: tries to connect to local address, and also uses GDI+.

Additionally, by default, WebApps are unloaded if they are idle for a set period of time. This way, the system can conserve resources. You can enable Always On.

  1. From the Azure portal, go to your WebApp.
  2. Select Application settings.
  3. For Always On, select On.

By default, when your build process launches some command, it's allowed to run for up to 60 seconds without producing any output. If that is not long enough, you can make it longer, e.g. to make it 10 minutes:

SCM_COMMAND_IDLE_TIMEOUT=600

Note that on Azure, there is a general idle request timeout that will cause clients to get disconnected after 230 seconds. However, the command will still continue running server-side after that.

WEBJOBS_IDLE_TIMEOUT - Time in seconds after which we'll abort a running triggered job's process if it's in idle, has no CPU time or output (Only for triggered jobs).


这篇关于Webjob - 尝试打开chromedriver.exe时超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆