jellyfin / jellyfin-mpv-shim

MPV Cast Client for Jellyfin
Other
1.62k stars 93 forks source link

Jellyfin desktop 1.9 failed to execute script #179

Closed fusk-l closed 3 years ago

fusk-l commented 3 years ago

Describe the bug I just installed the app and tried to run it, that's basically it. First time install, so there has not been a working scenario as i've not had it installed on this laptop before. Uninstalled and installed 1.8.1 and it worked.

To Reproduce Steps to reproduce the behavior:

  1. Install program
  2. Attempt to run program

Expected behavior A clear and concise description of what you expected to happen.

Screenshots Anmærkning 2021-03-19 183641

Desktop (please complete the following information):

Error Messages Please provide logs, as they are often needed for me to understand and quickly troubleshoot the issue. You can read instructions for how to do so here: https://github.com/iwalton3/jellyfin-mpv-shim/wiki/Sending-Logs

iwalton3 commented 3 years ago

Please try running this debug build that'll display more errors before crashing: https://iwalton.com/ushare/jellyfin-mpv-desktop_1.9.0_dbg.exe

fusk-l commented 3 years ago

It starts, may be installing 1.8 first fixed the issue that 1.9 had. I reinstalled 1.9 before trying 1.8. Just in case it was a install issue.

iwalton3 commented 3 years ago

Strange. I just tested and it appears a fresh install and also running it without the config existing works. If anyone else has this problem and can give me an idea of what is happening, that would be greatly appreciated.

fusk-l commented 3 years ago

Nope, it's still not working. I just installed the normal 1.9 and same error, but starting the one you send works fine.

iwalton3 commented 3 years ago

...great. So merely trying to observe the problem eliminates it.

fusk-l commented 3 years ago

This is exactly what i done so far. Install 1.9, didn't work. Reinstall 1.9, didn't work. Uninstall 1.9, then install 1.8.1, now it works. Uninstall 1.8.1, then trying out your 1.9, which worked. I uninstalled 1.8.1 because i thought the one you sent was an installation. Then install 1.9 again getting the same error as before, meanwhile yours still works. Uninstalling 1.9. Installing 1.8.1 and checking it works, then installing 1.9 on top of it, same error. Then installing 1.8.1 back on top of that and now it works again.

iwalton3 commented 3 years ago

Alright for the sake of my sanity do either of these these builds work?

The difference is the build here was built in the same virtual machine as the debug one, but the official release was built using Microsoft Azure Pipelines.

fusk-l commented 3 years ago

Tried the installer, it works. Did not try the portable.

wsimon98 commented 3 years ago

Had the same issue. Portable version does work. After the first time I tried the installed version and it failed, I went into the Jellyfin MPV Shim and put my creds in there. Tried launching again, nope. Same error as OP. So then I found this thread, and did the portable. As I said, it works. But I'd like installer packages rather than portable so I can easily distribute through my active directory. I then ran the installer again that you posted here. Now it works. No errors in Event Viewer by the way.

Hopefully you guys can get this fixed. Awesome app!

iwalton3 commented 3 years ago

So to clarify, the shim mode works? Is this true for other people having this issue?

maru801 commented 3 years ago

That's true for me. When I installed 1.9.0, I found the shim mode works fine, but the desktop mode refuses to work showing the same "Failed to execute" error.

I uninstalled the official 1.9.0 release and installed the 1.9.0 version you linked to. This one does have both shim and desktop mode working.

fusk-l commented 3 years ago

Same issue with v1.10.2 & 10.0.1. I didn't have time to try others as people were waiting for the movie to start, so went straight for 1.8.1 as i knew that worked. Installed on a win10 machine that has never had jellyfin installed before. Edit: Also tested on personal laptop, same issue. 1.8.1 works fine tho.

iwalton3 commented 3 years ago

Neat so this is inexplicably breaking for enough people that I am going to have to do debug builds in the CI. Because this is madness.

fusk-l commented 3 years ago

On my desktop 10.0.2 works fine. But on my personal laptop, work laptop and another laptop at work it does not work. All running win10 20H2. They're mixed intel and amd laptops. The good part is that 1.8.1 works on all of them, so that's at least a solution that's reliable.

iwalton3 commented 3 years ago

Please try this debug build, which was built by the same CI: Download Debug Build

Please note that this file may take a bit to download. It is 145 MB.

iwalton3 commented 3 years ago

I have confirmed that the build works in my Windows VM and will log all errors to the console. If the window briefly flashes, you may have to open command prompt and drag the run-desktop.exe into it.

