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

[Edge] Exception when running as admin #361

Closed
BlackTurtle123 opened this issue Aug 2, 2019 · 17 comments
Closed

[Edge] Exception when running as admin #361

BlackTurtle123 opened this issue Aug 2, 2019 · 17 comments

Comments

@BlackTurtle123
Copy link

Python version: 3.7
Pyinstaller version: Git dev version
Pywebview version: latest
OS: windows 10 and windows 8 64 bit
Issue: When running the builded exe as administrator the exe fails and complains about missing RPC calls. Unbuilded version or non administrator running version don't give this issue.
Verified on 3 systems.
Why I report this issue here?
There are issues who point to toolkit/webview
Onverwerkte uitzondering: Python.Runtime.PythonException: Exception : Kan RPC niet uitvoeren. (Uitzondering van HRESULT: 0x800706BE) bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bij Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlProcess.<CreateWebViewControlHostAsync>d__16.MoveNext() --- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden --- bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bij Microsoft.Toolkit.Forms.UI.Controls.WebViewControlProcessExtensions.CreateWebViewControlHost(WebViewControlProcess process, IntPtr hostWindowHandle, Rectangle bounds) bij Microsoft.Toolkit.Forms.UI.Controls.WebView.Initialize() bij Microsoft.Toolkit.Forms.UI.Controls.WebView.System.ComponentModel.ISupportInitialize.EndInit() bij Python.Runtime.Dispatcher.Dispatch(ArrayList args) bij System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) bij System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) bij System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) bij System.Threading.ThreadHelper.ThreadStart()

image

Am I willing to support this:
Potentially if I can get pywebview stable working with my app I am willing to donate or look into helping solve issues. For now I am trying this as experimental to check if it runs more stable then PyFlaDesk

@r0x0r
Copy link
Owner

r0x0r commented Aug 2, 2019 via email

@BlackTurtle123
Copy link
Author

When it's freezed and we run it as administrator on my or other computers.
So freezing goes okay, running non frozen goes okay, running as non admin also goes okay.
It has some issues with rpc command it can't execute.
Exception in english:
"Exception : The remote procedure call failed. (Exception from HRESULT: 0x800706BE)
"

@r0x0r
Copy link
Owner

r0x0r commented Aug 17, 2019

Can you test it with the just released 3.0.2?

@jorubyp
Copy link

jorubyp commented Aug 20, 2019

I've been experiencing the same problem, and it doesn't seem like 3.0.2 has solved it for me unfortunately:

Unhandled Exception: Python.Runtime.PythonException: Exception : The remote procedure call failed. (Exception from HRESULT: 0x800706BE) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlProcess.<CreateWebViewControlHostAsync>d__16.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Toolkit.Forms.UI.Controls.WebViewControlProcessExtensions.CreateWebViewControlHost(WebViewControlProcess process, IntPtr hostWindowHandle, Rectangle bounds) at Microsoft.Toolkit.Forms.UI.Controls.WebView.Initialize() at Microsoft.Toolkit.Forms.UI.Controls.WebView.System.ComponentModel.ISupportInitialize.EndInit() at Python.Runtime.Dispatcher.Dispatch(ArrayList args) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

@r0x0r
Copy link
Owner

r0x0r commented Aug 20, 2019

Isolating the problem would help solve the issue.
a) Does it occur with any examples?
b) What do you do to get this exception?

Googling revealed that the problem seems to occur when running under admin
CommunityToolkit/Microsoft.Toolkit.Win32#50

EdgeHTML is buggy as af, so I would not hold my breathe that this will get fixed at any point.

@jorubyp
Copy link

jorubyp commented Aug 20, 2019

a) Yes, it occurs with the Flask example
b) I run main,py in the Flask example, no window is created but the server starts and is accessible for 15 seconds, after which the error occurs.

I can live with not being able to run it as admin though (and it does work fine otherwise), I just thought I'd share that I had experienced it too.

Sorry for not providing more details originally, and again if this isn't enough to be helpful.

@BlackTurtle123
Copy link
Author

BlackTurtle123 commented Aug 21, 2019 via email

@r0x0r
Copy link
Owner

r0x0r commented Aug 21, 2019

Works as non-admin, fails as admin throwing this exception here.

@josiahvehrs
Copy link

I'm getting the same exception when running as admin, when running unelevated it works just fine.

@r0x0r
Copy link
Owner

r0x0r commented Aug 22, 2019

I have updated the documentation
https://pywebview.flowrl.com/guide/renderer.html#edgehtml

Closing this issue now

@r0x0r r0x0r closed this as completed Aug 22, 2019
@shivaprsd shivaprsd changed the title exception python.runtime exception the remote procedure call failed [Edge] Exception when running as admin Aug 22, 2019
@amalthomas-exe
Copy link

is there a fix for this issue??

@r0x0r
Copy link
Owner

r0x0r commented Feb 1, 2021

  1. Use other renderer. The new Chromium is way forward
  2. Do not run as admin

@amalthomas-exe
Copy link

my work requires me to have admin priviledges to write information
can you suggest any other rendered..

@r0x0r
Copy link
Owner

r0x0r commented Feb 1, 2021

Use Chromium or CEF. Instructions for installing Chromium can be found here.
https://pywebview.flowrl.com/guide/renderer.html

@r0x0r
Copy link
Owner

r0x0r commented Feb 1, 2021

Updated installation guide. https://pywebview.flowrl.com/guide/installation.html

@amalthomas-exe
Copy link

It's working for me ! Thanks!

@DedFishy
Copy link

DedFishy commented Jul 7, 2021

You should really try to fix this issue, it's really dumb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants