views:

279

answers:

1

Hi everyone,

I'm setting up jQuery and Uploadify in my Rails app (with the uploadify-rails plugin). Its all going fine, the flash is loaded, the authenticity paramater is passed through along with the session key and so on. However, my MySQL queries on the way to handling the upload from the flash are all reporting a 'redundant UTF-8 sequence' error. It doesn't matter what the SQL seems to be, just that the first one called gets the error:

Processing RoomsController#update to json (for 86.162.102.136 at 2010-04-26 11:27:55) [PUT]
Parameters: {"Filename"=>"fb-logo.png",  "_myapp_session"=>"BAh7CzoPc2Vzc2lvbl9pZCIlY2I5N2FjYjQ4ZjcwMmQzMzQxMjIwMmRmN2EwM2ZhZWM6EWludmFsaWRfdXNlckY6EF9jc3JmX3Rva2VuIjEzSWtvaGJrWDNhQXV6OGtuUllyMmdhbkVnR3JKV2QrM3RrVVJZaTJiak1vPToQam9pbl9zb3VyY2UiN2h0dHA6Ly9iZXRhLmNyYXNocGFkZGVyLmNvbS9wcm9maWxlL2V4Y2VsbGVudGxhcmtzIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsAOgx1c2VyX2lkaQY=--52b594041395bf8cf5998859eb43c4ed82c74490", "format"=>"json", "folder"=>"/rooms/", "action"=>"update", "authenticity_token"=>"3IkohkX3aAuz8knRYr2ganEgGrJWd 3tkURYi2bjMo=", "_method"=>"PUT", "id"=>"2120", "Upload"=>"Submit Query", "fileext"=>"*.jpg;*.jpeg;*.gif;*.png", "controller"=>"rooms", "room"=>{"photo_uploads"=>#<File:/tmp/RackMultipart20100426-1152-12dn5rn-0>}}
  [4;36;1mUser Load (0.0ms)[0m   [0;1mArgumentError: redundant UTF-8 sequence: SELECT * FROM `users` WHERE (`users`.`id` = 1) LIMIT 1[0m

ActiveRecord::StatementInvalid (ArgumentError: redundant UTF-8 sequence: SELECT * FROM `users` WHERE (`users`.`id` = 1)  LIMIT 1):
lib/authenticated_system.rb:109:in `login_from_session'
lib/authenticated_system.rb:12:in `current_user'
app/controllers/application_controller.rb:296:in `setup_page_titles'
lib/redis_db_logging.rb:18:in `enable_redis_logging'
lib/redis_logger.rb:43:in `redisize'
lib/redis_logger.rb:42:in `redisize'
lib/redis_db_logging.rb:11:in `enable_redis_logging'
haml (2.2.2) lib/sass/plugin/rails.rb:19:in `process_without_compass'
/home/crashpaddernew/.gem/ruby/1.8/gems/chriseppstein-compass-0.8.8/lib/compass/app_integration/rails/action_controller.rb:7:in `process'
/dh/passenger/lib/phusion_passenger/rack/request_handler.rb:91:in `process_request'
/dh/passenger/lib/phusion_passenger/abstract_request_handler.rb:206:in `main_loop'
/dh/passenger/lib/phusion_passenger/railz/application_spawner.rb:376:in `start_request_handler'
/dh/passenger/lib/phusion_passenger/railz/application_spawner.rb:334:in `handle_spawn_application'
/dh/passenger/lib/phusion_passenger/utils.rb:182:in `safe_fork'
/dh/passenger/lib/phusion_passenger/railz/application_spawner.rb:332:in `handle_spawn_application'
/dh/passenger/lib/phusion_passenger/abstract_server.rb:351:in `__send__'
/dh/passenger/lib/phusion_passenger/abstract_server.rb:351:in `main_loop'
/dh/passenger/lib/phusion_passenger/abstract_server.rb:195:in `start_synchronously'
/dh/passenger/lib/phusion_passenger/abstract_server.rb:162:in `start'
/dh/passenger/lib/phusion_passenger/railz/application_spawner.rb:213:in `start'
/dh/passenger/lib/phusion_passenger/spawn_manager.rb:261:in `spawn_rails_application'

Does anyone know what a 'redundant UTF-8 sequence' error is, and why requests coming from the flash uploader are causing it? Or is it a problem with the JSON somehow?

Thanks,

Dan

A: 

I believe you're running into this bug:

https://rails.lighthouseapp.com/projects/8994/tickets/1112-redundant-utf-8-sequence-in-stringto_json

Seems to failing on your authenticate from session call, perhaps your session key has the characters mentioned in the bug report.

MatthewFord