eriknyquist / nedry

Nedry is a fun & useful discord bot with a modular plugin system (formerly "twitch_monitor_discord_bot")
Apache License 2.0
10 stars 4 forks source link

AttributeError: 'list' object has no attribute 'get' #6

Closed rkantos closed 9 months ago

rkantos commented 1 year ago

Unexpectedly I started getting this error after restarting nedry. Didn't change anything in config.. Just added a couple Twitch nicknames, but I don't think it is related to those. Removing social_credit from enable_plugins and plugin_data makes Nedry run again.

csgo@csgo2:~$ cd ~ && python3 -m nedry default_bot_config.json
[2023-04-28 21:18:50,154][INFO][__init__:12]: nedry 2.4.2
[2023-04-28 21:18:50,474][DEBUG][twitch_monitor:70]: Connecting to Twitch
[2023-04-28 21:19:03,455][INFO][twitch_monitor:80]: Connected to twitch
[2023-04-28 21:19:03,456][DEBUG][twitch_monitor:85]: Started twitch monitor thread
[2023-04-28 21:19:03,468][WARNING][client:257]: PyNaCl is not installed, voice will NOT be supported
[2023-04-28 21:19:03,469][INFO][plugin:72]: loaded plugin knock_knock_jokes 1.0.0
[2023-04-28 21:19:03,469][INFO][plugin:72]: loaded plugin wiki 1.0.0
[2023-04-28 21:19:03,469][INFO][plugin:72]: loaded plugin mock 1.0.0
[2023-04-28 21:19:03,469][INFO][plugin:72]: loaded plugin schedule 1.2.0
[2023-04-28 21:19:03,469][INFO][plugin:72]: loaded plugin trivia 1.0.0
[2023-04-28 21:19:03,469][INFO][plugin:72]: loaded plugin stories 1.0.0
[2023-04-28 21:19:03,469][INFO][plugin:72]: loaded plugin social_credit 1.0.0
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/csgo/.local/lib/python3.9/site-packages/nedry/__main__.py", line 108, in <module>
    main()
  File "/home/csgo/.local/lib/python3.9/site-packages/nedry/__main__.py", line 88, in main
    plugin_manager.startup_plugins()
  File "/home/csgo/.local/lib/python3.9/site-packages/nedry/plugin.py", line 191, in startup_plugins
    plugin = self._plugin_modules[n].startup()
  File "/home/csgo/.local/lib/python3.9/site-packages/nedry/builtin_plugins/social_credit.py", line 175, in startup
    Serializer(config).from_dict(config_data)
  File "/home/csgo/.local/lib/python3.9/site-packages/versionedobj/serializer.py", line 142, in from_dict
    migration_result, attrs = obj._vobj__migrate(version, attrs)
  File "/home/csgo/.local/lib/python3.9/site-packages/versionedobj/object.py", line 199, in _vobj__migrate
    old_version = attrs.get('version', None)
AttributeError: 'list' object has no attribute 'get'
eriknyquist commented 1 year ago

Thanks for the report, can you please share which version of "versionedobj" you have installed ("pip list | grep versionedobj")? That looks like it is missing a feature that was added in later versions of versionedobj. I have upped the required version of "versionedobj" in requirements.txt fairly recently.