It looks like my VM does have a Windows feature update. So maybe it'll break after that... image

fusk-l commented 3 years ago

Running the exe open cmd for a moment, then closes and nothing else happens. Dragging exe into admin cmd does nothing. Debug is empty. Am i doing something wrong?

iwalton3 commented 3 years ago

Maybe try a non-admin CMD. If it's that new Windows update I will be installing that shortly and testing under that. Apparently my VM was out of disk space so it hasn't updated in a while.

You do have to press enter after dragging the run-desktop.exe into the window.

fusk-l commented 3 years ago

Yes, it has to be non-admin cmd. This is the output. Can translate if needed.

2021-03-27 16:18:18,254 [ INFO] conf: Loaded settings from json: C:\Users\XXX\AppData\Roaming\jellyfin-mpv-shim\conf.json 2021-03-27 16:18:22,545 [ INFO] player: Using libmpv1 playback backend. 2021-03-27 16:18:29,194 [ INFO] werkzeug: 127.0.0.1 - - [27/Mar/2021 16:18:29] "←[37mGET /index.html HTTP/1.1←[0m" 200 -

Ikke-afviklet undtagelse: System.IO.FileLoadException: Filen eller assemblyen 'file:///C:\Users\XXX\Desktop\run-desktop\Python.Runtime.dll' eller en af dens afhængigheder kunne ikke indlæses. Handlingen understøttes ikke. (Undtagelse fra HRESULT: 0x80131515) ---> System.NotSupportedException: Der blev gjort forsøg på at indlæse en assembly fra en netværksplacering, hvilket ville have bevirket, at assemblyen var blevet sandkassebaseret i tidligere versioner af .NET Framework. I denne version af .NET Framework aktiveres CAS-politik ikke som standard, så denne indlæsning kan udgøre en potentiel risiko. Hvis formålet med denne indlæsning ikke er at sandkassebasere assemblyen, skal du aktivere parameteren loadFromRemoteSources. Du kan finde flere oplysninger i http://go.microsoft.com/fwlink/?LinkId=155569. --- Slut på staksporing af indre undtagelser --- ved System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) ved System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) ved System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) ved System.Reflection.Assembly.LoadFrom(String assemblyFile) ved clrModule.PyInit_clr()

iwalton3 commented 3 years ago

Ok so this problem is caused by the debug build and is unrelated.

Please before extracting the zip file, mark the file as unblocked in properties and try again.

