question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

During handling of the above exception, another exception occurred:

See original GitHub issue

Expected behaviour:

To run as intended

Actual behaviour:

Flexget commands ends in error

Steps to reproduce:

  • Step 1: execute any flexget command

Config:

variables: secret.yml
templates:
  global:
    no_entries_ok: yes
    notify:
      abort:
        via:
          - pushbullet:
              api_key: '{? pushbullet.api ?}'

##################################################################
#    TV TEMPLATE
##################################################################

  vic_tv:
    set:
      path: /media/CHEWYHDD/CHEWY/Videos/Downloads
      move_completed_path: /media/CHEWYHDD/CHEWY/Videos/TV/NEW EPISODES/{{tvdb_series_name}}/Season {{tvdb_season}}/
      label: NEW EPISODES
    configure_series:
      from:
        trakt_list:
          username: '{? trak.usr ?}'
          account: '{? trak.acct ?}'
          list: vic tv
          type: shows
      settings:
        quality: 1080p
        propers: 16 hours
        specials: no
    verify_ssl_certificates: no
    thetvdb_lookup: yes
    series:
      - Shameless (2011):
          alternate_name: Shameless (US)
      - Powers (2015):
          alternate_name: Powers (US)
      - Real Time with Bill Maher (2003):
          identified_by: ep
      - Masterchef (2010):
          alternate_name: Masterchef (US)      
    deluge:
      host: localhost
      port: '{? deluge.port ?}'
      username: '{? deluge.usr ?}'
      password: '{? deluge.pwd ?}'

##################################################################
#    DOWNLOAD NOTIFICATION TEMPLATE
##################################################################

  tv_notify:
    thetvdb_lookup: yes
    notify:
      entries:
        title: "{{tvdb_series_name}}"
        message: "Season: {{tvdb_season}} | Episode No: {{tvdb_episode}} | {{tvdb_network}}\r\n‣ Episode:\u0009{% if tvdb_ep_name is defined %}{{tvdb_ep_name}}{% endif %}\r\n‣ Air date:\u0009\u0009{% if tvdb_ep_air_date is defined %}{{tvdb_ep_air_date.strftime('%m.%d.%Y')}}{% endif %}\r\n‣ Summary: {{tvdb_ep_overview}}"
        via:
          - pushbullet:
              api_key: '{? pushbullet.api ?}'


  movie_notify:
    imdb_lookup: yes
    notify:
      entries:
        title: "{{imdb_name}}"
        message: "{{imdb_url}}\nIMDB SCORE: {{imdb_score}}\nSize: {{content_size}}MB\n\n {{imdb_plot_outline}}"
        via:
          - pushbullet:
              api_key: '{? pushbullet.api ?}'


#

##################################################################
#   MOVIE TEMPLATE
##################################################################

  movie:
    tmdb_lookup: yes 
    proper_movies: no
    content_size:
      max: 5000
      strict: no
    content_filter: 
      reject:
        - '*.zip'
        - '*.wmv'
        - '*.wma'
        - '*[cC]odec*'
        - '*[rR]eadme*'
    exists_movie:
      - /media/CHEWYHDD/CHEWY/Videos/Movies
      - /media/CHEWYHDD/CHEWY/Videos/Addison/Addison Movies


#################################################################
#    FILTERS TEMPLATES
##################################################################

  filters:
    regexp:
      reject:
        - \bmsd\b: {from: title}
        - \bgreek\b: {from: title}
        - \bgerman\b: {from: title}
        - \bfrench\b: {from: title}
        - \brussian\b: {from: title}
        - \bswedish\b: {from: title}
        - \bspanish\b: {from: title}
        - \bhindi\b: {from: title}
        - \barabic\b: {from: title}
        - \bitalian\b: {from: title}
        - \bpolish\b: {from: title}
        - \bromanian\b: {from: title}
        - \bdutch\b: {from: title}
        - \bczech\b: {from: title}
        - \bturkish\b: {from: title}
        - \brmvb\b: {from: title}
#        - \bkorean\b: {from: title}
        - \bwmv\b: {from: title}
#        - (s|d)ub(s|bed)?\b: {from: title}
        - \bFRENCH\b: {from: title}
        - \bSPANiSH\b: {from: title}
        - \bLatino\b: {from: title}
        - \btrailer\b: {from: title}
        - \bHDTC\b: {from: title} 
        - \bHDTS\b: {from: title}
        - \bHQTS\b: {from: title}
        - \bHDcam\b: {from: title} 
        - \bR5\b: {from: title}
        - \b3-?D\b: {from: title}                             # I don't have any 3D displays
        - \btrailer\b: {from: title}                          # I've gotten a few trailers that matched as movies. VERY annoying
        - \bTS\b: {from: title}
        - \bCam\b: {from: title}
        - '{C_P}': {from: title}                              # The following are groups with poor quality releases
        - TrTd TeaM: {from: title}
        - \[TNTVillage\]: {from: title}
        - \bFLEET\b: {from: title}
        - \b0SEC\b: {from: title}
        - \[facepalm\]: {from: title}
        - FASTSUB: {from: title}
        - VOSTFR: {from: title}
        - Subtitulado: {from: title}
        - \bNORDiC\b: {from: title}
        - \biPad\b: {from: title}
#        - \b(ita|ger|fra|spa|swe|nor|nordic|fr|kor|uk|esp|nl|pl|spanish)\b: {from: title}
        - \bR6\b: {from: title}
        - \bTemporada\b: {from: title}
        - \bDual\b: {from: title}
        - \bTamil*\b: {from: title}
        - \bJapanese\b: {from: title}
        - \bJajji!\b: {from: title}
        - \bdragons.den.(ca|uk)\b: {from: title}
        - \bx265\b: {from: title}
#        - \HC\b: {from: title}
        - \b480p\b: {from: title}
        - \b.TamilRock*\b: {from: title}
        - \b1xbet\b: {from: title}
        - \bCAMRip\b: {from: title}
        - \bHDCAMRip\b: {from: title}


##################################################################
#    TASK SCHEDULES
##################################################################


schedules:

  - tasks: tv_shows
    interval:
      minutes: 5

  - tasks: IMDB
    interval:
      minutes: 30

  - tasks: passthepopcorn
    interval: 
      hours: 2

  - tasks: movies
    interval:
      hours: 1


##################################################################
#    TASKS 
##################################################################


tasks:

  tv_shows:
    priority: 1
    template:
      - vic_tv
      - tv_notify
      - filters
    inputs:
      - rss: '{? btn.url ?}'
#      - rss: '{? mtv.url ?}'


  IMDB:
    imdb_list:
      login: '{? imdb.usr ?}'
      password: '{? imdb.pwd ?}'
      list: watchlist
    accept_all: yes
    seen: 
      fields: [title]
    list_add:
      - movie_list: vic_movies
    priority: 2




  passthepopcorn:
    priority: 4
    template:
      - movie
      - movie_notify
      - filters
    quality: hdrip+
    imdb_lookup: yes
    list_match:
      from:
        - movie_list: vic_movies
    list_add:
      - entry_list: downloaded_movies
    verify_ssl_certificates: no
    inputs:
      - rss: '{? ptp.url ?}'
    set:
      path: /media/CHEWYHDD/CHEWY/Videos/Downloads
      move_completed_path: /media/CHEWYHDD/CHEWY/Videos/Movies/
    deluge:
      host: localhost
      port: '{? deluge.port ?}'
      username: '{? deluge.usr ?}'
      password: '{? deluge.pwd ?}'
      label: Movies

  movies:
    priority: 5
    template:
      - movie
      - movie_notify
      - filters
    discover:
      release_estimations: 
        optimistic: 60 days
      what:
        - movie_list: vic_movies
      from:
        - rarbg:
            category: [14, 15, 16, 17, 21, 22, 42, 44, 45, 46, 47, 48]
        - 1337x: yes
        - piratebay:
            category: movies
    interval: 1 hour
    quality: 720p+
    list_match:
      from:
        - movie_list: vic_movies
    list_add:
      - entry_list: downloaded_movies
    torrent_alive: 10
    verify_ssl_certificates: no
    set:
      path: /media/CHEWYHDD/CHEWY/Videos/Downloads
      move_completed_path: /media/CHEWYHDD/CHEWY/Videos/Movies/
    deluge:
      host: localhost
      port: '{? deluge.port ?}'
      username: '{? deluge.usr ?}'
      password: '{? deluge.pwd ?}'
      ratio: .01
      label: Public

Log:

