joshfrench / rakismet

Easy Akismet and TypePad AntiSpam integration for Rails
MIT License
355 stars 46 forks source link

ArgumentError: invalid byte sequence in UTF-8 in ruby-1.9.2-p136 #10

Closed szTheory closed 11 years ago

szTheory commented 13 years ago

Error happens on this line, when I'm trying to call .spam? on a comment: @post.comments << @comment unless @comment.spam?

Only happens on comments with UTF-8 characters.

Stack trace: /home/monk/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/cgi/util.rb:7:in `gsub'

/home/monk/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/cgi/util.rb:7:in `escape'

[GEM_ROOT]/gems/rakismet-1.0.1/lib/rakismet.rb:65:in `block (2 levels) in akismet_call'

[GEM_ROOT]/gems/rakismet-1.0.1/lib/rakismet.rb:65:in `each'

[GEM_ROOT]/gems/rakismet-1.0.1/lib/rakismet.rb:65:in `map'

[GEM_ROOT]/gems/rakismet-1.0.1/lib/rakismet.rb:65:in `block in akismet_call'

/home/monk/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/net/http.rb:627:in `start'

/home/monk/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/net/http.rb:490:in `start'

[GEM_ROOT]/gems/rakismet-1.0.1/lib/rakismet.rb:64:in `akismet_call'

[GEM_ROOT]/gems/rakismet-1.0.1/lib/rakismet/model.rb:37:in `spam?'

app/controllers/blog_controller.rb:127:in `comment'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_controller/metal/implicit_render.rb:4:in `send_action'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/abstract_controller/base.rb:150:in `process_action'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_controller/metal/rendering.rb:11:in `process_action'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/abstract_controller/callbacks.rb:18:in `block in process_action'

[GEM_ROOT]/gems/activesupport-3.0.4/lib/active_support/callbacks.rb:450:in `_run2145909047847877237process_action3443656973696802015callbacks'

[GEM_ROOT]/gems/activesupport-3.0.4/lib/active_support/callbacks.rb:409:in `_run_process_action_callbacks'

[GEM_ROOT]/gems/activesupport-3.0.4/lib/active_support/callbacks.rb:93:in `run_callbacks'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/abstract_controller/callbacks.rb:17:in `process_action'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'

[GEM_ROOT]/gems/activesupport-3.0.4/lib/active_support/notifications.rb:52:in `block in instrument'

[GEM_ROOT]/gems/activesupport-3.0.4/lib/active_support/notifications/instrumenter.rb:21:in `instrument'

[GEM_ROOT]/gems/activesupport-3.0.4/lib/active_support/notifications.rb:52:in `instrument'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_controller/metal/instrumentation.rb:29:in `process_action'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_controller/metal/rescue.rb:17:in `process_action'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/abstract_controller/base.rb:119:in `process'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/abstract_controller/rendering.rb:41:in `process'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_controller/metal.rb:138:in `dispatch'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_controller/metal.rb:178:in `block in action'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_dispatch/routing/route_set.rb:62:in `call'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_dispatch/routing/route_set.rb:27:in `call'

[GEM_ROOT]/gems/rack-mount-0.6.13/lib/rack/mount/route_set.rb:148:in `block in call'

[GEM_ROOT]/gems/rack-mount-0.6.13/lib/rack/mount/code_generation.rb:93:in `block in recognize'

[GEM_ROOT]/gems/rack-mount-0.6.13/lib/rack/mount/code_generation.rb:89:in `optimized_each'

[GEM_ROOT]/gems/rack-mount-0.6.13/lib/rack/mount/code_generation.rb:92:in `recognize'

[GEM_ROOT]/gems/rack-mount-0.6.13/lib/rack/mount/route_set.rb:139:in `call'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_dispatch/routing/route_set.rb:492:in `call'

[GEM_ROOT]/gems/rakismet-1.0.1/lib/rakismet/middleware.rb:10:in `call'

[GEM_ROOT]/gems/haml-3.0.25/lib/sass/plugin/rack.rb:41:in `call'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_dispatch/middleware/head.rb:14:in `call'

[GEM_ROOT]/gems/rack-1.2.1/lib/rack/methodoverride.rb:24:in `call'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_dispatch/middleware/params_parser.rb:21:in `call'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_dispatch/middleware/flash.rb:182:in `call'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_dispatch/middleware/cookies.rb:302:in `call'

[GEM_ROOT]/gems/activerecord-3.0.4/lib/active_record/query_cache.rb:32:in `block in call'

[GEM_ROOT]/gems/activerecord-3.0.4/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'

[GEM_ROOT]/gems/activerecord-3.0.4/lib/active_record/query_cache.rb:12:in `cache'

[GEM_ROOT]/gems/activerecord-3.0.4/lib/active_record/query_cache.rb:31:in `call'

[GEM_ROOT]/gems/activerecord-3.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'

[GEM_ROOT]/gems/activesupport-3.0.4/lib/active_support/callbacks.rb:415:in `_run_call_callbacks'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_dispatch/middleware/callbacks.rb:44:in `call'

[GEM_ROOT]/gems/rack-1.2.1/lib/rack/sendfile.rb:107:in `call'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'

[GEM_ROOT]/gems/actionpack-3.0.4/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'

[GEM_ROOT]/gems/railties-3.0.4/lib/rails/rack/logger.rb:13:in `call'

[GEM_ROOT]/gems/rack-1.2.1/lib/rack/runtime.rb:17:in `call'

[GEM_ROOT]/gems/rack-1.2.1/lib/rack/lock.rb:11:in `block in call'

:

[GEM_ROOT]/gems/rack-1.2.1/lib/rack/lock.rb:11:in `call'

[GEM_ROOT]/gems/railties-3.0.4/lib/rails/application.rb:168:in `call'

[GEM_ROOT]/gems/railties-3.0.4/lib/rails/application.rb:77:in `method_missing'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/rack/application_spawner.rb:205:in `start_request_handler'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/rack/application_spawner.rb:170:in `block in handle_spawn_application'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/utils.rb:479:in `safe_fork'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/rack/application_spawner.rb:165:in `handle_spawn_application'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:180:in `start'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/rack/application_spawner.rb:128:in `start'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'

:

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'

/home/monk/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/helper-scripts/passenger-spawn-server:99:in `

'

joshfrench commented 13 years ago

Can you paste some strings that are triggering this? I can't reproduce it.