Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Problem/Bug]: "The group or resource is not in the correct state to perform the requested operation" when launching multiple instances #4731

Closed
SkipperRobbins opened this issue Aug 7, 2024 · 4 comments
Assignees
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@SkipperRobbins
Copy link

SkipperRobbins commented Aug 7, 2024

What happened?

On Windows Server OS (2016 and 2022 so far), when launching multiple instances of our app users occasionally see the following error:

image

I reviewed the following threads where this same error was reported, but I don't believe the situations described apply. For the first, our control appears to be initialized on the UI thread. For the latter, users run into this launching multiple instances of the same version of the app, not different versions, so the environment options should be the same.

#349
#4593

I created the following lightweight project to simulate this behavior.
CrashDemo.zip

It's common for users to launch multiple instances of our app on Windows Server through virtualization platforms. We have been unable to reproduce this on Windows Desktop OS. I have crash dmps if those would be helpful.

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x8007139F): The group or resource is not in the correct state to perform the requested operation. (0x8007139F)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateCoreWebView2ControllerAsync(IntPtr ParentWindow, CoreWebView2ControllerOptions options)
   at Microsoft.Web.WebView2.WinForms.WebView2.InitCoreWebView2Async(CoreWebView2Environment environment, CoreWebView2ControllerOptions controllerOptions)
   at CrashDemo.Form1.MainForm_Load(Object sender, EventArgs e) in C:\CrashDemo\Form1.cs:line 35
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

126.0.2592.113

SDK Version

1.0.2592.51

Framework

Winforms

Operating System

Windows Server

OS Version

2016, 2022

Repro steps

Package the attached demo app. On Windows Server OS (was able to reproduce on both 2016 and 2022) launch multiple instances of the executable concurrently. Occasionally, one of the launched instances will crash in the call to EnsureCoreWebView2Async().

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Don't know

Last working version (if regression)

No response

AB#53110943

@SkipperRobbins SkipperRobbins added the bug Something isn't working label Aug 7, 2024
Copy link

github-actions bot commented Aug 7, 2024

Hi, @SkipperRobbins!

It seems that your issue contains the word "crash". If you have not already, could you attach a crash dump as a comment?

WV2 crash dumps are located in a subfolder of the app's user data folder (UDF): <UDF>\EBWebView\Crashpad\reports\. By default, the user data folder is created in the app's folder with a name like <App Exe Name>.exe.WebView2. Refer to Crash Diagnostics for more information.

Thank you for your cooperation!

@SkipperRobbins
Copy link
Author

Unfortunately, there were no crash dumps in the <UDF>\EBWebView\Crashpad\reports\ directory. I generated dumps of the CrashDemo and msedgewebview2 processes through task manager while the dialog was up, if that would be helpful. Though, looking at the stack it seems the exception code is gone.

@LiangTheDev LiangTheDev added the tracked We are tracking this work internally. label Aug 9, 2024
@LiangTheDev
Copy link
Member

Thanks for reporting the bug, and I can repro it. We will investigate and report back.

@LiangTheDev
Copy link
Member

The issue has been fixed in Edge WebView2 Runtime version >= 129.0.2779.0. Edge 129 is scheduled to be released in Week of 19-Sep-2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

3 participants