Project

General

Profile

Importer plugin - Help

Added by Nanda P over 15 years ago

Hello Everybody,

I tried to import a csv file & create tasks in RedMine using Importer plugin.

1. I am getting "translation missing: en" message.

translation missing: en

I even tried with a copy of en.yml in "\vendor\plugins\redmine_importer\config\locales\"
By default the file is under "\vendor\plugins\redmine_importer\lang\"

2. When I try to import a file(csv) I am getting "Internal Error"

Internal Error

Can anyone suggest me how to fix this?

Thanks in Advance.

Regards,
Nanda


Replies (21)

RE: Importer plugin - Help - Added by Nanda P over 15 years ago

importer#match (FasterCSV::MalformedCSVError) "Unquoted fields do not allow \\r or \\n (line 3)."

A FasterCSV::MalformedCSVError occurred in importer#match:

Unquoted fields do not allow \r or \n (line 3).
C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/fastercsv-1.5.0/lib/faster_csv.rb

-------------------------------
Backtrace:
-------------------------------

  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/fastercsv-1.5.0/lib/faster_csv.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/fastercsv-1.5.0/lib/faster_csv.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/fastercsv-1.5.0/lib/faster_csv.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/fastercsv-1.5.0/lib/faster_csv.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/fastercsv-1.5.0/lib/faster_csv.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/fastercsv-1.5.0/lib/faster_csv.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/fastercsv-1.5.0/lib/faster_csv.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/fastercsv-1.5.0/lib/faster_csv.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/fastercsv-1.5.0/lib/faster_csv.rb
  [RAILS_ROOT]/vendor/plugins/redmine_importer/app/controllers/importer_controller.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb
  C:/Program Files/Ruby/lib/ruby/1.8/benchmark.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/rescue.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/query_cache.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/session_management.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/httpserver.rb
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/httpserver.rb
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/servers/webrick.rb
  C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb
  C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/server.rb
  C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb
  C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb
  [RAILS_ROOT]/script/server

RE: Importer plugin - Help - Added by Mischa The Evil over 15 years ago

Nanda,

You are running Redmine trunk AFAICS. As documented at the Redmine plugin list this plugin is only compatible with Redmine 0.8.x.

Though, have you changed the actual format of the language-file too? So like:

en:
  label_import: "Import" 
  label_issue_importer: "Issue Importer" 

HTH... ;)

RE: Importer plugin - Help - Added by Nanda P over 15 years ago

Mischa,

Yes, I am running RedMine trunk. (Redmine 0.8.4.devel.2825 (MySQL))

I didn't change anything in language file.

\vendor\plugins\redmine_importer\lang\en.yml


label_import: "Import" 
label_issue_importer: "Issue Importer" 
label_upload_notice: "Select a CSV file to import. Import file must have a header row." 
label_upload_format: "File format settings" 
label_upload_encoding: "Encoding:" 
label_upload_splitter: "Field seperate char:" 
label_upload_wrapper: "Field wrap char:" 

Regards,
Nanda

RE: Importer plugin - Help - Added by Mischa The Evil over 15 years ago

Nanda Palaniswamy wrote:

Yes, I am running RedMine trunk. (Redmine 0.8.4.devel.2825 (MySQL))

I didn't change anything in language file.

That could explain your issues. Since Redmine trunk depends on Rails 2.2.x the format of the i18n-files has been changed also. See this forum-thread for some pointers.

Greetings,

Mischa.

RE: Importer plugin - Help - Added by Nanda P over 15 years ago

Mischa,

Thank you very much,

"translation missing: en" issue fixed.

But I am still getting the internal error when I tried to import a CSV file.

mporter#match (FasterCSV::MalformedCSVError) "Unquoted fields do not allow \\r or \\n (line 3)." 

A FasterCSV::MalformedCSVError occurred in importer#match:

Unquoted fields do not allow \r or \n (line 3).

C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/fastercsv-1.5.0/lib/faster_csv.rb

