joeyates / imap-backup

Backup and Migrate IMAP Email Accounts
MIT License
1.37k stars 75 forks source link

imap-backup do not start on Ubuntu 22.04 #138

Closed Rudiberto closed 1 year ago

Rudiberto commented 1 year ago

I'm messed up. When I updated to Ubuntu 22.04 (Mint 21) my imap-backup stopped to work. At first, I downloaded the last version from here, then I installed the last version of imap-backup using "gem install". ERRORS Then I uninstalled all up to ruby on my pc, deleted manually all old versions of gem in all folders and began a clean installation of ruby. But after all: Starting imap-backup I'm still receiving this horror list of error messages

imap-backup <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:160:inrequire': cannot load such file -- mail/indifferent_hash (LoadError) from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:160:in rescue in require' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:149:inrequire' from /var/lib/gems/3.0.0/gems/mail-2.8.0/lib/mail.rb:14:in <module:Mail>' from /var/lib/gems/3.0.0/gems/mail-2.8.0/lib/mail.rb:3:in<top (required)>' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in require' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:inrequire' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/email/mboxrd/message.rb:2:in <top (required)>' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:inrequire' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in require' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup/serializer.rb:3:in<top (required)>' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in require' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:inrequire' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup.rb:10:in <top (required)>' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:inrequire' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in require' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup/cli/helpers.rb:1:in<top (required)>' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in require' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:inrequire' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup/cli.rb:8:in <class:CLI>' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup/cli.rb:7:in' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup/cli.rb:6:in <top (required)>' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:inrequire' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in require' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/bin/imap-backup:8:in<top (required)>' from /usr/local/bin/imap-backup:25:in load' from /usr/local/bin/imap-backup:25:in

' <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in require': cannot load such file -- mail/indifferent_hash (LoadError) from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:inrequire' from /var/lib/gems/3.0.0/gems/mail-2.8.0/lib/mail.rb:14:in <module:Mail>' from /var/lib/gems/3.0.0/gems/mail-2.8.0/lib/mail.rb:3:in<top (required)>' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in require' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:inrequire' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/email/mboxrd/message.rb:2:in <top (required)>' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:inrequire' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in require' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup/serializer.rb:3:in<top (required)>' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in require' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:inrequire' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup.rb:10:in <top (required)>' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:inrequire' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in require' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup/cli/helpers.rb:1:in<top (required)>' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in require' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:inrequire' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup/cli.rb:8:in <class:CLI>' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup/cli.rb:7:in' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup/cli.rb:6:in <top (required)>' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:inrequire' from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in require' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/bin/imap-backup:8:in<top (required)>' from /usr/local/bin/imap-backup:25:in load' from /usr/local/bin/imap-backup:25:in
' ` imap-backup worked properly for nearly a year on this pc and now such a mess. All the folder exist. When I'm starting imap-backup with sudo, the list is a lot shorter:

sudo imap-backup /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup/cli/helpers.rb:68:inload_config': Configuration file '/root/.imap-backup/config.json' not found (Imap::Backup::ConfigurationNotFound) from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup/cli/backup.rb:15:in run' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup/cli.rb:58:inbackup' from /var/lib/gems/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in run' from /var/lib/gems/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:ininvoke_command' from /var/lib/gems/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in dispatch' from /var/lib/gems/3.0.0/gems/thor-1.2.1/lib/thor/base.rb:485:instart' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/bin/imap-backup:12:in block in <top (required)>' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/lib/imap/backup/logger.rb:34:insanitize_stderr' from /var/lib/gems/3.0.0/gems/imap-backup-8.0.1/bin/imap-backup:11:in <top (required)>' from /usr/local/bin/imap-backup:25:inload' from /usr/local/bin/imap-backup:25:in <main>'

Here is the only thing I understand: The json config file is not there, because it is in my home folder, of course. When I copied the whole .imap-backup-Folder to root-Folder, it worked right away and transformed all boxes metadata to the Version 3 Format. Does that mean, that from now on, I have to execute imap-backup with sudo rights and configuration file stored in root-Folder? That's not good for my needs. Don't like to execute usual programs in root mode. Also don't like to make a user-install into my home folder. What is to do, to have the former behavior back?

joeyates commented 1 year ago

Hi @Rudiberto

Thanks for reporting this issue.

It is caused by release 2.8.0 of the 'mail' gem.

Here's the GitHub issue.

There's no need to switch to running imap-backup as root.

As a quick fix, you can do this:

sudo chmod o+r /var/lib/gems/3.0.0/gems/mail-2.8.0/lib/*.rb

I'll release an update to imap-backup with a fix later today.

joeyates commented 1 year ago

I've released version 8.0.2.

@Rudiberto, let me know whether it fixes your problem.

Rudiberto commented 1 year ago

Seems to work great! Thx a lot! At first, it seems not to work - had the certificate hash running over the screen and stopped it - but the second intent worked fine. After a reboot, it's still well. Great job! Thank you for your great and REALLY fast reply.

joeyates commented 1 year ago

Glad that's sorted out!