samchen2009 / ekanban

a kanban plugin for redmine
102 stars 42 forks source link

Attempted installation results in redmine all fucked up.... #95

Open liar666 opened 6 years ago

liar666 commented 6 years ago

Hi,

I tried to install your ekanban plugin in Redmine 2.5.2.devel

The migration gave the following error:

# rake redmine:plugins:migrate RAILS_ENV=production
An error occurred while loading the routes definition of ekanban plugin (/usr/share/redmine/plugins/ekanban/config/routes.rb): You should not use the `match` method in your router without specifying an HTTP method.
If you want to expose your action to both GET and POST, add `via: [:get, :post]` option.
If you want to expose your action to GET, use `get` in the router:
  Instead of: match "controller#action"
  Do: get "controller#action".

So I replaced lines like: match 'kanban_apis/kanban_card_journals', :controller => 'kanban_apis', :action => 'kanban_card_journals', :via => :get by: get 'kanban_apis/kanban_card_journals', :controller => 'kanban_apis', :action => 'kanban_card_journals'

in /usr/share/redmine/plugins/ekanban/config/routes.rb (NOTE: I know nothing about ruby/rails/...!)

Then, the migration worked flowlessly.

However, when I restarted apache/redmine I discovered that attempting to create a "New Issue" now results in an "Internal error"... And since I have no log at all in redmine, my installation is just all fckd up...

Could you please give me a work around or at least a procedure to remove/uninstall your plugin, so that I can use my redmine again?

Thanks in advance

liar666 commented 6 years ago

Since nobody takes the pain... Responding to myself: 1- always make a backup of your redmine DB before installing a plugin!

I successfully resolved all the mess created by ekanban by following the procedure below:

1- Stop redmine 2 - Remove bad DB

# mysql -u root -p mysql
> drop database <your redmine db>

3- Re-init Redmine DB # cd /usr/share/redmine ; RAILS_ENV=production bundle exec rake db:migrate 4- Move bad plugins out of Redmine's way (!! we need the source dir later to clean the DB !!) # cd /usr/share/redmine/plugins ; mv <badplugindir> /tmp/ 5- Re-init plugins DB # cd /usr/share/redmine ; RAILS_ENV=production bundle exec rake redmine:plugins:migrate 6- Re-insert previous DB content # gunzip <yourbackup>.mysql.gz | mysql -u root -p 7- Clean the mess created by the ekanban plugin (as for most web frameworks, it seems that the conventions used - by Rails - are of a great help here: i.e. the "model" classes of the app are exactly the names of the tables in the DB)

tables=$(for i in /tmp/<badplugindir>/app/models/* ; do echo $(basename ${i/.rb/,}) ; done | tr -d '\n')
echo "DROP TABLES ${tables};" ; mysql -u root -p redmine_presans_db

8- Restart Redmine 9- Actually remove bad plugin rm -fr /tmp/<badplugindir>