-
Notifications
You must be signed in to change notification settings - Fork 54
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
COMException 0x8007139F in Microsoft.Web.WebView2.WinForms.WebView2.<InitCoreWebView2Async>d__13.MoveNext #3008
Comments
Additional Info: We have one customer that reports getting this exception when they:
Note! according to the customer, the exception is not seen if they follow these same steps using Firefox, MSIE, and Edge to download + open the XLSX file. |
@yunate
|
@yunate I was able to get a the first customer to capture a verbose log from WebView2 by setting: I am looking through this log now, is there anything specific I can search for to get closer to what's causing this COMException? |
Here is the tail end of the customer's log (before the histograms) showing 3 ERRORs (I redacted some information and added blank lines). I know virtually nothing about the internals of Chrome. Are these ERRORs significant/related to the COMException? I don't see errors like these when I run WV2 locally.
|
@yunate are you looking at this issue actively? It is a hot topic for us. |
@nishitha-burman Hi! This topic is pretty hot for us currently. Would it be possible to get someone to look at it? Thanks! |
I received a WebView2 log from another customer (also via by Env. Var.:
However I see the same error when I run the add-in w/WebView2 locally - and the COMException 0x8007139F does not repro for me. Since we are not able to run a debugger at the customer sites where this issue occurs, is there some additional logging or diagnostic information we can capture to help us find what is causing this exception? |
@champnic would you be able to help with this issue? Thanks! |
For anyone else following this issue, I stumbled upon this reference to getting WV2-specific events logged in the Event Viewer: link |
@ShaunLoganOracle, I'm sorry I haven't had one for so long, and I will look into this issue. |
@ShaunLoganOracle Is it possible to take a perf trace for this? The instruction on how to take a trace is at microsoft/microsoft-ui-xaml#5816 (comment). The trace file will be a large file that has to be shared via some cloud drive. Or use DebugView(https://learn.microsoft.com/en-us/sysinternals/downloads/debugview) to find the log like |
Capturing WV2-specific events seems like it would be helpful. Unfortunately, we are blocked from using the Windows Performance Recorder because:
For others reading this, Admin/elevated privileges are required to install/run the WPR. This may not be feasible in all cases. Is there another mechanism for getting a newer Windows ADK for Windows 10 (with the WPR) that will successfully record a trace file? |
For this issue, we could use DebugView(https://learn.microsoft.com/en-us/sysinternals/downloads/debugview) to find the log like WebView2: Initialization failed. |
@yunate Thank you. I want to give the customer who can reproduce the issue the correct instructions, can you please confirm whether or not the default Capture settings for DebugView are sufficient to capture the WebView2 output? |
Fortunately, we have logged by OutputDebugString function specially for except 0x8007139F, so we can use DebugView to capture the WebView2 output and use default Capture settings is okay. |
@yunate We received a DebugView log from one of the customers. It contains:
In our case, we are a VSTO add-in running inside of the Excel.exe process. We don't control the DPI awareness of the host app, and we're getting this exception with a single WebView2 process associated with the UDF (unlike #899 where there are two apps w/different DPI awareness sharing the UDF). Since we re-use the UDF for different excel.exe sessions, could this exception be caused by the user running Excel (and WV2) on one set of display settings, then running Excel again with different settings (but sharing the same UDF)? |
@yunate We got another DebugView log from another customer, it shows the same "... mismatch in DPI awareness..." issue. |
Thanks for your reply, and I'm the reason of DPI issue, and I will inform you of any progress |
This is a bug and will be fix in next release (release-109), and this will be published soon. |
@yunate Great news! Thanks for the update! Will it be fixed in the WebView2 runtime or SDK? |
Yes, both runtime and SDK will be all updates. And should be published next week. |
Does the fix for this particular issue require an SDK upgrade? |
It requires an SDK upgrade to make the app can use the 109 runtime. |
Thanks for the quick responses, @yunate . But, I am a little confused...
Generally, the latest WebView2 runtime is used without any SDK upgrade in the host application... |
The SDK version should match the runtime. The SDK file: |
@yunate |
@yunate |
@xiakan |
@ShaunLoganOracle |
Restarting the computer suddenly throws an exception, and the usual recovery method is to restart the computer again |
@xiakan it is the same issue and that issue is not resolved if you see this debug message when attaching the debugger to the application process: "WebView2: Initialization failed due to a mismatch in DPI awareness.". |
@LiangTheDev some of our joint (Microsoft & Oracle) customers are inquiring about progress on this issue. Is there anything I can share with them? |
All I can say is that we are still investigating it and it is not something that we can fix in Edge WebView2 code alone. |
I also have the same issue on my dev machine: (The group or resource is not in the correct state to perform the requested operation) Ready to cooperate for solving the issue since I have dev machine with all possible access and permissions |
We just made a change for the dpi awareness issue. Could you please try it out with Edge Canary and see whether the fix works? The change is in Edge version >= 117.0.2007.0, which means available in latest Edge Canary only currently. |
Hello support team. Unfortunately it didn't fix in my case. Ensured loaded version result.BrowserVersionString is 117.0.2007.0 canary As the result I have initial error: |
@LevchenkoOleksandr is there anything in registry HKLM or HKCU under Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers? |
No, I didn't set any compatibility overrides |
@LevchenkoOleksandr then it is not the same issue discussed in this thread and the fix is trying to fix. Could you please take an ETW trace of the repro? Instruction for taking ETW trace is at https://github.com/MicrosoftEdge/WebView2Feedback/blob/main/diagnostics/etw.md, using https://github.com/MicrosoftEdge/WebView2Feedback/blob/main/diagnostics/WebView2.wprp should be good enough. You can share the trace privately with me at lzhao@microsoft.com. |
@LiangTheDev , you said:
I reproduced the issue using the simple use case of changing High DPI scaling on Excel.exe to "System (Enhanced)", using WV2 RT |
Since we have customers waiting for this fix, is there anything you can say about the timeline for it appearing (even roughly)? |
@ShaunLoganOracle thanks for testing it and great to hear that the change seems to make a difference. Edge 117 should be released around Week of 14-Sep-2023. And in offline discussion, it is found that the issue @LevchenkoOleksandr encountered is likely due to multiple apps sharing the same user data folder. |
Thank you for your help and pointing me to correct direction. In my case it really was sharing the same folder between components. |
I look forward to trying out the fix soon. |
As with all software development, release schedule is often delayed. From information I have gathered, it looks like Edge 117 is likely to be released sometime next week. |
@ShaunLoganOracle According to my observation, every time there is a major version update (such as 117), WebView2 can download to 117, and the bootstrapper can also install to 117, but the push update needs to wait for several days, unlike the minor version updates that are faster, sometimes it may be delayed for 10 days, maybe for security reasons, or maybe for batch push. I think, if you want to wait for your customers to solve this problem automatically, you need to wait for their machines to upgrade WebView2 automatically, which may take another two weeks. |
It took me way longer than it needed to in order to find this. Saw hints to invalid config but was wondering where the hell it was coming from. I implemented this function quickly to alleviate the issue in case it happens in the field. Thankfully the key gets added in the current user so we can remove it without admin. This won't be impacted by version number changes,
|
I encountered a similar problem last year, and the solution is the same as yours. This inspiration came from LiangTheDev's reply above, where he mentioned the registry location multiple times. I don't know what tool added this registry record because my program monitored that it appeared again after being deleted for a period of time. So remember to check if this registry record was added every time initialization fails. |
To resolve the WebView2 initialization failure due to a DPI mismatch, I integrated the SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) function at the start of the wWinMain function. This ensures that the application's DPI awareness is consistent with the WebView2 processes, preventing errors when users change display scaling (e.g., to 125%). This adjustment resolved the DPI-related issue and allowed WebView2 to initialize correctly. |
Description
We have some customers that are encountering this exception when our code is creating a WebView2 control hosted in a Winform. The UserDataFolder used is specific to the user and not shared by other apps. We use the same CoreWebView2Environment properties when calling EnsureCoreWebView2() for subsequent WV2 controls we create. We are unable to reproduce the issue in-house.
Version
SDK: 1.0.1343.22
Runtime: 107.0.1418.52
Framework: WinForms
OS: Win10, exact version info not yet if available
VSTO Add-in running in Excel
Repro Steps
Our code does in essence, the following.
In our Winform that hosts the WV2 control:
In our subclass of
Microsoft.Web.WebView2.WinForms.WebView2
:In our event handler for
CoreWebView2InitializationCompleted
, we gete.IsSuccess
= false withe.InitializationException
as shown in the stack above.Additional context
We saw this GH issue: #2495, which might be related, but the exception stacks there are WPF so they don't match ours exactly..
We have multiple customers at different companies encountering this issue. We also have many customers across companies not encountering this issue.
Diagnostics
We are unable to use a debugger at the customer sites.
How can we capture additional logs from the customer to help us diagnose the root cause of the exception?
AB#43230947
The text was updated successfully, but these errors were encountered: