ari / jobsworth

Project Management, Collaboration and Time Tracking.
GNU Affero General Public License v3.0
640 stars 198 forks source link

incompatible character encodings: UTF-8 and ASCII-8BIT #451

Open Siddius opened 10 years ago

Siddius commented 10 years ago

There is an problem with using special characters. If you use a task name like "öäü" you get the error msg. sometimes, not always. After that jobsworth isnt working at all. After waiting a few hours everthing works fine again, and you are also able to edit the task, and all characters are shown right.

i am using Ubuntu with tomcat6 and the WAR file, utf8 unicode is set in mysql database, tables and connection. This problem hast been discussed here: https://groups.google.com/forum/#!topic/jobsworth/0Wx1ORi-C8o

ActionView::Template::Error occurred in tasks#index:

incompatible character encodings: UTF-8 and ASCII-8BIT org/jruby/RubyString.java:2611:in `concat'

Request:

Session:

Environment:

Backtrace:

org/jruby/RubyString.java:2611:in concat' gems/gems/activesupport-3.2.13/lib/active_support/core_ext/string/output_safety.rb:133:inconcat' gems/gems/actionpack-3.2.13/lib/action_view/buffers.rb:11:in <<' app/views/layouts/_flash.html.erb:4:in_app_views_layoutsflash_html_erb1880235414_17144' org/jruby/RubyHash.java:1257:in each' gems/gems/actionpack-3.2.13/lib/action_dispatch/middleware/flash.rb:136:ineach' app/views/layouts/_flash.html.erb:1:in _app_views_layouts__flash_html_erb__1880235414_17144' org/jruby/RubyBasicObject.java:1689:insend' org/jruby/RubyKernel.java:2111:in send' gems/gems/actionpack-3.2.13/lib/action_view/template.rb:145:inrender' gems/gems/activesupport-3.2.13/lib/active_support/notifications.rb:125:in instrument' gems/gems/actionpack-3.2.13/lib/action_view/template.rb:143:inrender' gems/gems/actionpack-3.2.13/lib/action_view/renderer/partial_renderer.rb:265:in render_partial' gems/gems/actionpack-3.2.13/lib/action_view/renderer/partial_renderer.rb:238:inrender' gems/gems/actionpack-3.2.13/lib/action_view/renderer/abstract_renderer.rb:38:in instrument' gems/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:ininstrument' gems/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in instrument' gems/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:19:ininstrument' gems/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:in instrument' gems/gems/actionpack-3.2.13/lib/action_view/renderer/abstract_renderer.rb:38:ininstrument' gems/gems/actionpack-3.2.13/lib/action_view/renderer/partial_renderer.rb:237:in render' gems/gems/actionpack-3.2.13/lib/action_view/renderer/renderer.rb:41:inrender_partial' gems/gems/actionpack-3.2.13/lib/action_view/renderer/renderer.rb:15:in render' gems/gems/actionpack-3.2.13/lib/action_view/helpers/rendering_helper.rb:24:inrender' app/views/layouts/_notice.html.erb:1:in _app_views_layouts__notice_html_erb___1759524450_17140' org/jruby/RubyBasicObject.java:1689:insend' org/jruby/RubyKernel.java:2111:in send' gems/gems/actionpack-3.2.13/lib/action_view/template.rb:145:inrender' gems/gems/activesupport-3.2.13/lib/active_support/notifications.rb:125:in instrument' gems/gems/actionpack-3.2.13/lib/action_view/template.rb:143:inrender' gems/gems/actionpack-3.2.13/lib/action_view/renderer/partial_renderer.rb:265:in render_partial' gems/gems/actionpack-3.2.13/lib/action_view/renderer/partial_renderer.rb:238:inrender' gems/gems/actionpack-3.2.13/lib/action_view/renderer/abstract_renderer.rb:38:in instrument' gems/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:ininstrument' gems/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in instrument' gems/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:19:ininstrument' gems/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:in instrument' gems/gems/actionpack-3.2.13/lib/action_view/renderer/abstract_renderer.rb:38:ininstrument' gems/gems/actionpack-3.2.13/lib/action_view/renderer/partial_renderer.rb:237:in render' gems/gems/actionpack-3.2.13/lib/action_view/renderer/renderer.rb:41:inrender_partial' gems/gems/actionpack-3.2.13/lib/action_view/renderer/renderer.rb:15:in render' gems/gems/actionpack-3.2.13/lib/action_view/helpers/rendering_helper.rb:24:inrender' app/views/layouts/basic.html.erb:34:in _app_views_layouts_basic_html_erb___737963601_16920' org/jruby/RubyBasicObject.java:1689:insend' org/jruby/RubyKernel.java:2111:in send' gems/gems/actionpack-3.2.13/lib/action_view/template.rb:145:inrender' gems/gems/activesupport-3.2.13/lib/active_support/notifications.rb:125:in instrument' gems/gems/actionpack-3.2.13/lib/action_view/template.rb:143:inrender' gems/gems/actionpack-3.2.13/lib/action_view/renderer/template_renderer.rb:47:in render_template' gems/gems/actionpack-3.2.13/lib/action_view/renderer/abstract_renderer.rb:38:ininstrument' gems/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:in instrument' gems/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:ininstrument' gems/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:19:in instrument' gems/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:ininstrument' gems/gems/actionpack-3.2.13/lib/action_view/renderer/abstract_renderer.rb:38:in instrument' gems/gems/actionpack-3.2.13/lib/action_view/renderer/template_renderer.rb:46:inrender_template' gems/gems/actionpack-3.2.13/lib/action_view/renderer/template_renderer.rb:54:in render_with_layout' gems/gems/actionpack-3.2.13/lib/action_view/renderer/template_renderer.rb:45:inrender_template' gems/gems/actionpack-3.2.13/lib/action_view/renderer/template_renderer.rb:18:in render' gems/gems/actionpack-3.2.13/lib/action_view/renderer/renderer.rb:36:inrender_template' gems/gems/actionpack-3.2.13/lib/action_view/renderer/renderer.rb:17:in render' gems/gems/actionpack-3.2.13/lib/action_view/helpers/rendering_helper.rb:24:inrender' app/views/layouts/application.html.erb:15:in _app_views_layouts_application_html_erb___1717954070_16822' org/jruby/RubyBasicObject.java:1689:insend' org/jruby/RubyKernel.java:2111:in send' gems/gems/actionpack-3.2.13/lib/action_view/template.rb:145:inrender' gems/gems/activesupport-3.2.13/lib/active_support/notifications.rb:125:in instrument' gems/gems/actionpack-3.2.13/lib/action_view/template.rb:143:inrender' gems/gems/actionpack-3.2.13/lib/action_view/renderer/template_renderer.rb:59:in render_with_layout' gems/gems/actionpack-3.2.13/lib/action_view/renderer/template_renderer.rb:45:inrender_template' gems/gems/actionpack-3.2.13/lib/action_view/renderer/template_renderer.rb:18:in render' gems/gems/actionpack-3.2.13/lib/action_view/renderer/renderer.rb:36:inrender_template' gems/gems/actionpack-3.2.13/lib/action_view/renderer/renderer.rb:17:in render' gems/gems/actionpack-3.2.13/lib/abstract_controller/rendering.rb:110:in_render_template' gems/gems/actionpack-3.2.13/lib/action_controller/metal/streaming.rb:225:in _render_template' gems/gems/actionpack-3.2.13/lib/abstract_controller/rendering.rb:103:inrender_to_body' gems/gems/actionpack-3.2.13/lib/action_controller/metal/renderers.rb:28:in render_to_body' gems/gems/actionpack-3.2.13/lib/action_controller/metal/compatibility.rb:50:inrender_to_body' gems/gems/actionpack-3.2.13/lib/abstract_controller/rendering.rb:88:in render' gems/gems/actionpack-3.2.13/lib/action_controller/metal/rendering.rb:16:inrender' gems/gems/actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:40:in render' gems/gems/activesupport-3.2.13/lib/active_support/core_ext/benchmark.rb:5:inms' jar:file:lib/gems-gems-jruby-jars-1.7.3-lib-jruby-stdlib-1.7.3.jar!/META-INF/jruby.home/lib/ruby/1.9/benchmark.rb:295:in realtime' gems/gems/activesupport-3.2.13/lib/active_support/core_ext/benchmark.rb:5:inms' gems/gems/actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:40:in render' gems/gems/actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:83:incleanup_view_runtime' gems/gems/activerecord-3.2.13/lib/active_record/railties/controller_runtime.rb:24:in cleanup_view_runtime' gems/gems/actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:39:inrender' gems/gems/remotipart-1.0.5/lib/remotipart/render_overrides.rb:14:in render_with_remotipart' gems/gems/actionpack-3.2.13/lib/action_controller/metal/implicit_render.rb:10:indefault_render' gems/gems/actionpack-3.2.13/lib/action_controller/metal/mime_responds.rb:196:in respond_to' app/controllers/tasks_controller.rb:18:inindex' org/jruby/RubyBasicObject.java:1677:in __send__' org/jruby/RubyKernel.java:2103:insend' gems/gems/actionpack-3.2.13/lib/action_controller/metal/implicit_render.rb:4:insend_action' gems/gems/actionpack-3.2.13/lib/abstract_controller/base.rb:167:inprocess_action' gems/gems/actionpack-3.2.13/lib/action_controller/metal/rendering.rb:10:inprocess_action' gems/gems/actionpack-3.2.13/lib/abstract_controller/callbacks.rb:18:inprocess_action' gems/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:450:in_run__120939935__process_action__1375380497__callbacks' org/jruby/RubyBasicObject.java:1677:insend' org/jruby/RubyKernel.java:2103:in send' gems/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:inrun_callback' gems/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:390:in _run_process_action_callbacks' org/jruby/RubyBasicObject.java:1683:in__send' org/jruby/RubyKernel.java:2107:in send' gems/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:inrun_callbacks' gems/gems/actionpack-3.2.13/lib/abstract_controller/callbacks.rb:17:in process_action' gems/gems/actionpack-3.2.13/lib/action_controller/metal/rescue.rb:29:inprocess_action' gems/gems/actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:30:in process_action' gems/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:ininstrument' gems/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in instrument' gems/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:19:ininstrument' gems/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:in instrument' gems/gems/actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:29:inprocess_action' gems/gems/actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:207:in process_action' gems/gems/activerecord-3.2.13/lib/active_record/railties/controller_runtime.rb:18:inprocess_action' gems/gems/actionpack-3.2.13/lib/abstract_controller/base.rb:121:in process' gems/gems/actionpack-3.2.13/lib/abstract_controller/rendering.rb:45:inprocess' gems/gems/actionpack-3.2.13/lib/action_controller/metal.rb:203:in dispatch' gems/gems/actionpack-3.2.13/lib/action_controller/metal/rack_delegation.rb:14:indispatch' gems/gems/actionpack-3.2.13/lib/action_controller/metal.rb:246:in action' org/jruby/RubyProc.java:249:incall' gems/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:73:in dispatch' gems/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:36:incall' gems/gems/journey-1.0.4/lib/journey/router.rb:68:in call' org/jruby/RubyArray.java:1613:ineach' gems/gems/journey-1.0.4/lib/journey/router.rb:56:in call' gems/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:612:incall' gems/gems/exception_notification-2.6.1/lib/exception_notifier.rb:34:in call' gems/gems/warden-1.2.1/lib/warden/manager.rb:35:incall' org/jruby/RubyKernel.java:1174:in catch' gems/gems/warden-1.2.1/lib/warden/manager.rb:34:incall' gems/gems/actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb:17:in call' gems/gems/rack-1.4.5/lib/rack/etag.rb:23:incall' gems/gems/rack-1.4.5/lib/rack/conditionalget.rb:25:in call' gems/gems/actionpack-3.2.13/lib/action_dispatch/middleware/head.rb:14:incall' gems/gems/remotipart-1.0.5/lib/remotipart/middleware.rb:30:in call' gems/gems/actionpack-3.2.13/lib/action_dispatch/middleware/params_parser.rb:21:incall' gems/gems/actionpack-3.2.13/lib/action_dispatch/middleware/flash.rb:242:in call' gems/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:incontext' gems/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in call' gems/gems/actionpack-3.2.13/lib/action_dispatch/middleware/cookies.rb:341:incall' gems/gems/activerecord-3.2.13/lib/active_record/query_cache.rb:64:in call' gems/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:incall' gems/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:28:in call' gems/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:408:in_run1721873687call1900997266callbacks' org/jruby/RubyBasicObject.java:1677:in __send__' org/jruby/RubyKernel.java:2103:insend' gems/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in**run_callback' gems/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:390:in_run_call_callbacks' org/jruby/RubyBasicObject.java:1677:in__send**' org/jruby/RubyKernel.java:2103:insend' gems/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:inrun_callbacks' gems/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:27:incall' gems/gems/actionpack-3.2.13/lib/action_dispatch/middleware/remote_ip.rb:31:incall' gems/gems/actionpack-3.2.13/lib/action_dispatch/middleware/debug_exceptions.rb:16:incall' gems/gems/actionpack-3.2.13/lib/action_dispatch/middleware/show_exceptions.rb:56:incall' gems/gems/railties-3.2.13/lib/rails/rack/logger.rb:32:incall_app' gems/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:incall' gems/gems/activesupport-3.2.13/lib/active_support/tagged_logging.rb:22:intagged' gems/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:incall' gems/gems/actionpack-3.2.13/lib/action_dispatch/middleware/request_id.rb:22:incall' gems/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:incall' gems/gems/rack-1.4.5/lib/rack/runtime.rb:17:incall' gems/gems/activesupport-3.2.13/lib/active_support/cache/strategy/local_cache.rb:72:incall' gems/gems/actionpack-3.2.13/lib/action_dispatch/middleware/static.rb:63:incall' gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:inforward' gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:infetch' gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:inlookup' gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:incall!' gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:incall' gems/gems/railties-3.2.13/lib/rails/engine.rb:479:incall' gems/gems/railties-3.2.13/lib/rails/application.rb:223:incall' file:lib/gems-gems-jruby-rack-1.1.13.2-lib-jruby-rack-1.1.13.2.jar!/rack/handler/servlet.rb:22:incall'

vkosh commented 10 years ago

I can confirm this one for 4.0 beta 1 release. My environment is: tomcat 7 on ubuntu 12.04, system locale is ru_RU.UTF-8, mysql db encoding is utf8. Steps to reproduce:

  1. create task with unicode characters in task name and/or description
  2. save it
  3. get and email about task created - this step is ok
  4. get the " incompatible character encodings: UTF-8 and ASCII-8BIT org/jruby/RubyString.java:2611:in `concat'" error on any request to jobsworh.
  5. after clearing cookies and relogin the error disappears until create/update action with unicode chars.

I had to downgrade to 984b3a94 commit - it fixes some early bugs and still works on ruby-1.9.3 (failed to make jobsworth work on jruby-1.7.4 + phusion passenger + apache).

ari commented 10 years ago

Vikrant, do we have some non UTF templates still?

nasa42 commented 10 years ago

Everything is UTF-8 by default in the application (and in database if properly configured). This is probably something more complicated. I'm working on reproducing this and then I may have more to say about this.

ari commented 10 years ago

Given that the Hungarians translated the whole app successfully, I think we should focus on merging their changes. Perhaps that will fix the problem. I see in the fork tree that Juan created some merges for this code.

ari commented 10 years ago

Ignore that last bit about @juan-hawa since I can see he hasn't prepared a pull request. But still, we can do that work soon to merge in the Hungarian i18n improvements.