(click to expand)
pi@pi4:~ $ source ~/flexget/bin/activate
(flexget) pi@pi4:~ $ flexget -L debug check
2019-09-27 12:29 DEBUG manager Figuring out config load paths
2019-09-27 12:29 DEBUG manager Adding virtualenv path
2019-09-27 12:29 DEBUG manager Found config: /home/pi/flexget/config.yml
2019-09-27 12:29 DEBUG manager Config file /home/pi/flexget/config.yml selected
2019-09-27 12:29 DEBUG manager sys.defaultencoding: utf-8
2019-09-27 12:29 DEBUG manager sys.getfilesystemencoding: utf-8
2019-09-27 12:29 DEBUG manager flexget detected io encoding: utf-8
2019-09-27 12:29 DEBUG manager os.path.supports_unicode_filenames: False
2019-09-27 12:29 DEBUG plugin Trying to load plugins from: ['/home/pi/flexget/plugins', '/home/pi/flexget/lib/python3.7/site-packages/flexget/plugins']
2019-09-27 12:29 DEBUG plugin Plugin `memusage` requires plugin `ext lib `guppy`` to load.
2019-09-27 12:29 DEBUG plugin Trying to load components from: ['/home/pi/flexget/components', '/home/pi/flexget/lib/python3.7/site-packages/flexget/components']
2019-09-27 12:29 DEBUG plugin Plugins took 3.65 seconds to load. 297 plugins in registry.
2019-09-27 12:29 DEBUG manager Connecting to: sqlite:////home/pi/flexget/db-config.sqlite2019-09-27 12:29 WARNING check Config line 173 is likely missing ':' at the end
2019-09-27 12:29 WARNING check Config line 177 is likely missing ':' at the end
2019-09-27 12:29 WARNING check Config line 181 is likely missing ':' at the end
2019-09-27 12:29 WARNING check Config line 185 is likely missing ':' at the end
2019-09-27 12:29 VERBOSE check Pre-checked 323 configuration lines
2019-09-27 12:29 DEBUG manager config_name: config
2019-09-27 12:29 DEBUG manager config_base: /home/pi/flexget
2019-09-27 12:29 DEBUG variables trying to load variables from file
2019-09-27 12:29 DEBUG manager Removed /home/pi/flexget/.config-lock
Traceback (most recent call last):
File "/home/pi/flexget/lib/python3.7/site-packages/flexget/components/variables/variables.py", line 45, in variables_from_file
variables_dict = yaml.safe_load(f.read())
File "/home/pi/flexget/lib/python3.7/site-packages/yaml/__init__.py", line 162, in safe_load
return load(stream, SafeLoader)
File "/home/pi/flexget/lib/python3.7/site-packages/yaml/__init__.py", line 112, in load
loader = Loader(stream)
File "/home/pi/flexget/lib/python3.7/site-packages/yaml/loader.py", line 34, in __init__
Reader.__init__(self, stream)
File "/home/pi/flexget/lib/python3.7/site-packages/yaml/reader.py", line 74, in __init__
self.check_printable(stream)
File "/home/pi/flexget/lib/python3.7/site-packages/yaml/reader.py", line 144, in check_printable
'unicode', "special characters are not allowed")
yaml.reader.ReaderError: unacceptable character #x0000: special characters are not allowed
in "", position 988

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/flexget/bin/flexget", line 10, in 
sys.exit(main())
File "/home/pi/flexget/lib/python3.7/site-packages/flexget/__init__.py", line 47, in main
manager.start()
File "/home/pi/flexget/lib/python3.7/site-packages/flexget/manager.py", line 399, in start
self.initialize()
File "/home/pi/flexget/lib/python3.7/site-packages/flexget/manager.py", line 251, in initialize
self.load_config()
File "/home/pi/flexget/lib/python3.7/site-packages/flexget/manager.py", line 720, in load_config
self.update_config(config)
File "/home/pi/flexget/lib/python3.7/site-packages/flexget/manager.py", line 731, in update_config
self.config = self.validate_config(config)
File "/home/pi/flexget/lib/python3.7/site-packages/flexget/manager.py", line 787, in validate_config
config = fire_event('manager.before_config_validate', config, self)
File "/home/pi/flexget/lib/python3.7/site-packages/flexget/event.py", line 113, in fire_event
result = event(*args, **kwargs)
File "/home/pi/flexget/lib/python3.7/site-packages/flexget/event.py", line 23, in __call__
return self.func(*args, **kwargs)
File "/home/pi/flexget/lib/python3.7/site-packages/flexget/components/variables/variables.py", line 89, in process_variables
variables = variables_from_file(manager.config_base, config['variables'])
File "/home/pi/flexget/lib/python3.7/site-packages/flexget/components/variables/variables.py", line 47, in variables_from_file
raise PluginError('Invalid variables file: %s' % e)
flexget.plugin.PluginError: Invalid variables file: unacceptable character #x0000: special characters are not allowed
in "", position 988

Additional information:

  • FlexGet version: 2.21.21
  • Python version: 3.7 virtualenv
  • Installation method: pip
  • Using daemon (yes/no):yes
  • OS and version: Debian buster, Raspberry Pi 4
  • Link to crash log:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
paranoidicommented, Sep 29, 2019

Seems like your secrets file has some weird characters in it that cause yaml loading library to throw up. We should handle the error better though …

0reactions
paranoidicommented, Sep 29, 2019

@chewy74 put it in quotes, use forums for questions

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - During handling of the above exception, another ...
Currently, you having an issue with raising the ValueError exception inside another caught exception. The reasoning for this solution ...
Read more >
8. Exceptions — learning-python 0.9 documentation
It's the most common way to raise an instance of some exception. ... by zero During handling of the above exception, another exception...
Read more >
Python | Raising an Exception to Another Exception
During handling of the above exception, another exception occurred: Traceback (most recent call last): File " ", line 1, in File " ",...
Read more >
During handling of the above exception, another exception ...
part of the reason for this is that line 52 is in a try: clause, so exceptions are being handled there. 1. 2....
Read more >
During handling of the above exception, another ... - GitHub
During handling of the above exception, another exception occurred: Traceback (most recent call last): File "train.py", line 6, in
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found