I even tried to import a file which was exported from RedMine. getting the same error :(

Regards,
Nanda

RE: Importer plugin - Help - Added by Mischa The Evil over 15 years ago

Nanda Palaniswamy wrote:

"translation missing: en" issue fixed.

Great!

But I am still getting the internal error when I tried to import a CSV file.

[...]

I even tried to import a file which was exported from RedMine. getting the same error :(

To be sure: you have selected the same encoding-type of the CSV-file in the plugin?

Did a quick search for the error and the first hit gave me http://www.ruby-forum.com/topic/177512 which talks about this issue. Seems something which should be looked at by the developer of this plugin...

Greetings,

Mischa.

RE: Importer plugin - Help - Added by Nanda P over 15 years ago

Mischa,

Thanks a Lot for speedy responses.

I converted RedMine export csv file to "encoding : UTF8". but still the same error :(

I will contact the author & see if he can give me a solution.

Regards,
Nanda

RE: Importer plugin - Help - Added by Mischa The Evil over 15 years ago

Nanda,

Just came around the following GitHub-repo from rchady, which holds a fork of this plugin which should be Redmine Trunk compatible: http://github.com/rchady/redmine_importer/tree/.

HTH... ;)

RE: Importer plugin - Help - Added by Nanda P over 15 years ago

Mischa,

You are awesome! with your replies.. :)

I am still getting the same error with RChady's version of Importer. I guess I need to work on the csv file format.

Thanks a lot!

Regards,
Nanda

RE: Importer plugin - Help - Added by Vitaly Klimov about 15 years ago

Nanda, i ran into similar problems with the plugin - it opens files in text mode which is ok for Unix systems but does not work for Windows systems. Here is an easy fix for it:

add following lines

 tmpfile.binmode
 file.binmode

before line 26 in file app\controllers\importer_controller.rb (if tmpfile) and everything will work.
(i am using rchady's version compatible with trunk)

Also please note that when you save files as UTF8 in Windows lots of editors write 3 bytes header to the file thus causing errors in FasterCSV. So you may strip those bytes or tweak code to skip those bytes. More elegant way would be to add special encoding to workaround this issue (the way i did) but this will affect more than one file.

RE: Importer plugin - Help - Added by Nanda P about 15 years ago

Vitaly,

Thank you very much.

I will try this & let you know how it goes.

Regards,
Nanda

RE: Importer plugin - Help - Added by herman cremer almost 15 years ago

I am running 0.9 stable, and getting this error :

Processing ImporterController#match (for 192.168.1.25 at 2009-12-29 13:30:30) [POST]
Parameters: {"project_id"=>"149", "encoding"=>"U", "wrapper"=>"\"", "commit"=>"Upload File", "action"=>"match", "authenticity_token"=>"ek7lm0Z/QeSTTkT7HBSWz/u54/SQRlqymGoEY9ezqkk=", "controller"=>"importer", "splitter"=>",", "file"=>#<File:/tmp/RackMultipart.12495.3>}

NoMethodError (undefined method `l_has_string?' for #<ImporterController:0x7f9e522936d0>):
vendor/plugins/redmine_importer/app/controllers/importer_controller.rb:65:in `match'
vendor/plugins/redmine_importer/app/controllers/importer_controller.rb:64:in `each'
vendor/plugins/redmine_importer/app/controllers/importer_controller.rb:64:in `match'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'

Rendering /var/www/redmine.integrat.co.za/application/public/500.html (500 Internal Server Error)

any ideas ?

RE: Importer plugin - Help - Added by iza zam almost 15 years ago

Nanda Palaniswamy wrote:

Vitaly,

Thank you very much.

I will try this & let you know how it goes.

Regards,
Nanda

Hi Nanda,

I ran into the same problem. Have you found the resolution, do you mind to share it here. Thanks

RE: Importer plugin - Help - Added by iza zam almost 15 years ago

It's working now using resolution sent by Vitaly but for some reason, it took overnight for the changes to reflect eventhough i've restarted redmine.

Now i'm getting new error:
NoMethodError (undefined method `[]' for nil:NilClass):

Tried to resolve by Gary posting in http://www.martinliu.info/2009/04/redmine_importer-redmine-csv-import-plugin/ but problem persist.

Hope someone could help on this, thanks.

RE: Importer plugin - Help - Added by Sheng Wang over 14 years ago

I am running 0.9 stable, and getting this error :

Processing ImporterController#match (for 192.168.1.25 at 2009-12-29 13:30:30) [POST]
Parameters: {"project_id"=>"149", "encoding"=>"U", "wrapper"=>"\"", "commit"=>"Upload File", "action"=>"match", "authenticity_token"=>"ek7lm0Z/QeSTTkT7HBSWz/u54/SQRlqymGoEY9ezqkk=", "controller"=>"importer", "splitter"=>",", "file"=>#<File:/tmp/RackMultipart.12495.3>}

NoMethodError (undefined method `l_has_string?' for #<ImporterController:0x7f9e522936d0>):

All of these caused by redmine use I18n instead of localization plugin since redmine 0.9
localization plugin contain l_has_string? method, but I18n doesn't.
So, you can delete the l_has_string? method references.
Special operation:

#app/controllers/user_import_controller.rb
-      @attrs.push([l_has_string?("field_#{attr}".to_sym) ? l("field_#{attr}".to_sym) : attr.to_s.humanize, attr])
+      @attrs.push([l("field_#{attr}".to_sym), attr])

RE: Importer plugin - Help - Added by shubham chakraborty about 14 years ago

By Using Rchady's plugin on 0.8.7, i am getting the following error

undefined method `<=>' for :tracker:Symbol

1st 3 lines on full trace:
vendor/plugins/redmine_importer/app/controllers/importer_controller.rb:74:in `<=>'
vendor/plugins/redmine_importer/app/controllers/importer_controller.rb:74:in `sort!'
vendor/plugins/redmine_importer/app/controllers/importer_controller.rb:74:in `match'

Can you help me out with this please?
I have tried all the solutions listed above but to no avail.

RE: Importer plugin - Help - Added by shubham chakraborty about 14 years ago

I couldnt get this solved, hence i upgraded my redmine version.
But now there is another big issue. I cannot make a .Csv file with excel.
But the uploader fails to upload it. I tried with the CSV from redmine by exporting issues.
That works very well. But if without even editing anything, i press SAVE on excel to the same file, the file wont upload anymore. It seems excel cannot save or generate the csv format,only read it.

Is there any solution to this ? Also if anyone has tried this, can you tell me what Csv software are you using?

RE: Importer plugin - Help - Added by Cheryan MT about 14 years ago

Hi,
Need help from from those who were successful in importing issues from csv file.
I installed the plugin (from rchady-redmine_importer-94f1bd5.tar)
The "import" tab comes up and I am able to open the csv file.
My project has many custom fields.

The csv file template I used was the same as the one from the CSV report option from my redmine istallation itself.
-----------------------------------------------------------------------------------------------------------------------------
"#","Status","Project","Tracker","Priority","Docket Title","Assigned to","Category","Target version","Author","Start","Next_Action DeadLine","% Done","Estimated time","Parent task","Created","Updated","Docket Number","Client","Docket Filing Date","Next Docket milestone","Next Milestone Date","Description"
"11", "New","CR Management","Docket","Normal","Imported through CSV: 10","r","r","r","JJ RR",09/09/10,,0,,,09/09/10 19:41,"09/19/2010 12:34 pm","OC100","Oracle",15/09/10,"Renewal of Filing",28/10/11,"
------------------------------------------------------------------------------------------------------------------------

The issue ID in column 1 ('#' and 11 in first and second line respectively).
The import is failing ("1 issues processed. 0 issues successfully imported."

Can I get some pointers to proceed further

Is there any error log I need to send, Please do let me know.

RE: Importer plugin - Help - Added by Cheryan MT about 14 years ago

[continuation of above query] This is in linux (ubuntu) with postgres.

RE: Importer plugin - Help - Added by Cheryan MT about 14 years ago

Hi,
I figured out the silly mistake I made.

I did the csv export of existing data from redmine. (I had few custom Date fields)
Then I changed some of the fields to save it back as a csv file. The issue was, when I exported and opened the csv in spread sheet, the date format of the opened filed in excel was different (from the one I was using in redmine). When I saved back the csv file from excel (not bothering to change the date format in excel), it saved back the csv file with different date string format than needed by redmine. Hence the import was failing.

I made the edited the date format in the csv file as required by the redmine date field, everything worked.

Thanks for the nice plugin.

cheryan

RE: Importer plugin - Help - Added by toyotomi aguri over 12 years ago

Hi

I met same error, but I could resolve this issue after uninstalling User CSV Import Plugin.

undefined method `<=>' for :tracker:Symbol

1st 3 lines on full trace:
vendor/plugins/redmine_importer/app/controllers/importer_controller.rb:74:in `<=>'
vendor/plugins/redmine_importer/app/controllers/importer_controller.rb:74:in `sort!'
vendor/plugins/redmine_importer/app/controllers/importer_controller.rb:74:in `match'

    (1-21/21)