trakt / Plex-Trakt-Scrobbler

Add what you are watching on Plex to trakt.tv
1.45k stars 167 forks source link

NullWriter object has no attribute 'flush' #522

Open rg9400 opened 5 years ago

rg9400 commented 5 years ago

OS: Windows 10 Plex Media Server Version: 1.15.1.710 Plugin Installation: Unsupported App Store

I noticed that from a month ago, my trakt plugin was not working properly. It still scrobbles anything I play on Plex to Trakt, but it cannot push watched status (if I manually mark an item in Plex played) or pull it. It is no longer pushing collections or pulling lists. It used to work flawlessly before. I have attached logs for when I manually try to run a full sync. I get the error on the UI that NullWriter object has no attribute 'flush'. I have tried uninstalling the plugin multiple times (with all the leftover files) and doing a fresh reinstall as well as refreshing the metadata of my entire library. This error keeps coming back.

2019-03-04 16:09:42,010 - root                             (6930) :  DEBUG (root:265) - Exception in I/O handler for fd 1740
Traceback (most recent call last):
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-ece95b3a1\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\tornado\ioloop.py", line 256, in start
    self._handlers[fd](fd, events)
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-ece95b3a1\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\tornado\stack_context.py", line 128, in wrapped
    callback(*args, **kwargs)
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-ece95b3a1\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\tornado\httpserver.py", line 219, in _handle_events
    connection, address = self._socket.accept()
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\socket.py", line 206, in accept
    sock, addr = self._sock.accept()
error: [Errno 10035] A non-blocking socket operation could not be completed immediately
2019-03-04 16:09:42,030 - root                             (78cc) :  INFO (root:840) - 200 GET /video/trakt (127.0.0.1) 19.00ms
2019-03-04 16:09:43,006 - root                             (6930) :  DEBUG (root:265) - Exception in I/O handler for fd 1740
Traceback (most recent call last):
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-ece95b3a1\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\tornado\ioloop.py", line 256, in start
    self._handlers[fd](fd, events)
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-ece95b3a1\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\tornado\stack_context.py", line 128, in wrapped
    callback(*args, **kwargs)
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-ece95b3a1\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\tornado\httpserver.py", line 219, in _handle_events
    connection, address = self._socket.accept()
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\socket.py", line 206, in accept
    sock, addr = self._sock.accept()
error: [Errno 10035] A non-blocking socket operation could not be completed immediately
2019-03-04 16:09:43,026 - plex.objects.core.base           (e70) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:43,028 - plex.objects.core.base           (e70) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:43,028 - plex.objects.core.base           (e70) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:43,029 - plex.objects.core.base           (e70) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:43,029 - plex.objects.core.base           (e70) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:43,030 - root                             (e70) :  INFO (root:840) - 200 GET /video/trakt/sync (127.0.0.1) 24.00ms
2019-03-04 16:09:43,655 - root                             (6930) :  DEBUG (root:265) - Exception in I/O handler for fd 1740
Traceback (most recent call last):
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-ece95b3a1\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\tornado\ioloop.py", line 256, in start
    self._handlers[fd](fd, events)
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-ece95b3a1\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\tornado\stack_context.py", line 128, in wrapped
    callback(*args, **kwargs)
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-ece95b3a1\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\tornado\httpserver.py", line 219, in _handle_events
    connection, address = self._socket.accept()
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\socket.py", line 206, in accept
    sock, addr = self._sock.accept()
error: [Errno 10035] A non-blocking socket operation could not be completed immediately
2019-03-04 16:09:44,572 - plugin.sync.main                 (5db4) :  INFO (plugin.sync.main:162) - (0) Started
2019-03-04 16:09:44,575 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing construct() on child: <plugin.sync.modes.fast_pull.movies.Movies object at 0x0615EDD0>
2019-03-04 16:09:44,579 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,579 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,581 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,582 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,582 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,582 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing construct() on child: <plugin.sync.modes.fast_pull.shows.Shows object at 0x0615E230>
2019-03-04 16:09:44,588 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,589 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,591 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,591 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,591 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,627 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing construct() on child: <plugin.sync.modes.fast_pull.lists.liked.LikedLists object at 0x0615E2B0>
2019-03-04 16:09:44,627 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing construct() on child: <plugin.sync.modes.fast_pull.lists.personal.PersonalLists object at 0x0615E610>
2019-03-04 16:09:44,627 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing construct() on child: <plugin.sync.modes.fast_pull.lists.watchlist.Watchlist object at 0x0615EAB0>
2019-03-04 16:09:44,627 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing construct() on child: <plugin.sync.modes.push.movies.Movies object at 0x0615E550>
2019-03-04 16:09:44,632 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,632 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,632 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,634 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,634 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,635 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing construct() on child: <plugin.sync.modes.push.shows.Shows object at 0x05E35810>
2019-03-04 16:09:44,641 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,641 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,642 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,642 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,642 - plex.objects.core.base           (5db4) :  WARNING (plex.objects.core.base:156) - [Section] Omitted attribute: scannedat
2019-03-04 16:09:44,680 - root                             (7da4) :  INFO (root:840) - 200 GET /video/trakt/sync/synchronize?account_id=1&t=1551737383.01 (127.0.0.1) 1024.00ms
2019-03-04 16:09:45,937 - trakt_sync.cache.sources.sync    (5db4) :  DEBUG (trakt_sync.cache.sources.sync:147) - Ignoring unsupported collection - data: 2, media: 2
2019-03-04 16:09:50,075 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing start() on child: <plugin.sync.modes.fast_pull.movies.Movies object at 0x0615EDD0>
2019-03-04 16:09:50,075 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing start() on child: <plugin.sync.modes.fast_pull.shows.Shows object at 0x0615E230>
2019-03-04 16:09:50,153 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing start() on child: <plugin.sync.modes.fast_pull.lists.liked.LikedLists object at 0x0615E2B0>
2019-03-04 16:09:50,153 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing start() on child: <plugin.sync.modes.fast_pull.lists.personal.PersonalLists object at 0x0615E610>
2019-03-04 16:09:50,153 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing start() on child: <plugin.sync.modes.fast_pull.lists.watchlist.Watchlist object at 0x0615EAB0>
2019-03-04 16:09:50,153 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing start() on child: <plugin.sync.modes.push.movies.Movies object at 0x0615E550>
2019-03-04 16:09:50,154 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing start() on child: <plugin.sync.modes.push.shows.Shows object at 0x05E35810>
2019-03-04 16:09:50,313 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing run() on child: <plugin.sync.modes.fast_pull.movies.Movies object at 0x0615EDD0>
2019-03-04 16:09:50,619 - plugin.sync.modes.core.base.mode (5db4) :  INFO (plugin.sync.modes.core.base.mode:127) - Executing run() on child: <plugin.sync.modes.fast_pull.shows.Shows object at 0x0615E230>
2019-03-04 16:09:50,710 - plugin.sync.main                 (5db4) :  WARNING (plugin.sync.main:177) - Exception raised in sync task: 'NullWriter' object has no attribute 'flush'
Traceback (most recent call last):
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\plugin\sync\main.py", line 173, in run_wrapper
    self.run()
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\plugin\sync\main.py", line 260, in run
    'stop'
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\plugin\sync\main.py", line 277, in _trigger
    func()
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\elapsed\main.py", line 64, in inner
    return func(*args, **kwargs)
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\plugin\sync\modes\full.py", line 36, in run
    self.modes[SyncMode.FastPull].execute_children('run')
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\plugin\sync\modes\core\base\mode.py", line 136, in execute_children
    func()
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\elapsed\main.py", line 64, in inner
    return func(*args, **kwargs)
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\plugin\sync\modes\fast_pull\shows.py", line 84, in run
    self.run_episodes()
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\plugin\sync\modes\fast_pull\shows.py", line 157, in run_episodes
    for ids, guid, (season_num, episode_num), p_show, p_season, p_episode in self.p_episodes:
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\plex_database\library.py", line 605, in episodes_iterator
    episode['part']['file']
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\plex_database\matcher.py", line 25, in process_episode
    c_episodes.extend(self.extend_episode(file, identifier))
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\plex_metadata\matcher.py", line 198, in extend_episode
    c_identifiers = self.parse(file_name)
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\plex_metadata\matcher.py", line 115, in parse
    result = self._caper.parse(file_name)
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\caper\__init__.py", line 207, in parse
    return self.parsers[parser](self.debug).run(closures)
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\caper\parsers\scene.py", line 252, in run
    .until_fragment(left_sep__eq='-', right__eq=None)\
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\caper\group.py", line 272, in execute
    for node_result in self.parse_subject(head, next_subject):
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\caper\group.py", line 119, in parse_subject
    return self.parse_fragment(parent_head, subject)
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\caper\group.py", line 126, in parse_fragment
    nodes, match = self.match(parent_head, parent_node, subject)
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\caper\group.py", line 202, in match
    match = step.execute(subject)
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\caper\step.py", line 51, in execute
    weight, result, num_fragments = self.capture_group.parser.matcher.fragment_match(fragment, self.regex)
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\caper\matcher.py", line 127, in fragment_match
    for match in pattern.process(matches):
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\caper\objects.py", line 205, in process
    Logr.warn('Exception raised while transforming matches: %s', ex)
  File "C:\Plex Media Server\Plug-ins\Trakttv.bundle\Contents\Libraries\Shared\logr\__init__.py", line 153, in warning
    Logr.get_logger().warning(msg, *args, **kwargs)
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\logging\__init__.py", line 1179, in warning
    self._log(WARNING, msg, args, **kwargs)
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\logging\__init__.py", line 1286, in _log
    self.handle(record)
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\logging\__init__.py", line 1296, in handle
    self.callHandlers(record)
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\logging\__init__.py", line 1336, in callHandlers
    hdlr.handle(record)
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\logging\__init__.py", line 759, in handle
    self.emit(record)
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\logging\__init__.py", line 889, in emit
    self.handleError(record)
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\logging\__init__.py", line 812, in handleError
    None, sys.stderr)
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\traceback.py", line 124, in print_exception
    _print(file, 'Traceback (most recent call last):')
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\traceback.py", line 13, in _print
    file.write(str+terminator)
  File "C:\Users\Omitted\AppData\Roaming\Python\Python27\site-packages\colorama\ansitowin32.py", line 41, in write
    self.__convertor.write(text)
  File "C:\Users\Omitted\AppData\Roaming\Python\Python27\site-packages\colorama\ansitowin32.py", line 162, in write
    self.write_and_convert(text)
  File "C:\Users\Omitted\AppData\Roaming\Python\Python27\site-packages\colorama\ansitowin32.py", line 190, in write_and_convert
    self.write_plain_text(text, cursor, len(text))
  File "C:\Users\Omitted\AppData\Roaming\Python\Python27\site-packages\colorama\ansitowin32.py", line 196, in write_plain_text
    self.wrapped.flush()
AttributeError: 'NullWriter' object has no attribute 'flush'
2019-03-04 16:09:51,394 - plugin.core.backup.sources.database (5db4) :  INFO (plugin.core.backup.sources.database:25) - [trakt\1] Backing up database to u'C:\\Plex Media Server\\Plug-in Support\\Data\\com.plexapp.plugins.trakttv\\Backups\\trakt\\1.bgr\\2019\\03\\04_160951_156.db'
2019-03-04 16:09:51,437 - plugin.sync.main                 (5db4) :  INFO (plugin.sync.main:222) - (0) Done
rg9400 commented 5 years ago

If anyone is having issues with this or similar issues on Plex 1.15, I fixed my problem by switching Matcher from "Plex Extended" to just "Plex"