Skip to content

Python Error when using crossmatch plugin #1503

@jasonlyle88

Description

@jasonlyle88

Expected behaviour:

Crossmatch plugin to filter torrents

Actual behaviour:

Python error on execution of crossmatch plugin

Steps to reproduce:

flexget execute --tasks process-movies

Config:

templates:
  input-filesystem_movies:
    no_entries_ok: yes
    metainfo_movie: yes
    filesystem:
      path: '/nas/diskstation/Torrents/staging/movies'
      regexp: '^.*[^\.completed]$'
      recursive: no
      retrieve:
        - files
        - dirs

  filter-filesystem_movies:
    crossmatch:
      from:
        - filesystem:
            path: '/nas/diskstation/Torrents/staging/movies'
            mask: '*.completed'
            recursive: no
            retrieve:
              - files
      fields:
        - movie_name
      action: accept
      exact: no

  output-move_movies:
    move:
      allow_dir: yes
      to: '/nas/diskstation/Torrents/JMLTESTMOVIE/{{movie_name}} ({{movie_year}}) [{{quality|upper}}]/'
      #to: '/nas/diskstation/Torrents/Movies_non-normalized/{{movie_name}} ({{movie_year}}) [{{quality|upper}}]/'
      keep_extension: yes

tasks:
  process-movies:
    priority: 2
    template: [input-filesystem_movies, filter-filesystem_movies, output-move_movies]

Log:

Crash Log:

