-
Notifications
You must be signed in to change notification settings - Fork 51
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
Creation of ICoreWebView2Controller fails with E_FAIL #850
Comments
Hm, I'm not sure what testing we've done in a no internet environment. I'll open this bug on our backlog and we'll take a look. It's possible that one of the network calls is causing a failure, but it would surprise me. Disabling those network requests is currently tracked in #819. Thanks! |
Yepp, I also noticed these "garbage" requests which are mentioned in issue #819. |
I have been trying out some policies that seem related to these "hidden" network requests:
This setting did suppress the three network requests to random hosts as mentioned in #819
This setting suppress the request to https://www.bing.com/api/shopping/v1/getsupporteddomains
This setting suppress the request to https://config.edge.skype.com/config/v1/Edge/88.0.705.49 However, these policies only seem to be read by the "official" Edge browsers - which is logical due to the namespace of the registry settings (SOFTWARE\Policies\Microsoft\ Edge). But how do we achieve the same thing in a custom application which only embedds the webview2? I have tried to inspect the commandline of the msedge.exe rendering process, but I can't really see any changes due to my policy changes. When I inspect the msedgewebview2.exe which is used in our application, I can see a list of disabled/enabled features. |
No, sorry but I can't change the network conditions in the customer environment so I can not test if it works. However, I have been testing some more and I think I have at least seen what is happening... During, the I have also noticed that the outcome seem to depend on our host exe. When the msedgewebview2.exe is launched the name of the host exe is passed on the command line:
It should be noted that the postprocessed exe file runs without problems on my Windows 10 machine. |
Perhaps the problem somehow origins from WebView2Loader.dll When I start the release build from my developer machine (the one that works) I get this commandline for the topmost msedgewebview2.exe (the one launched from our host exe):
When I start our postprocessed jenkins build the same commandline lacks a lot of stuff:
I also tested an additional jenkins build which had a "traditional" product version (9.99.99.99) in case of our somewhat odd product version (browser.beta9) should be the problem - but it wasn't:
This build fails in the same way. May some code in WebView2Loader.dll fail in such a way that only the first three parameters are added to the command line? |
I recently uppgraded to WebView2Loader.dll version 1.0.705.50 |
Hmm, when I was investigating my problem as described in issue #893, I uninstalled the dev channel version in order to get our browser to select the standard Edge version. When that didn´t work I installed the beta channel instead as I described. When using the beta version this problem disappeared... The commandline for the topmost msedgeviewview2.exe now became:
In this case these parameters was not added
I have been trying do get our jenkins server to make multiple versions of our browser exe with a different degrees of postprocessing, but now they all worked.... Maybe I will try to reinstall the dev channel again and see if I can pinpoint the problem. |
The exact same problem suddenly occured in the beta version when it reached 89.0.774.x Without any changes on our side besides using the new beta I noticed that these parameters which I previously saw in the dev version now also was added to the beta target:
I have tracked down that it is sufficient for us to "patch" the version information in our host exe to trigger the problem. So, my wild guess is that the loader get some problem when reading our "patched" version info and fails to produce a correct commandline for msedgewebview2.exe which fails to launch properly, and that the loader does this additional version reading step if the targeted version is 89 or greater @champnic can you confirm if this is the case? My main consern is that this will cause our application to break once version 89 reaches stable We use a somewhat custom and old version of verpatch to "replace" the version information. However, my understanding is that the a new version information record is added to the exe, and that the old resource remain "unused". We have never had any problems with this, and |
Hey @danjag - thanks for the continued investigation and added info. I just tried a basic app and it does look like the parameters are new, but I'm not seeing a crash as a result of it. I believe the parameters were added so that we can tie crash reports from the webview runtime to a specific app and see if specific types of usage are resulting in crashes. Is it possible for you to try unpatched binaries? Can you keep everything else the same in your scenario, but just don't run verpatch so that you get the default version behavior, and then see if you still repro the issue? That would hopefully demonstrate that there is a problem with the versioning and how it's sent over, and not some other problem that showed up between the 88 and 89 runtimes. |
@danjag Yes that is correct - the loader will get the file version info from the hosts exe and build the command line. My guess is something about the version formatting as a result of verpatch is causing it to fail out and not complete the rest of the command line. |
We use GetFileVersionInfo to read out the version of the exe. I'll try and have an engineer look at this relatively soon, but if you want to keep debugging you could try calling GetFileVersionInfo on both the patched and unpatched versions of your binaries to see if there's an obvious difference. I's also generally unfamiliar with the verpatch tool. Could you share how you are using it/calling it (parameters, etc.) on your host exe? Thanks! |
We already use GetFileVersionInfo to read version info from our verpatched modules, and it works for us. Does the loader try to parse the returned version strings? This is why I tested to use a traditional "1.2.3.4" formated product version - "since it could likely be parsed" - but it didn't matter.
From what I remember it is something like (it was a long time ago) verpatch myapp.exe "1.2.3.4" /pv "1.0.0.0" where "1.2.3.4" is the file version, and "1.0.0.0" is the product version (which the loader seems to read) There apparently is an article on CodeProject about the tool |
Explorer.exe read our verpatched modules without problems: The things in the red boxes are patched by our postprocessing. The product version above is an example where the module was built from our browser.beta9 tag in git. |
Now that the WebView2 runtime has updated to 89, we're facing the same problem with an executable created by the VB6 compiler. There's no exe hacking going on. Surprisingly, there's no problem when launching in debug mode via the VB6 IDE. Just opening and saving the executable with ResEdit (http://www.resedit.net/) solves the problem. I'm going to have a closer look at what's going on here. |
This could be an instance of a buggy resource compiler as described by Raymond Chen. Asking for the product version of the original executable as created by the VB6 compiler, I get a length of x using The documentation of As the command line of Is |
Thanks @RichardSteele, this was very helpful. It appears as if our version of the verpatch utility aren't doing the right thing... the string structure documentation clearly states that the If I look at the original "ProductVersion" record which was linked into our .exe it looks like this:
and if I look the "ProductVersion" record produced by our verpatch utility:
So, it looks like I need to have a look att the source code of our verpatch utility - it should be an easy fix once I find the place...
In our case this most likely happens because of wValueLength appears to contain number of bytes instead of number of words |
Hey all - we have a fix that makes our app more resilient to this issue. Turns out it's more widespread and was hitting apps in production, so we've pushed the fix down to the stable WebView2 Runtime 89, which should be patched this week. Additionally the fix should show up in Microsoft Edge Canary in a day or two. Apologies for any inconvenience, and huge thanks for the investigation you all did here to track this issue down! |
Great news @champnic, thanks for letting us know |
The fix has been checked in and is available in: We still encourage you to update your version formats if you were previously running into this. Thanks! |
Description
I have been trying to get our webview2 based browser running in a remote desktop environment of a customer.
This environment has very resticted network access ("no internet"), and I think this may be causing the problem.
When I start our browser the it fails to create the controller instance for the browser.
When I start the installed Edge browser it also fails, but more gracefully by showing an error page.
Version
SDK: 89.0.721.0
Runtime: 89.0.767.0 dev
Framework: Win32
OS: Windows Server 2016 1607
Additional context
I have noticed that a number of network calls are made during the
ICoreWebView2Environment::CreateCoreWebView2Controller
call, and the before the completion interfaceICoreWebView2CreateCoreWebView2ControllerCompletedHandler::Invoke
is called.In the customer environment this completion function is called after quite some time with a 0x80004005 (E_FAIL) errorCode.
I'm guessing that the reason for the delay could be due to some network connection timeout.
By using Fiddler I could identify network calls for at least:
smartscreen (https://europe.smartscreen.microsoft.com/api/browser/edge/actions)
shopping (https://www.bing.com/api/shopping/v1/getsupporteddomains)
skype(?) (https://config.edge.skype.com/config/v1/Edge/88.0.705.49)
I managed to disable smartscreen by using
--disable-features=msSmartScreenProtection
as described in issue #834It seems shopping was enabled by default since version 87.0.664.55. This perhaps makes perfect sense in the official Edge browser, but in the embedded usecase I think it makes no sense at all.
Could a failure in any of these network calls be causing my E_FAIL error?
Are there any ways to disable the remaining features?
AB#31482191
The text was updated successfully, but these errors were encountered: