ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

ArgumentError (invalid byte sequence in US-ASCII) (Bug #591)


Added by Jeff Schoolcraft at 2011-08-24 12:12 pm. Updated at 2011-10-29 07:25 pm.


Status:Closed Start date:2011-08-24
Priority:Normal Due date:
Assignee:Holger Just % Done:

0%

Category:-
Target version:2.4.0
Remote issue URL: Affected version:master

Description

> log/access.log <
108.28.118.178 - - [24/Aug/2011:08:10:33 -0400] "GET /users/new HTTP/1.1" 500 1312 "http://cp.thequeue.net/users" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.831.0 Safari/535.1" > log/production.log <

Processing UsersController#new (for 108.28.118.178 at 2011-08-24 08:10:33) [GET]
Parameters: {"controller"=>"users", "action"=>"new"}
Rendering template within layouts/admin
Rendering users/new
Completed in 45ms (View: 41, DB: 1) | 200 OK [http://cp.thequeue.net/users/new]

Processing ApplicationController#new (for 108.28.118.178 at 2011-08-24 08:10:33) [GET]
Parameters: {"controller"=>"users", "action"=>"new"}

ArgumentError (invalid byte sequence in US-ASCII):
<internal:prelude>:10:in `synchronize'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `block in handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/utils.rb:479:in `safe_fork'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:180:in `start'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:219:in `block (2 levels) in spawn_rails_application'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:214:in `block in spawn_rails_application'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
<internal:prelude>:10:in `synchronize'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/helper-scripts/passenger-spawn-server:99:in `<main>'

Rendering /var/www/apps/chiliproject/releases/20110824113807/public/500.html (500 Internal Server Error)


Associated revisions

Revision 667c4d15
Added by Holger Just at 2011-10-29 09:22 pm

[#591] Merge branch 'issues/master/591-ruby-19-compatibility' from 'meineerde'

History

Updated by Jeff Schoolcraft at 2011-08-24 12:44 pm

Also getting on:

users/add
users/edit

issue/show after issue/update

Processing ApplicationController#show (for 108.28.118.178 at 2011-08-24 08:41:40) [GET]
  Parameters: {"controller"=>"issues", "action"=>"show", "id"=>"649"}

ArgumentError (invalid byte sequence in US-ASCII):
  <internal:prelude>:10:in `synchronize'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `block in handle_spawn_application'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/utils.rb:479:in `safe_fork'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:180:in `start'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:219:in `block (2 levels) in spawn_rails_application'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:214:in `block in spawn_rails_application'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
  <internal:prelude>:10:in `synchronize'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/helper-scripts/passenger-spawn-server:99:in `<main>'

Updated by Jeff Schoolcraft at 2011-08-24 12:57 pm

I've seen comments on stack overflow about it being an improperly set environment variable, but the only one I have (I think) that deals with encoding is:

jschoolcraft@base:~$ export | grep en_US
declare -x LANG="en_US.UTF-8" 

I've also tried forcing the encoding in application controller as mentioned in the bottom of http://stackoverflow.com/questions/3597255/why-does-my-sproutcore-development-server-drop-connections-with-invalid-byte-seq/3598303#3598303 to no avail.

Updated by Holger Just at 2011-10-29 12:58 pm

I just send a pull request at https://github.com/chiliproject/chiliproject/pull/116 which should make us as compatible as currently possible with Ruby 1.9. It would be great if someone could have a look at it prior to merging. I confident it works, but another look couldn't hurt...

The patch set defaults internal and external encoding to UTF-8 when using Ruby 1.9.

It also adds an additional rake task `code:source-encoding` to set a magic comment on all ruby files to set the source encoding also to UTF-8. Without this magic comment, Ruby assumes US-ASCII encoding which clashes with UTF-8 string retrieved from the outside when performing certain string operations like concatenation or formatting.

This patch set should tremendously improve our Ruby 1.9 compatibility. The only issues I could still observe where concerned with some app servers / rack / rails where there still seemed to be a clash with string encodings. This is something we could only fix with using a newer Rack and Rails however...

  • Target version set to 2.4.0
  • Assignee set to Holger Just

Updated by Holger Just at 2011-10-29 07:25 pm

Okay, I pushed the changes in 667c4d1. If there are still issues with 1.9 compatibility, please create a new issue.

  • Status changed from Open to Closed

Also available in: Atom PDF