2016-11-15 08:35 DEBUG    manager                       New config data loaded.
2016-11-15 08:35 DEBUG    schema                        current flexget version already exist in db 2.5.22
2016-11-15 08:35 DEBUG    parsing                       setting default movie parser to internal. (options: {u'internal': <flexget.plugins.parsers.parser_internal.ParserInternal object at 0x7ff05bc8af50>, u'guessit': <flexget.plugins.parsers.parser_guessit.ParserGuessit object at 0x7ff05d315490>})
2016-11-15 08:35 DEBUG    parsing                       setting default series parser to internal. (options: {u'internal': <flexget.plugins.parsers.parser_internal.ParserInternal object at 0x7ff05bc8af50>, u'guessit': <flexget.plugins.parsers.parser_guessit.ParserGuessit object at 0x7ff05d315490>})
2016-11-15 08:35 DEBUG    cron_env                      Encoding UTF-8 stored
2016-11-15 08:35 DEBUG    util.simple_persistence                 setting key terminal_encoding value 'UTF-8'
2016-11-15 08:35 DEBUG    task_queue                    task queue shutdown requested
2016-11-15 08:35 VERBOSE  task_queue                    There are 1 tasks to execute. Shutdown will commence when they have completed.
2016-11-15 08:35 INFO     ipc.rpyc                      server started on [127.0.0.1]:15553
2016-11-15 08:35 DEBUG    task          process-movies  executing process-movies
2016-11-15 08:35 DEBUG    template      process-movies  Merging template input-filesystem_movies into task process-movies
2016-11-15 08:35 DEBUG    template      process-movies  Merging template filter-filesystem_movies into task process-movies
2016-11-15 08:35 DEBUG    template      process-movies  Merging template output-move_movies into task process-movies
2016-11-15 08:35 VERBOSE  filesystem    process-movies  Starting to scan folders.
2016-11-15 08:35 VERBOSE  filesystem    process-movies  Scanning folder /nas/diskstation/Torrents/staging/movies. Recursion is set to False.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Scanning /nas/diskstation/Torrents/staging/movies
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/The.Daily.Show.2016.11.10.Deborah.Lee.James.HDTV.x264-CROOKS[eztv].mkv qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/War.Dogs.2016.BRRip.XViD-ETRG qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/The.Daily.Show.2016.11.10.Deborah.Lee.James.HDTV.x264-CROOKS[eztv].mkv.completed qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/War.Dogs.2016.BRRip.XViD-ETRG.completed qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/Jason.Bourne.2016.720p.WEBRip.x264.JML-FAKE.mkv qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    backlog       process-movies  0 entries purged from backlog
2016-11-15 08:35 VERBOSE  details       process-movies  Produced 3 entries.
2016-11-15 08:35 DEBUG    parser_internal process-movies  Parsing movie: `The.Daily.Show.2016.11.10.Deborah.Lee.James.HDTV.x264-CROOKS[eztv]` kwargs: {}
2016-11-15 08:35 DEBUG    movieparser   process-movies  parts: [u'The', u'Daily', u'Show', u'2016', u'11', u'10', u'Deborah', u'Lee', u'James', u'HDTV', u'x264-CROOKS', u'eztv'], cut is: 2016
2016-11-15 08:35 DEBUG    movieparser   process-movies  after parts check, cut data would be: `The Daily Show` abs_cut: 14
2016-11-15 08:35 DEBUG    movieparser   process-movies  quality start: 44
2016-11-15 08:35 DEBUG    movieparser   process-movies  data cut to `The Daily Show` - this will be the name
2016-11-15 08:35 DEBUG    parser_internal process-movies  Parsing result: <MovieParser(name=The Daily Show,year=2016,quality=hdtv h264)> (in 1.44 ms)
2016-11-15 08:35 DEBUG    parser_internal process-movies  Parsing movie: `War.Dogs.2016.BRRip.XViD-ETRG` kwargs: {}
2016-11-15 08:35 DEBUG    movieparser   process-movies  parts: [u'War', u'Dogs', u'2016', u'BRRip', u'XViD-ETRG'], cut is: 2016
2016-11-15 08:35 DEBUG    movieparser   process-movies  after parts check, cut data would be: `War Dogs` abs_cut: 8
2016-11-15 08:35 DEBUG    movieparser   process-movies  quality start: 14
2016-11-15 08:35 DEBUG    movieparser   process-movies  data cut to `War Dogs` - this will be the name
2016-11-15 08:35 DEBUG    parser_internal process-movies  Parsing result: <MovieParser(name=War Dogs,year=2016,quality=bluray xvid)> (in 0.721 ms)
2016-11-15 08:35 DEBUG    parser_internal process-movies  Parsing movie: `Jason.Bourne.2016.720p.WEBRip.x264.JML-FAKE` kwargs: {}
2016-11-15 08:35 DEBUG    movieparser   process-movies  parts: [u'Jason', u'Bourne', u'2016', u'720p', u'WEBRip', u'x264', u'JML-FAKE'], cut is: 2016
2016-11-15 08:35 DEBUG    movieparser   process-movies  after parts check, cut data would be: `Jason Bourne` abs_cut: 12
2016-11-15 08:35 DEBUG    movieparser   process-movies  quality start: 18
2016-11-15 08:35 DEBUG    movieparser   process-movies  data cut to `Jason Bourne` - this will be the name
2016-11-15 08:35 DEBUG    parser_internal process-movies  Parsing result: <MovieParser(name=Jason Bourne,year=2016,quality=720p webrip h264)> (in 0.76 ms)
2016-11-15 08:35 VERBOSE  filesystem    process-movies  Starting to scan folders.
2016-11-15 08:35 VERBOSE  filesystem    process-movies  Scanning folder /nas/diskstation/Torrents/staging/movies. Recursion is set to False.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Scanning /nas/diskstation/Torrents/staging/movies
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/The.Daily.Show.2016.11.10.Deborah.Lee.James.HDTV.x264-CROOKS[eztv].mkv qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/War.Dogs.2016.BRRip.XViD-ETRG qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/The.Daily.Show.2016.11.10.Deborah.Lee.James.HDTV.x264-CROOKS[eztv].mkv.completed qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/War.Dogs.2016.BRRip.XViD-ETRG.completed qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/Jason.Bourne.2016.720p.WEBRip.x264.JML-FAKE.mkv qualifies to be added as an entry.
2016-11-15 08:35 CRITICAL task          process-movies  BUG: Unhandled error in plugin crossmatch: coercing to Unicode: need string or buffer, newobject found
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flexget/task.py", line 477, in __run_plugin
    return method(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flexget/event.py", line 23, in __call__
    return self.func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flexget/plugins/filter/crossmatch.py", line 72, in on_task_filter
    common = self.entry_intersects(entry, generated_entry, fields, config.get('exact'))
  File "/usr/local/lib/python2.7/dist-packages/flexget/plugins/filter/crossmatch.py", line 106, in entry_intersects
    if v2 in v1:
TypeError: coercing to Unicode: need string or buffer, newobject found

Debug Log:

flexget --debug execute --tasks process-movies
2016-11-15 08:35 DEBUG    manager                       Figuring out config load paths
2016-11-15 08:35 DEBUG    manager                       Found config: /root/.flexget/config.yml
2016-11-15 08:35 DEBUG    manager                       Config file /root/.flexget/config.yml selected
2016-11-15 08:35 DEBUG    manager                       sys.defaultencoding: ascii
2016-11-15 08:35 DEBUG    manager                       sys.getfilesystemencoding: UTF-8
2016-11-15 08:35 DEBUG    manager                       os.path.supports_unicode_filenames: False
2016-11-15 08:35 DEBUG    plugin                        Trying to load plugins from: [u'/root/.flexget/plugins', '/usr/local/lib/python2.7/dist-packages/flexget/plugins']
2016-11-15 08:35 DEBUG    plugin                        (u'Plugin `%s` requires `%s` to load.', u'memusage', u'ext lib `guppy`')
2016-11-15 08:35 DEBUG    safe                          Reading from cache file /tmp/safe-0.4.words.cache
2016-11-15 08:35 DEBUG    deluge                        ConfigManager started..
2016-11-15 08:35 DEBUG    plugin                        Plugins took 0.97 seconds to load. 259 plugins in registry.
2016-11-15 08:35 DEBUG    manager                       Connecting to: sqlite:////root/.flexget/db-config.sqlite
2016-11-15 08:35 DEBUG    manager                       config_name: config
2016-11-15 08:35 DEBUG    manager                       config_base: /root/.flexget
2016-11-15 08:35 DEBUG    secrets                       trying to load secrets from file
2016-11-15 08:35 DEBUG    secrets                       updating DB with secret file contents
2016-11-15 08:35 DEBUG    manager                       New config data loaded.
2016-11-15 08:35 DEBUG    schema                        current flexget version already exist in db 2.5.22
2016-11-15 08:35 DEBUG    parsing                       setting default movie parser to internal. (options: {u'internal': <flexget.plugins.parsers.parser_internal.ParserInternal object at 0x7ff05bc8af50>, u'guessit': <flexget.plugins.parsers.parser_guessit.ParserGuessit object at 0x7ff05d315490>})
2016-11-15 08:35 DEBUG    parsing                       setting default series parser to internal. (options: {u'internal': <flexget.plugins.parsers.parser_internal.ParserInternal object at 0x7ff05bc8af50>, u'guessit': <flexget.plugins.parsers.parser_guessit.ParserGuessit object at 0x7ff05d315490>})
2016-11-15 08:35 DEBUG    cron_env                      Encoding UTF-8 stored
2016-11-15 08:35 DEBUG    util.simple_persistence                 setting key terminal_encoding value 'UTF-8'
2016-11-15 08:35 DEBUG    task_queue                    task queue shutdown requested
2016-11-15 08:35 VERBOSE  task_queue                    There are 1 tasks to execute. Shutdown will commence when they have completed.
2016-11-15 08:35 INFO     ipc.rpyc                      server started on [127.0.0.1]:15553
2016-11-15 08:35 DEBUG    task          process-movies  executing process-movies
2016-11-15 08:35 DEBUG    template      process-movies  Merging template input-filesystem_movies into task process-movies
2016-11-15 08:35 DEBUG    template      process-movies  Merging template filter-filesystem_movies into task process-movies
2016-11-15 08:35 DEBUG    template      process-movies  Merging template output-move_movies into task process-movies
2016-11-15 08:35 VERBOSE  filesystem    process-movies  Starting to scan folders.
2016-11-15 08:35 VERBOSE  filesystem    process-movies  Scanning folder /nas/diskstation/Torrents/staging/movies. Recursion is set to False.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Scanning /nas/diskstation/Torrents/staging/movies
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/The.Daily.Show.2016.11.10.Deborah.Lee.James.HDTV.x264-CROOKS[eztv].mkv qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/War.Dogs.2016.BRRip.XViD-ETRG qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/The.Daily.Show.2016.11.10.Deborah.Lee.James.HDTV.x264-CROOKS[eztv].mkv.completed qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/War.Dogs.2016.BRRip.XViD-ETRG.completed qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/Jason.Bourne.2016.720p.WEBRip.x264.JML-FAKE.mkv qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    backlog       process-movies  0 entries purged from backlog
2016-11-15 08:35 VERBOSE  details       process-movies  Produced 3 entries.
2016-11-15 08:35 DEBUG    parser_internal process-movies  Parsing movie: `The.Daily.Show.2016.11.10.Deborah.Lee.James.HDTV.x264-CROOKS[eztv]` kwargs: {}
2016-11-15 08:35 DEBUG    movieparser   process-movies  parts: [u'The', u'Daily', u'Show', u'2016', u'11', u'10', u'Deborah', u'Lee', u'James', u'HDTV', u'x264-CROOKS', u'eztv'], cut is: 2016
2016-11-15 08:35 DEBUG    movieparser   process-movies  after parts check, cut data would be: `The Daily Show` abs_cut: 14
2016-11-15 08:35 DEBUG    movieparser   process-movies  quality start: 44
2016-11-15 08:35 DEBUG    movieparser   process-movies  data cut to `The Daily Show` - this will be the name
2016-11-15 08:35 DEBUG    parser_internal process-movies  Parsing result: <MovieParser(name=The Daily Show,year=2016,quality=hdtv h264)> (in 1.44 ms)
2016-11-15 08:35 DEBUG    parser_internal process-movies  Parsing movie: `War.Dogs.2016.BRRip.XViD-ETRG` kwargs: {}
2016-11-15 08:35 DEBUG    movieparser   process-movies  parts: [u'War', u'Dogs', u'2016', u'BRRip', u'XViD-ETRG'], cut is: 2016
2016-11-15 08:35 DEBUG    movieparser   process-movies  after parts check, cut data would be: `War Dogs` abs_cut: 8
2016-11-15 08:35 DEBUG    movieparser   process-movies  quality start: 14
2016-11-15 08:35 DEBUG    movieparser   process-movies  data cut to `War Dogs` - this will be the name
2016-11-15 08:35 DEBUG    parser_internal process-movies  Parsing result: <MovieParser(name=War Dogs,year=2016,quality=bluray xvid)> (in 0.721 ms)
2016-11-15 08:35 DEBUG    parser_internal process-movies  Parsing movie: `Jason.Bourne.2016.720p.WEBRip.x264.JML-FAKE` kwargs: {}
2016-11-15 08:35 DEBUG    movieparser   process-movies  parts: [u'Jason', u'Bourne', u'2016', u'720p', u'WEBRip', u'x264', u'JML-FAKE'], cut is: 2016
2016-11-15 08:35 DEBUG    movieparser   process-movies  after parts check, cut data would be: `Jason Bourne` abs_cut: 12
2016-11-15 08:35 DEBUG    movieparser   process-movies  quality start: 18
2016-11-15 08:35 DEBUG    movieparser   process-movies  data cut to `Jason Bourne` - this will be the name
2016-11-15 08:35 DEBUG    parser_internal process-movies  Parsing result: <MovieParser(name=Jason Bourne,year=2016,quality=720p webrip h264)> (in 0.76 ms)
2016-11-15 08:35 VERBOSE  filesystem    process-movies  Starting to scan folders.
2016-11-15 08:35 VERBOSE  filesystem    process-movies  Scanning folder /nas/diskstation/Torrents/staging/movies. Recursion is set to False.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Scanning /nas/diskstation/Torrents/staging/movies
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/The.Daily.Show.2016.11.10.Deborah.Lee.James.HDTV.x264-CROOKS[eztv].mkv qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/War.Dogs.2016.BRRip.XViD-ETRG qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/The.Daily.Show.2016.11.10.Deborah.Lee.James.HDTV.x264-CROOKS[eztv].mkv.completed qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/War.Dogs.2016.BRRip.XViD-ETRG.completed qualifies to be added as an entry.
2016-11-15 08:35 DEBUG    filesystem    process-movies  Checking if /nas/diskstation/Torrents/staging/movies/Jason.Bourne.2016.720p.WEBRip.x264.JML-FAKE.mkv qualifies to be added as an entry.
2016-11-15 08:35 CRITICAL task          process-movies  BUG: Unhandled error in plugin crossmatch: coercing to Unicode: need string or buffer, newobject found
2016-11-15 08:35 CRITICAL manager       process-movies  An unexpected crash has occurred. Writing crash report to /root/.flexget/crash_report.2016.11.15.083550722595.log. Please verify you are running the latest version of flexget by using "flexget -V" from CLI or by using version_checker plugin at http://flexget.com/wiki/Plugins/version_checker. You are currently using version 2.5.22
2016-11-15 08:35 DEBUG    manager       process-movies  Traceback:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flexget/task.py", line 477, in __run_plugin
    return method(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flexget/event.py", line 23, in __call__
    return self.func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flexget/plugins/filter/crossmatch.py", line 72, in on_task_filter
    common = self.entry_intersects(entry, generated_entry, fields, config.get('exact'))
  File "/usr/local/lib/python2.7/dist-packages/flexget/plugins/filter/crossmatch.py", line 106, in entry_intersects
    if v2 in v1:
TypeError: coercing to Unicode: need string or buffer, newobject found
2016-11-15 08:35 WARNING  task          process-movies  Aborting task (plugin: crossmatch)
2016-11-15 08:35 DEBUG    backlog       process-movies  Remembering all entries to backlog because of task abort.
2016-11-15 08:35 DEBUG    backlog       process-movies  Saving The.Daily.Show.2016.11.10.Deborah.Lee.James.HDTV.x264-CROOKS[eztv]
2016-11-15 08:35 DEBUG    backlog       process-movies  Saving War.Dogs.2016.BRRip.XViD-ETRG
2016-11-15 08:35 DEBUG    backlog       process-movies  Saving Jason.Bourne.2016.720p.WEBRip.x264.JML-FAKE
2016-11-15 08:35 DEBUG    task_queue                    task process-movies aborted: TaskAbort(reason=BUG: Unhandled error in plugin crossmatch: coercing to Unicode: need string or buffer, newobject found, silent=False)
2016-11-15 08:35 DEBUG    task_queue                    task queue shut down
2016-11-15 08:35 INFO     ipc.rpyc                      listener closed
2016-11-15 08:35 INFO     ipc.rpyc                      server has terminated
2016-11-15 08:35 DEBUG    util.simple_persistence                 Flushing simple persistence for task None to db.
2016-11-15 08:35 DEBUG    manager                       Shutting down
2016-11-15 08:35 DEBUG    manager                       Removed /root/.flexget/.config-lock

Additional information:

  • Flexget Version: 2.5.22
  • Python Version: Python 2.7.6
  • Installation method: pip, no virtualenv
  • OS and version: Ubuntu 14.04
  • Link to crash log:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions