iamkroot/trakt-scrobbler

[BUG] trakt-scrobbler stops working with mpv pipes after getting 'All pipe instances are busy.' error

soredake opened this issue · 1 comments

Describe the bug

trakt-scrobbler stops working with mpv pipes after getting 'All pipe instances are busy.' error. I need to restart trakt-scrobbler to make it work again after this error.

Desktop (please complete the following information):

  • OS and Version: Windows 11 Pro
  • Python Version: Python 3.12.3
  • Player and Version: mpv v0.38.0-63-gb364e4a6

To Reproduce

Steps to reproduce the behavior:

  1. Install latest mpv-git and syncplay
  2. Configure mpv-git in syncplay
  3. Configure trakt-scrobbler (allowed paths and socket)
  4. Add --input-ipc-server=\\.\pipe\mpvSyncplaySocket to player arguments in syncplay
  5. Join some room
  6. Use syncplay
  7. Sooner or later this error will appear, rendering trakt-scrobbler unable to use mpv sockets until restarted

Log file

Click to see log contents

2024-05-22 17:02:44,722 - DEBUG - syncplay@mpv - mpv - Pipe closed.
2024-05-22 17:02:44,824 - 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', 'Âñå êîïèè êàíàëà çàíÿòû.')

I've pushed a fix just now. Try-
Install from branch:

  1. Stop the scrobbler with trakts stop
  2. Run pipx install --force --pip-args='--force-reinstall' git+https://github.com/iamkroot/trakt-scrobbler.git@master
  3. Start scrobbler with trakts start