leovitch / redmine_importer

Redmine importer that works with trunk.
https://github.com/leovitch/redmine_importer/wiki
103 stars 78 forks source link

500 Internal Server Error #23

Closed ghost closed 8 years ago

ghost commented 12 years ago

Import error using sample file. (Bitnami Redmine 1.3.2) Do I need to create import_in_progresses table manually? Thanks.

Processing ImporterController#match (for at 2012-04-05 16:17:52) [POST] Parameters: {"encoding"=>"U", "commit"=>"Upload File", "project_id"=>"1", "action"=>"match", "authenticity_token"=>"AhEQPlwZdUL0nZ0Fr/cMY3j376XEAg75P04s8CG2Wcw=", "controller"=>"importer", "file"=>#File:C:/Windows/Temp/RackMultipart20120405-896-wkl0s4-0, "splitter"=>",", "wrapper"=>"\""}

ActiveRecord::StatementInvalid (Mysql::Error: Table 'bitnami_redmine.import_in_progresses' doesn't exist: DELETE FROM import_in_progresses WHERE (user_id = 3) ): vendor/plugins/redmine_importer/app/controllers/importer_controller.rb:41:in match' config/initializers/mongrel_cluster_with_rails_211_fix.rb:62:indispatch_cgi'

Rendering C:/BitNami/apps/redmine/public/500.html (500 Internal Server Error)

ghost commented 12 years ago

I thought I would missed some step when installing this plugin, but seems not.

Created a table based on the structure below would get rid of the issue.

CREATE TABLE IF NOT EXISTS import_in_progresses ( id int(11) NOT NULL auto_increment, user_id int(11) NOT NULL, quote_char varchar(8) default NULL, col_sep varchar(8) default NULL, encoding varchar(64) default NULL, created datetime default NULL, csv_data blob, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

cpmalhotra commented 8 years ago

I too faced this same error. It happens when you drop the redmine table from mysql after installing the redmine_importer and replacing it with a different imported table which does not have the table import_in_progresses that redmine_importer adds during "bundle exec rake redmine:plugins:migrate RAILS_ENV=production".

Resolution: run "bundle exec rake redmine:plugins:migrate RAILS_ENV=production" again

leovitch commented 8 years ago

cpmalhotra's comment (and solution) sound correct; the importer depends on having a migration that creates the table.