Page 1 of 1

Initialization Error

Posted: Wed Apr 06, 2022 11:20 pm
by brche
When I run my application, everything works fine; but when all three of my testers install, then are getting:

Code: Select all

 -2147024726: There was an error creating the controller. on application start.
Does this sound familiar?
Thanks,
Brian

Code: Select all

MyApp.pas                   |TBrowserForm                                             |OnInitializationError             |1035[2]  
uWVBrowserBase.pas          |TWVBrowserBase                                           |doOnInitializationError           |2924[2]  
uWVBrowserBase.pas          |TWVBrowserBase                                           |ControllerCompletedHandler_Invoke |1179[54] 
uWVCoreWebView2Delegates.pas|TCoreWebView2CreateCoreWebView2ControllerCompletedHandler|Invoke                            |794[2]

Re: Initialization Error

Posted: Thu Apr 07, 2022 10:05 am
by salvadordf
I just uploaded a new version of WebView4Delphi with improved error messages when initialization fails.

Please, download the latest WebView4Delphi version from GitHub to get more details about that error.

Are the testers sharing the same user data folder?

Re: Initialization Error

Posted: Thu Apr 07, 2022 3:14 pm
by brche
salvadordf wrote: Thu Apr 07, 2022 10:05 am I just uploaded a new version of WebView4Delphi with improved error messages when initialization fails.

Please, download the latest WebView4Delphi version from GitHub to get more details about that error.

Are the testers sharing the same user data folder?
OK, Thanks. I'll try that.

No, they are installing on their own machines, with their own folders.

Thanks,
Brian

Re: Initialization Error

Posted: Thu Apr 07, 2022 3:48 pm
by brche
-2147024726:_There was an error creating the controller. (2)
Error code :_0x800700AA
Unexpected error result.

It looks like it is the UserDataFolder. I have two browsers using the same folder.

Thanks
Brian

Re: Initialization Error

Posted: Thu Apr 07, 2022 7:42 pm
by salvadordf
According to the official WebView2 documentation that error code is not one of the expected values for the controller creation results.

0x800700AA is the value of HRESULT_FROM_WIN32(ERROR_BUSY)

I can only find one reference to that error code in the WebView2 docs and it's not related to the controller :
https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2experimentalenvironment3?view=webview2-1.0.1189-prerelease
There could only be one active UpdateRuntime operation in an app process, and calling this API before the completed handler for a previous call is invoked will fail with HRESULT_FROM_WIN32(ERROR_BUSY). Calling this API repeatedly in a short period of time, will also fail with HRESULT_FROM_WIN32(ERROR_BUSY). To protect accidental abuse of the update service, the implementation throttles the calls of this API to 3 times within 5 minutes in a process. The exact throttling limit can change in the future.
Perhaps WebView2 has an undocumented limit and we can't create too many controllers or too frequently.