Unresolved exception: System.IO.FileLoadException: The file or assembly 'file: /// C: \ Users \ XXX \ Desktop \ run-desktop \ Python.Runtime.dll' or one of its dependencies could not be loaded. The action is not supported. (HRESULT Exception: 0x80131515) ---> System.NotSupportedException: An attempt was made to load an assembly from a network location, which would have caused the assembly to be sandboxed in earlier versions of the .NET Framework. In this version of the .NET Framework, CAS policy is not enabled by default, so this loading may pose a potential risk. If the purpose of this entry is not to sandbox the assembly, enable the loadFromRemoteSources parameter. You can find more information at http://go.microsoft.com/fwlink/?LinkId=155569.
--- End of stack tracking of internal exceptions ---
at System.Reflection.RuntimeAssembly._nLoad (AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark & ​​stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntreckspection),
by System.Reflection.RuntimeAssembly.InternalLoadAssemblyName (AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark & ​​stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIncrespectionS,
by System.Reflection.RuntimeAssembly.InternalLoadFrom (String assemblyFile, Evidence securityEvidence, Byte [] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark & ​​stackMark)
at System.Reflection.Assembly.LoadFrom (String assemblyFile)
by clrModule.PyInit_clr () 
iwalton3 commented 3 years ago

I did test the debug build on my upgraded VM and it still works.

fusk-l commented 3 years ago

2021-03-27 16:33:57,929 [ INFO] conf: Loaded settings from json: C:\Users\XXX\AppData\Roaming\jellyfin-mpv-shim\conf.json 2021-03-27 16:33:58,796 [ INFO] player: Using libmpv1 playback backend. 2021-03-27 16:33:59,395 [ INFO] werkzeug: 127.0.0.1 - - [27/Mar/2021 16:33:59] "←[37mGET /index.html HTTP/1.1←[0m" 200 - [pywebview] pythonnet cannot be loaded Traceback (most recent call last): File "webview\guilib.py", line 52, in import_winforms File "PyInstaller\loader\pyimod03_importers.py", line 531, in exec_module File "webview\platforms\winforms.py", line 72, in File "PyInstaller\loader\pyimod03_importers.py", line 531, in exec_module File "webview\platforms\cef.py", line 12, in File "PyInstaller\loader\pyimod03_importers.py", line 531, in exec_module File "cefpython3__init__.py", line 66, in ImportError: DLL load failed: Det angivne modul blev ikke fundet. 2021-03-27 16:33:59,682 [ ERROR] pywebview: pythonnet cannot be loaded Traceback (most recent call last): File "webview\guilib.py", line 52, in import_winforms File "PyInstaller\loader\pyimod03_importers.py", line 531, in exec_module File "webview\platforms\winforms.py", line 72, in File "PyInstaller\loader\pyimod03_importers.py", line 531, in exec_module File "webview\platforms\cef.py", line 12, in File "PyInstaller\loader\pyimod03_importers.py", line 531, in exec_module File "cefpython3__init.py", line 66, in ImportError: DLL load failed: Det angivne modul blev ikke fundet. Traceback (most recent call last): File "run-desktop.py", line 23, in File "jellyfin_mpv_shim\mpv_shim.py", line 118, in main_desktop File "jellyfin_mpv_shim\mpv_shim.py", line 93, in main File "jellyfin_mpv_shim\webclient_view\init.py", line 430, in run File "webview\init__.py", line 96, in start File "webview\guilib.py", line 99, in initialize webview.util.WebViewException: You must have pythonnet installed in order to use pywebview. [1652] Failed to execute script run-desktop

iwalton3 commented 3 years ago

I wonder if it is because of some strange ABI issue between mismatched CEF versions. It does look like I could switch to edgechromium which would be nice since I can get rid of CEF. I'll look into that.

iwalton3 commented 3 years ago

Nope edge chromium is no good for now. https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution

I need to fix CEF.

iwalton3 commented 3 years ago

I just pushed an updated version of CEF that should potentially correct the ABI issue?

https://dev.azure.com/jellyfin-project/jellyfin/_build/results?buildId=27329&view=logs&j=eaf24dcf-9ba3-5672-63a6-70ce54959a60

When that job is done you should be able to download the artifact "DebugWindows" and let me know if it works. I'll post a direct link to download it when I notice the job is done but I may be away from my computer.

iwalton3 commented 3 years ago

Debug build: Download

Installer build: Download

Please let me know if this works.

fusk-l commented 3 years ago

Installer didn't work, same issue. Debug is downloading. Edit: 2021-03-27 19:27:14,857 [ INFO] conf: Loaded settings from json: C:\Users\XXX\AppData\Roaming\jellyfin-mpv-shim\conf.json 2021-03-27 19:27:16,289 [ INFO] player: Using libmpv1 playback backend. 2021-03-27 19:27:17,492 [ INFO] werkzeug: 127.0.0.1 - - [27/Mar/2021 19:27:17] "←[37mGET /index.html HTTP/1.1←[0m" 200 - [pywebview] pythonnet cannot be loaded Traceback (most recent call last): File "webview\guilib.py", line 52, in import_winforms File "PyInstaller\loader\pyimod03_importers.py", line 531, in exec_module File "webview\platforms\winforms.py", line 72, in File "PyInstaller\loader\pyimod03_importers.py", line 531, in exec_module File "webview\platforms\cef.py", line 12, in File "PyInstaller\loader\pyimod03_importers.py", line 531, in exec_module File "cefpython3__init__.py", line 66, in ImportError: DLL load failed: Det angivne modul blev ikke fundet. 2021-03-27 19:27:17,869 [ ERROR] pywebview: pythonnet cannot be loaded Traceback (most recent call last): File "webview\guilib.py", line 52, in import_winforms File "PyInstaller\loader\pyimod03_importers.py", line 531, in exec_module File "webview\platforms\winforms.py", line 72, in File "PyInstaller\loader\pyimod03_importers.py", line 531, in exec_module File "webview\platforms\cef.py", line 12, in File "PyInstaller\loader\pyimod03_importers.py", line 531, in exec_module File "cefpython3__init.py", line 66, in ImportError: DLL load failed: Det angivne modul blev ikke fundet. Traceback (most recent call last): File "run-desktop.py", line 23, in File "jellyfin_mpv_shim\mpv_shim.py", line 118, in main_desktop File "jellyfin_mpv_shim\mpv_shim.py", line 93, in main File "jellyfin_mpv_shim\webclient_view\init.py", line 430, in run File "webview\init__.py", line 96, in start File "webview\guilib.py", line 99, in initialize webview.util.WebViewException: You must have pythonnet installed in order to use pywebview. [4428] Failed to execute script run-desktop

iwalton3 commented 3 years ago

Great so upgrading it didn't work.

123vrsc commented 3 years ago

Per Android tv? Cosa devo fare?

iwalton3 commented 3 years ago

Looks like a regression in 66.1 of cefpython? https://github.com/cztomczak/cefpython/issues/359

I am going to try and pin the version to 66.0 and see if that fixes it.

iwalton3 commented 3 years ago

Debug build: Download

Installer build: Download

Please let me know if this works.

fusk-l commented 3 years ago

That installer works.

iwalton3 commented 3 years ago

Excellent!

fusk-l commented 3 years ago

If it's of any use to you.

2021-03-28 01:04:43,258 [ INFO] conf: Loaded settings from json: C:\Users\XXXX\AppData\Roaming\jellyfin-mpv-shim\conf.json 2021-03-28 01:04:44,754 [ INFO] player: Using libmpv1 playback backend. 2021-03-28 01:04:45,569 [ INFO] werkzeug: 127.0.0.1 - - [28/Mar/2021 01:04:45] "←[37mGET /index.html HTTP/1.1←[0m" 200 - 2021-03-28 01:04:47,801 [ INFO] werkzeug: 127.0.0.1 - - [28/Mar/2021 01:04:47] "←[37mGET /index.html HTTP/1.1←[0m" 200 - 2021-03-28 01:04:47,980 [ INFO] werkzeug: 127.0.0.1 - - [28/Mar/2021 01:04:47] "←[37mGET /config.json HTTP/1.1←[0m" 200 - 2021-03-28 01:04:48,010 [ INFO] werkzeug: 127.0.0.1 - - [28/Mar/2021 01:04:48] "←[37mGET /config.json HTTP/1.1←[0m" 200 - 2021-03-28 01:04:48,028 [ INFO] werkzeug: 127.0.0.1 - - [28/Mar/2021 01:04:48] "←[37mGET /config.json HTTP/1.1←[0m" 200 - 2021-03-28 01:04:48,735 [ INFO] webclient: Recieved session for server: XX, user: XX 2021-03-28 01:04:48,736 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.client: JellyfinClient initializing... 2021-03-28 01:04:48,736 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.configuration: Configuration initializing... 2021-03-28 01:04:48,737 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.configuration: Begin http constructor. 2021-03-28 01:04:48,737 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.ws_client: WSClient initializing... 2021-03-28 01:04:48,737 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.connection_manager: ConnectionManager initializing... 2021-03-28 01:04:48,738 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.credentials: Credentials initializing... 2021-03-28 01:04:48,738 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.configuration: Begin app constructor. 2021-03-28 01:04:48,739 [ INFO] JELLYFIN.jellyfin_apiclient_python.connection_manager: Begin connect 2021-03-28 01:04:48,739 [ INFO] JELLYFIN.jellyfin_apiclient_python.connection_manager: Begin getAvailableServers 2021-03-28 01:04:48,740 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.credentials: credentialsupdated 2021-03-28 01:04:48,740 [ INFO] JELLYFIN.jellyfin_apiclient_python.connection_manager: connect has 1 servers 2021-03-28 01:04:48,741 [ INFO] JELLYFIN.jellyfin_apiclient_python.connection_manager: begin connectToServer 2021-03-28 01:04:48,743 [ INFO] JELLYFIN.jellyfin_apiclient_python.api: Sending get request to system/info/public 2021-03-28 01:04:48,744 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.api: 5 2021-03-28 01:04:48,746 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.api: {'Accept': 'application/json', 'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Application': 'Jellyfin MPV Shim/1.10.2', 'Accept-Charset': 'UTF-8,', 'Accept-encoding': 'gzip', 'User-Agent': 'Jellyfin-MPV-Shim/1.10.2', 'x-emby-authorization': 'MediaBrowser Client=Jellyfin MPV Shim, Device=Einstein, DeviceId=51153346-9ade-4032-bf30-a6de47989e14, Version=1.10.2'} 2021-03-28 01:04:48,775 [ DEBUG] urllib3.connectionpool: Starting new HTTP connection (1): 192.168.82.XX:XX 2021-03-28 01:04:48,785 [ DEBUG] urllib3.connectionpool: http://192.168.XX.XX:XX"GET /system/info/public HTTP/1.1" 200 None 2021-03-28 01:04:48,787 [ INFO] JELLYFIN.jellyfin_apiclient_python.connection_manager: calling onSuccessfulConnection with server XX 2021-03-28 01:04:48,788 [ INFO] JELLYFIN.jellyfin_apiclient_python.api: Sending get request to system/info 2021-03-28 01:04:48,789 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.api: 5 2021-03-28 01:04:48,790 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.api: {'Accept': 'application/json', 'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Application': 'Jellyfin MPV Shim/1.10.2', 'Accept-Charset': 'UTF-8,', 'Accept-encoding': 'gzip', 'User-Agent': 'Jellyfin-MPV-Shim/1.10.2', 'x-emby-authorization': 'MediaBrowser Client=Jellyfin MPV Shim, Device=Einstein, DeviceId=51153346-9ade-4032-bf30-a6de47989e14, Version=1.10.2', 'X-MediaBrowser-Token': 'REDACTED'} 2021-03-28 01:04:48,797 [ DEBUG] urllib3.connectionpool: Starting new HTTP connection (1): 192.168.82.XX:XX 2021-03-28 01:04:48,837 [ DEBUG] urllib3.connectionpool: http://192.168.82.XX:XX"GET /system/info HTTP/1.1" 200 None 2021-03-28 01:04:48,843 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.credentials: credentialsupdated 2021-03-28 01:04:48,844 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.connection_manager: resolving connect with result: {'Servers': "[{'address': 'http://192.168.82.XX:XX', 'AccessToken': 'REDACTED', 'UserId': '3dd30bbd1e9b43b6b374a9655cf11bfc', 'Name': 'XX', 'Id': '8279a806441446dbb5b4af56ef25223e', 'username': 'XX', 'DateLastAccessed': '2021-03-28T01:04:48Z', 'uuid': '8279a806441446dbb5b4af56ef25223e'}]", 'State': 3} 2021-03-28 01:04:48,845 [ INFO] JELLYFIN.jellyfin_apiclient_python.client: User is authenticated. 2021-03-28 01:04:48,848 [ DEBUG] urllib3.util.retry: Converted retries value: 3 -> 'Retry(total=3, connect=None, read=None, redirect=None, status=None)' 2021-03-28 01:04:48,849 [ DEBUG] urllib3.util.retry: Converted retries value: 3 -> 'Retry(total=3, connect=None, read=None, redirect=None, status=None)' 2021-03-28 01:04:48,851 [ INFO] JELLYFIN.jellyfin_apiclient_python.ws_client: Websocket url: ws://192.168.82.XX:XX/socket?api_key=REDACTED&device_id=51153346-9ade-4032-bf30-a6de47989e14 2021-03-28 01:04:48,856 [ DEBUG] urllib3.connectionpool: Starting new HTTP connection (1): 192.168.82.XX:XX 2021-03-28 01:04:48,869 [ INFO] JELLYFIN.jellyfin_apiclient_python.ws_client: --->[ websocket ] 2021-03-28 01:04:48,870 [ DEBUG] event_handler: Unhandled Event WebSocketConnect: None 2021-03-28 01:04:48,875 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.ws_client: ForceKeepAlive received from server. 2021-03-28 01:04:48,878 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.ws_client: KeepAlive received from server. 2021-03-28 01:04:48,878 [ DEBUG] urllib3.connectionpool: http://192.168.82.XX:XX"POST /Sessions/Capabilities/Full HTTP/1.1" 204 0 2021-03-28 01:04:48,881 [ INFO] webclient: Connection was successful. 2021-03-28 01:04:48,882 [ INFO] werkzeug: 127.0.0.1 - - [28/Mar/2021 01:04:48] "←[37mPOST /mpv_shim_session HTTP/1.1←[0m" 200 - 2021-03-28 01:04:53,729 [ INFO] werkzeug: 127.0.0.1 - - [28/Mar/2021 01:04:53] "←[37mPOST /mpv_shim_event HTTP/1.1←[0m" 200 - 2021-03-28 01:04:54,947 [ INFO] JELLYFIN.jellyfin_apiclient_python.ws_client: ---<[ websocket ] --<[ session/1319298429448 ] 2021-03-28 01:04:54,948 [ INFO] Jellyfin.jellyfin_apiclient_python.http: --<[ session/1319298429448 ]

iwalton3 commented 3 years ago

Everything looks good to me.

fusk-l commented 3 years ago

That's great!

iwalton3 commented 3 years ago

This has been released.