sup-heliotrope / sup

A curses threads-with-tags style email client (mailing list: supmua@googlegroups.com)
http://sup-heliotrope.github.io
GNU General Public License v2.0
900 stars 97 forks source link

sup-mail crashes on startup with ancient config. #516

Closed markstos closed 2 years ago

markstos commented 8 years ago

I installed sup-mail on Ubuntu 16.04, ran sup-mail for the first time, and it crashed on startup. Below is .sup/exception-log.txt.

I believe the issue is apparently I tried sup in 2009, and still had a .sup/config.yml from then. It would be nice if sup-mail could not crash in the presence of a bad config file.

--- NoMethodError from thread: main
undefined method `empty?' for Redwood::SentLoader:Class
/usr/lib/ruby/2.3.0/psych/class_loader.rb:26:in `load'
/usr/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:396:in `resolve_class'
/usr/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:160:in `visit_Psych_Nodes_Mapping'
/usr/lib/ruby/2.3.0/psych/visitors/visitor.rb:16:in `visit'
/usr/lib/ruby/2.3.0/psych/visitors/visitor.rb:6:in `accept'
/usr/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:32:in `accept'
/usr/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:330:in `block in register_empty'
/usr/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:330:in `each'
/usr/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:330:in `register_empty'
/usr/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:141:in `visit_Psych_Nodes_Sequence'
/usr/lib/ruby/2.3.0/psych/visitors/visitor.rb:16:in `visit'
/usr/lib/ruby/2.3.0/psych/visitors/visitor.rb:6:in `accept'
/usr/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:32:in `accept'
/usr/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:311:in `visit_Psych_Nodes_Document'
/usr/lib/ruby/2.3.0/psych/visitors/visitor.rb:16:in `visit'
/usr/lib/ruby/2.3.0/psych/visitors/visitor.rb:6:in `accept'
/usr/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:32:in `accept'
/usr/lib/ruby/2.3.0/psych/nodes/node.rb:38:in `to_ruby'
/usr/lib/ruby/2.3.0/psych.rb:253:in `load'
/usr/lib/ruby/2.3.0/psych.rb:471:in `block in load_file'
/usr/lib/ruby/2.3.0/psych.rb:471:in `open'
/usr/lib/ruby/2.3.0/psych.rb:471:in `load_file'
/usr/lib/ruby/vendor_ruby/sup.rb:145:in `load_yaml_obj'
/usr/lib/ruby/vendor_ruby/sup/source.rb:227:in `load_sources'
/usr/lib/ruby/vendor_ruby/sup/util.rb:610:in `method_missing'
/usr/lib/ruby/vendor_ruby/sup/index.rb:102:in `load'
/usr/lib/ruby/vendor_ruby/sup/util.rb:610:in `method_missing'
/usr/bin/sup-mail:144:in `<module:Redwood>'
/usr/bin/sup-mail:74:in `<main>'

Here's the old .sup/config.yaml which triggered the exception:

--- 
:confirm_no_attachments: true 
:editor: /usr/bin/vim -f -c 'setlocal spell spelllang=en_us' -c 'set filetype=mail'
:thread_by_subject: false
:confirm_top_posting: true
:accounts: 
  :default: 
    :sendmail: /usr/sbin/sendmail -oem -ti
    :signature: /home/mark/.signature
    :email: mark@stosberg.com
    :name: Mark Stosberg
    :alternates: []

:edit_signature: false
:ask_for_cc: true
:ask_for_bcc: false
:ask_for_subject: true
pangoSE commented 7 years ago

I also had sup 0.22.1 crash today because of invalid paths configured in the config-file. I would suggest to check the paths on startup and exit clean with a sensible errormessage if they are not valid.

danc86 commented 2 years ago

The stack trace is from loading sources.yaml but the issue description only includes config.yaml so it's hard to be sure exactly what was going wrong.

This is likely related to the Syck-to-Psych transition which Ruby went through in 1.9 -> 2.0. From version 0.14.0 onwards, sup included a tool sup-psych-ify-config-files to handle the migration, but from version 0.16.0 onwards the tool refuses to run on Ruby 2.1+, presumably because Psych would no longer successfully parse the old Syck-generated YAML at that point.

At this point anybody hitting this issue would presumably be best to just re-create their sources.yaml from scratch.