Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

install and unistall failed #169

Closed
TonyRideBike opened this issue Dec 30, 2017 · 5 comments
Closed

install and unistall failed #169

TonyRideBike opened this issue Dec 30, 2017 · 5 comments

Comments

@TonyRideBike
Copy link

TonyRideBike commented Dec 30, 2017

Hi developer, I really need help on this:

I migrate the database from old machine to a new one, install this plugin and on some pages, there will be a 500 internal error.
the log shows the tables are not correct, so I decided to drop the four tables of issue_templates, issue_template_settings, global_issue_templates, global issue_templates_projects, then try to re-install the plugin.

but rake never works after that because of "table not found"...

Migrating redmine_issue_templates (Redmine Issue Templates plugin)...
== 20160829001530 ChangeGlobalIssueTemplateEnabledColumn: migrating ===========
-- change_column(:global_issue_templates, :enabled, :boolean, {:default=>false, :null=>false})
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Table 'redmine.global_issue_templates' doesn't exist: SHOW FULL FIELDS FROM `global_issue_templates`

I thought when installing the plugin, the scripts should create the table? could you let me know how to re-install in such a situation?

thank you in advance.

@TonyRideBike
Copy link
Author

here is the new machine environment:

Environment:
  Redmine version                3.4.0.stable
  Ruby version                   2.4.1-p111 (2017-03-22) [x86_64-linux]
  Rails version                  4.2.8
  Environment                    production
  Database adapter               Mysql2
SCM:
  Git                            2.7.4
  Filesystem                     
Redmine plugins:
  clipboard_image_paste          1.12
  redmine_agile                  1.4.5
  redmine_banner                 0.1.2
  status_button                  0.1.0

@akiko-pusu
Copy link
Owner

akiko-pusu commented Dec 30, 2017

Hi, @TonyRideBike
Thanks for using my plugin.
First, if you need to uninstall plugin, please follow the instruction on README.

Uninstall

Try this:

rake db:migrate_plugins NAME=redmine_issue_templates VERSION=0 RAILS_ENV=production
(or, bundle exec rake redmine:plugins:migrate VERSION=0 RAILS_ENV=production)

See also: http://www.r-labs.org/projects/issue-template/wiki/About_en#Uninstall-plugin

Anyway, you dropped tables related to issue templates without above migration task, is that right?
If so, you have to clean up migration records related to this plugin recorded on schema_migrations table.

Please see: https://www.r-labs.org/projects/issue-template/wiki/About_en#Uninstall-plugin

I hope this would be any help.

Here is the instruction to uninstall plugin, at www.r-labs.org.


Uninstall plugin

Run rake task

rake redmine:plugins:migrate NAME=redmine_issue_templates VERSION=0

Above rake task will remove the related records to redmine_issue_templates from schema_migration table.
In additon to this, issue_templates and issue_template_settings tables will be also removed.

Manual uninstall

In some situation, rake task to uninstall may be failed. To uninstall plugin manually, please remove these records and tables from your database.

Remove records from schema_migration table related to issue_templates.

DELETE FROM schema_migrations WHERE version LIKE '%redmine_issue_templates';
Drop issue_templates and issue_template settings.
DROP TABLE issue_templates; 
DROP TABLE issue_template_settings;

@akiko-pusu
Copy link
Owner

Also, thanks for using Banner plugin!

I migrate the database from old machine to a new one, install this plugin and on some pages, there will be a 500 internal error.

As you wrote above, if you still have any message related this 500 error, or if you reproduce this error, please let me know.
In case this is because my plugins, I’ll do support you. So, feel free to open an issue :)

@TonyRideBike
Copy link
Author

Hi @akiko-pusu

I believe the operation of the database really did the work:

mysql> DELETE from schema_migrations where version like '%redmine_issue_templates';
Query OK, 14 rows affected (0.01 sec)

after that I clone this repository, install again, restart and everything is working perfectly.

I sincerely thank you for this advice!

@akiko-pusu
Copy link
Owner

@TonyRideBike
Nice to hear that. Thanks again!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants