Restore backup : error Thor


(Martial) #1

I tried to restore a backup with command line (GUI is not an option) but I get this error :

root@forum:/var/discourse# ./launcher enter app
root@forum-app:/var/www/discourse# discourse restore
You must provide a filename to restore. Did you mean one of the following?

script/discourse restore tact-forum-2017-02-01-075306-v20161216101352.tar.gz
root@forum-app:/var/www/discourse# script/discourse restore tact-forum-2017-02-01-075306-v20161216101352.tar.gz
/usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- thor (LoadError)
	from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from script/discourse:3:in `<main>'

(Sam Saffron) #2

@zogstrip can you have a look?


(Martial) #3

Seems my docker is broken. Is there a way to quickly check if someting went wrong in the docker ?


(Alan Tan) #4

The Thor gem isn’t installed by default.

From your container run gem install thor and you should be good to go.


(Martial) #5

Why the gem thor is not installed by default since he is used to do the backup ?

There is a GUI to restore a backup but an admin need to go on the docker to install the gem and then restore the backup ? :unamused:


(Robin Ward) #6

I’ve actually wondered this for a while. If thor is needed for our CLI surely it should be installed in the Gemfile.


(Mittineague) #7

It is in the lock


(Martial) #8

I have this file too, but obviously the gem are not installed

root@ubuntu-app:/var/www/discourse# gem list

*** LOCAL GEMS ***

bigdecimal (1.2.8)
bundler (1.14.5, 1.13.7)
did_you_mean (1.0.0)
io-console (0.4.5)
json (1.8.3)
minitest (5.8.5)
net-telnet (0.1.1)
power_assert (0.2.6)
psych (2.1.0)
rake (10.4.2)
rdoc (4.2.1)
test-unit (3.1.5)

This is a fresh install, the lastest version of discourse downloaded this morning.


(Sam Saffron) #9

Maybe it is only installed in dev mode, agree we should fix this, expecting people to install gems just to get discourse CLI to run is crazy


(Robin Ward) #10

I think this will fix it:


(Michael - DiscourseHosting.com) #11

Be careful, I remember that a thor version beyond 0.19.1 breaks stuff in ugly ways.


(Martial) #12

Or the gem should be installed when backup button is clicked and removed after regarding what @michaeld says


(Robin Ward) #13

Really? Whenever I encountered the error I’d type gem install thor on the command line to get the latest version and it’s always worked. Do you have steps to reproduce it?


(Michael - DiscourseHosting.com) #14

Sorry, can’t find it in my notes :frowning: