Closed mr-wong closed 4 years ago
Aren't you awaiting the tasks returned by Navigate
?
Aren't you awaiting the tasks returned by
Navigate
?
Yes I wait using page.GoToAsync(...).GetAwaiter().GetResult(); so all the pages navigated one by one. It can happen at the very first GoToAsync call or after hundred calls. I tried both the latest Chromium version and the version offered by the downloader with the same result. Also tried to downgrade Puppeteer with no luck.
Failing example there in #1450, but I can't progress further than that.
Reduced the iteration size a bit to speed it up.
Have not seen the second-mentioned error case yet, only the first.
The code is fairly simple:
I always get random exceptions mostly like this one:
PuppeteerSharp.NavigationException: 'Protocol error(Page.navigate): Target closed. (NetworkManager failed to process Network.requestWillBeSent. Frame 53F547F3C375005301129799DB86C5A4 not found. at PuppeteerSharp.Helpers.AsyncDictionaryHelperd4.MoveNext() in D:\Downloads\puppeteer-sharp-master\lib\PuppeteerSharp\Helpers\AsyncDictionaryHelper.cs:line 31
--- 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 System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at PuppeteerSharp.NetworkManager.d 46.MoveNext() in D:\Downloads\puppeteer-sharp-master\lib\PuppeteerSharp\NetworkManager.cs:line 309
--- 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 System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at PuppeteerSharp.NetworkManager.d__49.MoveNext() in D:\Downloads\puppeteer-sharp-master\lib\PuppeteerSharp\NetworkManager.cs:line 385
--- 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 System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at PuppeteerSharp.NetworkManager.d__40.MoveNext() in D:\Downloads\puppeteer-sharp-master\lib\PuppeteerSharp\NetworkManager.cs:line 141)'
2.<>c__DisplayClass4_0.<GetItemAsync>b__0() in D:\Downloads\puppeteer-sharp-master\lib\PuppeteerSharp\Helpers\AsyncDictionaryHelper.cs:line 32 at PuppeteerSharp.Helpers.TaskHelper.<WithTimeout>d__6
1.MoveNext() in D:\Downloads\puppeteer-sharp-master\lib\PuppeteerSharp\Helpers\TaskHelper.cs:line 109 --- 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 System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at PuppeteerSharp.Helpers.AsyncDictionaryHelper
2.Or even like this:
System.InvalidOperationException: 'Collection was modified; enumeration operation may not execute.'
This exception was originally thrown at this call stack: System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource) System.Collections.Generic.List.Enumerator.MoveNextRare()
System.Collections.Generic.List.Enumerator.MoveNext()
PuppeteerSharp.LifecycleWatcher.CheckLifecycle(PuppeteerSharp.Frame, System.Collections.Generic.IEnumerable) in LifecycleWatcher.cs
PuppeteerSharp.LifecycleWatcher.CheckLifecycleComplete() in LifecycleWatcher.cs
PuppeteerSharp.LifecycleWatcher.LifecycleWatcher(PuppeteerSharp.FrameManager, PuppeteerSharp.Frame, PuppeteerSharp.WaitUntilNavigation[], int) in LifecycleWatcher.cs
PuppeteerSharp.FrameManager.NavigateFrameAsync(PuppeteerSharp.Frame, string, PuppeteerSharp.NavigationOptions) in FrameManager.cs
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
...
[Call Stack Truncated]
Chromium version: Version 82.0.4076.0 (Official Build) (32-bit)
How can I solve this issue? :( Thanks.