iamkroot / trakt-scrobbler

Scrobbler for trakt.tv that supports VLC, Plex, MPC-HC, and MPV.
https://github.com/iamkroot/trakt-scrobbler/wiki
GNU General Public License v2.0
459 stars 30 forks source link

[BUG] randomly getting 'All pipe instances are busy.' #294

Closed soredake closed 5 months ago

soredake commented 6 months ago

Describe the bug

A clear and concise description of what the bug/error is.

After closing media player, I randomly get this error:

2024-04-17 14:08:34,787 - ERROR - syncplay@mpv - __init__ - Unhandled exception
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "C:\Users\user\AppData\Local\pipx\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\player_monitors\mpv.py", line 80, in run
    self.conn_loop()
  File "C:\Users\user\AppData\Local\pipx\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\player_monitors\mpv.py", line 302, in conn_loop
    self.file_handle = win32file.CreateFile(
                       ^^^^^^^^^^^^^^^^^^^^^
pywintypes.error: (231, 'CreateFile', 'All pipe instances are busy.')

Despite this error, everything works fine.

Desktop (please complete the following information):

To Reproduce

Steps to reproduce the behavior: I can't reproduce this, this happens randomly after closing media player.

Log file

Click to see log contents

``` 2024-04-17 13:43:46,325 - DEBUG - scrobbler - scrobbler - Scrobbling start at 0.59% for Ôèçðóê 2024-04-17 13:43:46,615 - INFO - scrobbler - scrobbler - Scrobble resume successful for P. E. Teacher S02E06 at 0.59% 2024-04-17 14:08:32,657 - DEBUG - syncplay@mpv - monitor - action=scrobble 2024-04-17 14:08:32,657 - DEBUG - syncplay@mpv - monitor - {'state': 1, 'progress': 100.0, 'media_info': {'type': 'episode', 'title': 'Ôèçðóê', 'season': 2, 'episode': 6}, 'updated_at': 1713352112.6571047} 2024-04-17 14:08:32,658 - DEBUG - scrobbler - scrobbler - Scrobbling pause at 100.00% for Ôèçðóê 2024-04-17 14:08:33,326 - INFO - scrobbler - scrobbler - Scrobble pause successful for P. E. Teacher S02E06 at 100.00% 2024-04-17 14:08:34,685 - DEBUG - syncplay@mpv - monitor - action=scrobble 2024-04-17 14:08:34,685 - DEBUG - syncplay@mpv - monitor - {'state': 0, 'progress': 100.0, 'media_info': {'type': 'episode', 'title': 'Ôèçðóê', 'season': 2, 'episode': 6}, 'updated_at': 1713352114.6852508} 2024-04-17 14:08:34,686 - DEBUG - syncplay@mpv - mpv - Pipe closed. 2024-04-17 14:08:34,686 - DEBUG - scrobbler - scrobbler - Scrobbling stop at 100.00% for Ôèçðóê 2024-04-17 14:08:34,787 - ERROR - syncplay@mpv - __init__ - Unhandled exception Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1073, in _bootstrap_inner self.run() File "C:\Users\user\AppData\Local\pipx\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\player_monitors\mpv.py", line 80, in run self.conn_loop() File "C:\Users\user\AppData\Local\pipx\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\player_monitors\mpv.py", line 302, in conn_loop self.file_handle = win32file.CreateFile( ^^^^^^^^^^^^^^^^^^^^^ pywintypes.error: (231, 'CreateFile', 'All pipe instances are busy.') 2024-04-17 14:08:35,002 - INFO - scrobbler - scrobbler - Scrobble stop successful for P. E. Teacher S02E06 at 100.00% ```

iamkroot commented 5 months ago

Despite this error, everything works fine.

Should be okay then. Your pipe is probably being used by some other service. Reopen if it causes trouble.

soredake commented 5 months ago

@iamkroot unfortuantely, most of the time I see 'All pipe instances are busy.' trakt-scrobbler stops working with mpv pipes (plex are still working)