stpl / csv_import_issues

Redmine plugin that allows importing of issues via CSV allowing user to map columns of csv to issue attributes.
10 stars 15 forks source link

Internall error - accents #10

Open balagab opened 10 years ago

balagab commented 10 years ago

Hi,

I also got internal error, but found out only when I use accents in the csv. Is there any solution to use accents? Maybe some char settings.

Thanks for this plugin! Gabor

stpl commented 10 years ago

Hi @balagab, We have done a fix for this, please use latest code from master and let me know if still issue exists.

balagab commented 10 years ago

Hi, thanks for the feedback, I've overwritten the files but the problem is the same. Please find the log below:

ActionView::Template::Error (invalid byte sequence in UTF-8): 26: <% @csv_rows[0].each_with_index do |value, index| %> 27: 28: <%= value.force_encoding("utf-8") %> 29: <%= @csv_rows[1][index].force_encoding("utf-8") %> 30: <% @options = params[:options][index] if params[:import] %> 31: 32: <%= select_tag :options, options_for_select(@query, :selected => @options), {:name => "options[]", :prompt => "No Match (Skip)"}

If you need something more, please let me know. Thanks

stpl commented 10 years ago

Hi @balagab

I've tried to replicate this issue with some french accents csv but it gets imported successfully.

Can you provide me few examples of these accents or a sample csv?

Also do let me know your Redmine version.

balagab commented 10 years ago

Hi @stpl Sure, a tried to change the priority value from "Normal" to "Normál". Redmine version is 2.5.0 stable, Ruby version is 1.9.3-p545, Rails version is 3.2.17 and we use MS SQL server. Thanks!

stpl commented 10 years ago

I've tried to import csv after changing priority value from "Normal" to "Normál" but again it imported successfully. Have you restarted your production server after taking latest pull from master?

balagab commented 10 years ago

@stpl Yes, but now I uninstalled the plugin, after installed the new version. First I had to modify the content_type line in csv_import.rb to ":file_name => { :matches => [/csv\Z/], :message => "Oops! Please upload a file with the extension of csv." },". After this the problem is the same, I get internal error when try to import accents value (Normál).

balagab commented 10 years ago

@stpl One more thing, I downloaded the new version from here (Download ZIP): https://github.com/stpl/csv_import_issues Is that correct?

stpl commented 10 years ago

@balagab Yes, you have downloaded correctly. Please provide us the actual error message from log file.

balagab commented 10 years ago

@stpl Here is the log from production.log:

ActionView::Template::Error (invalid byte sequence in UTF-8): 26: <% @csv_rows[0].each_with_index do |value, index| %> 27: 28: <%= value.force_encoding("utf-8") %> 29: <%= @csv_rows[1][index].force_encoding("utf-8") %> 30: <% @options = params[:options][index] if params[:import] %> 31: 32: <%= select_tag :options, options_for_select(@query, :selected => @options), {:name => "options[]", :prompt => "No Match (Skip)"} activesupport (3.2.17) lib/active_support/core_ext/string/output_safety.rb:24:in gsub' activesupport (3.2.17) lib/active_support/core_ext/string/output_safety.rb:24:inhtml_escape' activesupport (3.2.17) lib/active_support/core_ext/string/output_safety.rb:135:in concat' actionpack (3.2.17) lib/action_view/buffers.rb:11:in<<' plugins/csv_import_issues/app/views/csv_imports/finalize.html.erb:29:in block (2 levels) in _plugins_csv_import_issues_app_views_csv_imports_finalize_html_erb__1353225143902065732_70323017925040' plugins/csv_import_issues/app/views/csv_imports/finalize.html.erb:26:ineach' plugins/csv_import_issues/app/views/csv_imports/finalize.html.erb:26:in each_with_index' plugins/csv_import_issues/app/views/csv_imports/finalize.html.erb:26:inblock in _plugins_csv_import_issues_app_views_csv_imports_finalize_html_erb1353225143902065732_70323017925040' actionpack (3.2.17) lib/action_view/helpers/capture_helper.rb:40:in block in capture' actionpack (3.2.17) lib/action_view/helpers/capture_helper.rb:187:inwith_output_buffer' haml (4.0.5) lib/haml/helpers/action_view_xss_mods.rb:5:in with_output_buffer_with_haml_xss' actionpack (3.2.17) lib/action_view/helpers/capture_helper.rb:40:incapture' haml (4.0.5) lib/haml/helpers/action_view_mods.rb:52:in capture_with_haml' actionpack (3.2.17) lib/action_view/helpers/form_helper.rb:378:inform_for' haml (4.0.5) lib/haml/helpers/action_view_mods.rb:139:in form_for_with_haml' haml (4.0.5) lib/haml/helpers/action_view_xss_mods.rb:28:inform_for_with_haml_xss' plugins/csv_import_issues/app/views/csv_imports/finalize.html.erb:15:in `_plugins_csv_import_issues_app_views_csv_imports_finalize_html_erb1353225143902065732_70323017925040' actionpack (3.2.17) lib/action_view/template.rb:145:inblock in render' activesupport (3.2.17) lib/active_support/notifications.rb:125:ininstrument' actionpack (3.2.17) lib/action_view/template.rb:143:inrender' actionpack (3.2.17) lib/action_view/renderer/template_renderer.rb:47:inblock (2 levels) in render_template' actionpack (3.2.17) lib/action_view/renderer/abstract_renderer.rb:38:inblock in instrument' activesupport (3.2.17) lib/active_support/notifications.rb:123:inblock in instrument' activesupport (3.2.17) lib/active_support/notifications/instrumenter.rb:20:ininstrument' activesupport (3.2.17) lib/active_support/notifications.rb:123:ininstrument' actionpack (3.2.17) lib/action_view/renderer/abstract_renderer.rb:38:ininstrument' actionpack (3.2.17) lib/action_view/renderer/template_renderer.rb:46:inblock in render_template' actionpack (3.2.17) lib/action_view/renderer/template_renderer.rb:54:inrender_with_layout' actionpack (3.2.17) lib/action_view/renderer/template_renderer.rb:45:inrender_template' render_parent (0.0.5) lib/render_parent/rails3/on_load_action_view.rb:58:inrender_template_with_active_template' actionpack (3.2.17) lib/action_view/renderer/template_renderer.rb:18:inrender' actionpack (3.2.17) lib/action_view/renderer/renderer.rb:36:inrender_template' actionpack (3.2.17) lib/action_view/renderer/renderer.rb:17:inrender' actionpack (3.2.17) lib/abstract_controller/rendering.rb:110:in_render_template' actionpack (3.2.17) lib/action_controller/metal/streaming.rb:225:in_render_template' actionpack (3.2.17) lib/abstract_controller/rendering.rb:103:inrender_to_body' actionpack (3.2.17) lib/action_controller/metal/renderers.rb:28:inrender_to_body' actionpack (3.2.17) lib/action_controller/metal/compatibility.rb:50:inrender_to_body' actionpack (3.2.17) lib/abstract_controller/rendering.rb:88:inrender' actionpack (3.2.17) lib/action_controller/metal/rendering.rb:16:inrender' actionpack (3.2.17) lib/action_controller/metal/instrumentation.rb:40:inblock (2 levels) in render' activesupport (3.2.17) lib/active_support/core_ext/benchmark.rb:5:inblock in ms' /opt/bitnami/ruby/lib/ruby/1.9.1/benchmark.rb:295:inrealtime' activesupport (3.2.17) lib/active_support/core_ext/benchmark.rb:5:inms' actionpack (3.2.17) lib/action_controller/metal/instrumentation.rb:40:inblock in render' actionpack (3.2.17) lib/action_controller/metal/instrumentation.rb:83:incleanup_view_runtime' activerecord (3.2.17) lib/active_record/railties/controller_runtime.rb:24:incleanup_view_runtime' actionpack (3.2.17) lib/action_controller/metal/instrumentation.rb:39:inrender' plugins/csv_import_issues/app/controllers/csv_imports_controller.rb:16:increate' actionpack (3.2.17) lib/action_controller/metal/implicit_render.rb:4:insend_action' actionpack (3.2.17) lib/abstract_controller/base.rb:167:inprocess_action' actionpack (3.2.17) lib/action_controller/metal/rendering.rb:10:inprocess_action' actionpack (3.2.17) lib/abstract_controller/callbacks.rb:18:inblock in process_action' activesupport (3.2.17) lib/active_support/callbacks.rb:524:in_run__3483549384554027071__process_action__555887551913359625__callbacks' activesupport (3.2.17) lib/active_support/callbacks.rb:405:inrun_callback' activesupport (3.2.17) lib/active_support/callbacks.rb:385:in_run_process_action_callbacks' activesupport (3.2.17) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (3.2.17) lib/abstract_controller/callbacks.rb:17:inprocess_action' actionpack (3.2.17) lib/action_controller/metal/rescue.rb:29:inprocess_action' actionpack (3.2.17) lib/action_controller/metal/instrumentation.rb:30:inblock in process_action' activesupport (3.2.17) lib/active_support/notifications.rb:123:inblock in instrument' activesupport (3.2.17) lib/active_support/notifications/instrumenter.rb:20:ininstrument' activesupport (3.2.17) lib/active_support/notifications.rb:123:ininstrument' actionpack (3.2.17) lib/action_controller/metal/instrumentation.rb:29:inprocess_action' actionpack (3.2.17) lib/action_controller/metal/params_wrapper.rb:207:inprocess_action' activerecord (3.2.17) lib/active_record/railties/controller_runtime.rb:18:inprocess_action' actionpack (3.2.17) lib/abstract_controller/base.rb:121:inprocess' actionpack (3.2.17) lib/abstract_controller/rendering.rb:45:inprocess' actionpack (3.2.17) lib/action_controller/metal.rb:203:indispatch' actionpack (3.2.17) lib/action_controller/metal/rack_delegation.rb:14:indispatch' actionpack (3.2.17) lib/action_controller/metal.rb:246:inblock in action' actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:73:incall' actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:73:indispatch' actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:36:incall' journey (1.0.4) lib/journey/router.rb:68:inblock in call' journey (1.0.4) lib/journey/router.rb:56:ineach' journey (1.0.4) lib/journey/router.rb:56:incall' actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:608:incall' rack-openid (1.3.1) lib/rack/openid.rb:98:incall' actionpack (3.2.17) lib/action_dispatch/middleware/best_standards_support.rb:17:incall' rack (1.4.5) lib/rack/etag.rb:23:incall' rack (1.4.5) lib/rack/conditionalget.rb:35:incall' actionpack (3.2.17) lib/action_dispatch/middleware/head.rb:14:incall' actionpack (3.2.17) lib/action_dispatch/middleware/params_parser.rb:21:incall' actionpack (3.2.17) lib/action_dispatch/middleware/flash.rb:242:incall' rack (1.4.5) lib/rack/session/abstract/id.rb:210:incontext' rack (1.4.5) lib/rack/session/abstract/id.rb:205:incall' actionpack (3.2.17) lib/action_dispatch/middleware/cookies.rb:341:incall' activerecord (3.2.17) lib/active_record/query_cache.rb:64:incall' activerecord (3.2.17) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:incall' actionpack (3.2.17) lib/action_dispatch/middleware/callbacks.rb:28:inblock in call' activesupport (3.2.17) lib/active_support/callbacks.rb:405:in_run__807205419014871343__call__2441953962475414946__callbacks' activesupport (3.2.17) lib/active_support/callbacks.rb:405:inrun_callback' activesupport (3.2.17) lib/active_support/callbacks.rb:385:in_run_call_callbacks' activesupport (3.2.17) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (3.2.17) lib/action_dispatch/middleware/callbacks.rb:27:incall' actionpack (3.2.17) lib/action_dispatch/middleware/remote_ip.rb:31:incall' actionpack (3.2.17) lib/action_dispatch/middleware/debug_exceptions.rb:16:incall' actionpack (3.2.17) lib/action_dispatch/middleware/show_exceptions.rb:56:incall' railties (3.2.17) lib/rails/rack/logger.rb:32:incall_app' railties (3.2.17) lib/rails/rack/logger.rb:16:inblock in call' activesupport (3.2.17) lib/active_support/tagged_logging.rb:22:intagged' railties (3.2.17) lib/rails/rack/logger.rb:16:incall' actionpack (3.2.17) lib/action_dispatch/middleware/request_id.rb:22:incall' rack (1.4.5) lib/rack/methodoverride.rb:21:incall' rack (1.4.5) lib/rack/runtime.rb:17:incall' activesupport (3.2.17) lib/active_support/cache/strategy/local_cache.rb:72:incall' rack (1.4.5) lib/rack/lock.rb:15:incall' actionpack (3.2.17) lib/action_dispatch/middleware/static.rb:63:incall' rack-cache (1.2) lib/rack/cache/context.rb:136:inforward' rack-cache (1.2) lib/rack/cache/context.rb:143:inpass' rack-cache (1.2) lib/rack/cache/context.rb:155:ininvalidate' rack-cache (1.2) lib/rack/cache/context.rb:71:incall!' rack-cache (1.2) lib/rack/cache/context.rb:51:incall' railties (3.2.17) lib/rails/engine.rb:484:incall' railties (3.2.17) lib/rails/application.rb:231:incall' railties (3.2.17) lib/rails/railtie/configurable.rb:30:inmethod_missing' rack (1.4.5) lib/rack/builder.rb:134:incall' rack (1.4.5) lib/rack/urlmap.rb:64:inblock in call' rack (1.4.5) lib/rack/urlmap.rb:49:ineach' rack (1.4.5) lib/rack/urlmap.rb:49:incall' passenger (4.0.33) lib/phusion_passenger/rack/thread_handler_extension.rb:77:inprocess_request' passenger (4.0.33) lib/phusion_passenger/request_handler/thread_handler.rb:141:inaccept_and_process_next_request' passenger (4.0.33) lib/phusion_passenger/request_handler/thread_handler.rb:109:inmain_loop' passenger (4.0.33) lib/phusion_passenger/request_handler.rb:440:inblock (3 levels) in start_threads'

balagab commented 10 years ago

ActionView::Template::Error (invalid byte sequence in UTF-8): 26: <% @csv_rows[0].each_with_index do |value, index| %> 27: 28: <%= value.force_encoding("utf-8") %> 29: <%= @csv_rows[1][index].force_encoding("utf-8") %> 30: <% @options = params[:options][index] if params[:import] %> 31: 32: <%= select_tag :options, options_for_select(@query, :selected => @options), {:name => "options[]", :prompt => "No Match (Skip)"}

stpl commented 10 years ago

@balagab

We are still not able to replicate the issue with "Normál", Please provide the csv file.

balagab commented 10 years ago

@stpl Ok, how can I attache csv? (Unfortunately, we don't support that file type. Try again with a PNG, GIF, or JPG.)

Thanks

balagab commented 10 years ago

Please find attached the csv.

From: Systango SysTech [mailto:notifications@github.com] Sent: Tuesday, October 28, 2014 4:00 PM To: stpl/csv_import_issues Cc: Balázs Gábor Subject: Re: [csv_import_issues] Internall error - accents (#10)

@balagabhttps://github.com/balagab

We are still not able to replicate the issue with "Normál", Please provide the csv file.

— Reply to this email directly or view it on GitHubhttps://github.com/stpl/csv_import_issues/issues/10#issuecomment-60769154.