Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #491 (closed defect: worksforme)

Opened 4 years ago

Last modified 4 years ago

Packets out of order (0.9.4)

Reported by: __Maad__ Assigned to: David
Priority: normal Milestone: 1.1
Component: ActiveRecord Version: 0.9.4
Severity: major Keywords:
Cc:

Description

There is no select box for 0.9.4 yet, to be clear, this is for 0.9.4:

Getting errors like this on actions like category/list and others too. Using: MySQL 4.1.8, Rails 0.9.4, OS X

ActiveRecord::StatementInvalid in Category#list Packets out of order: 1<>3: SELECT * FROM categories

stack trace:

/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.5.0/lib/active_record/connection_adapters/abstract_adapter.rb:384:in `log' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.5.0/lib/active_record/connection_adapters/mysql_adapter.rb:132:in `select' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.5.0/lib/active_record/connection_adapters/mysql_adapter.rb:44:in `select_all' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.5.0/lib/active_record/base.rb:328:in `find_by_sql' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.5.0/lib/active_record/base.rb:321:in `find_all' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.3.0/lib/action_controller/scaffolding.rb:103:in `list' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.3.0/lib/action_controller/base.rb:596:in `send' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.3.0/lib/action_controller/base.rb:596:in `perform_action_without_filters' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.3.0/lib/action_controller/filters.rb:294:in `perform_action_without_benchmark' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.3.0/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.3.0/lib/action_controller/benchmarking.rb:30:in `measure' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.3.0/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.3.0/lib/action_controller/rescue.rb:75:in `perform_action' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.3.0/lib/action_controller/base.rb:263:in `send' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.3.0/lib/action_controller/base.rb:263:in `process' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.3.0/lib/action_controller/base.rb:241:in `process' /usr/local/lib/ruby/gems/1.8/gems/rails-0.9.4/lib/dispatcher.rb:40:in `dispatch' /Users/maciek/Hardcover/public/dispatch.rb:10 /usr/local/lib/ruby/gems/1.8/gems/rails-0.9.4/lib/webrick_server.rb:101:in `load' /usr/local/lib/ruby/gems/1.8/gems/rails-0.9.4/lib/webrick_server.rb:101:in `handle_dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-0.9.4/lib/webrick_server.rb:80:in `handle_mapped' /usr/local/lib/ruby/gems/1.8/gems/rails-0.9.4/lib/webrick_server.rb:34:in `do_GET' /usr/local/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `send' /usr/local/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:92:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:54:in `run' /usr/local/lib/ruby/1.8/webrick/server.rb:150:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:144:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:144:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:94:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:89:in `each' /usr/local/lib/ruby/1.8/webrick/server.rb:89:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start' /usr/local/lib/ruby/gems/1.8/gems/rails-0.9.4/lib/webrick_server.rb:19:in `dispatch'

Change History

01/17/05 05:05:59 changed by __Maad__

The solution to this problem that I found was to change the password hashing back to mysql's new-style password hashing (something that had to be changed to the old style for previous versions of rails to work)

01/18/05 17:56:37 changed by Mars

Thank you for the lead on this error, Maad.

I already have MySQL 4.1.7 set-up with support for the new strong password hashes, but the issue still suddenly appeared with Rails 0.9.4(.1).

I found that I had to log into the mysql shell and then reset the password that Rails is configured to use by way of the SET PASSWORD command.

01/21/05 20:25:48 changed by daniel@braino.org

Xal pointed me to a workaround - using the native mysql drivers.

03/03/05 18:27:13 changed by nzkoz

  • version changed from 0.9.3 to 0.9.4.
  • milestone set to 1.x.

I'm setting the milestone for this ticket to 1.x, this means that the earliest it will be fixed is after rails 1.0. If you feel this should be fixed before the 1.0 release please email the developers list to discuss it.

06/13/05 23:41:21 changed by minam

So, I'm confused. Is this a problem with Rails, or with MySQL? I get the impression that there isn't much Rails could do about this situation. I recommend we close this ticket and just post some information about it on the wiki to help out people who encounter this in the future.

07/05/05 19:33:24 changed by gjlloyd@yahoo.com

is there a resolutino to the problem? i tried the SET PASSWORD fix, but it did not work. please advise.

g

07/05/05 20:13:59 changed by nzkoz

  • status changed from new to closed.
  • resolution set to invalid.

Jamis is right, this is a mysql connector problem and as such isn't something that we can fix.

There are two things which fix it:

gem install mysql

And the SET PASSWORD thing. If neither of these fix it in your case, email the rails list for assistance.

07/06/05 05:22:18 changed by david

  • status changed from closed to reopened.
  • resolution deleted.

Actually, since we ship that MySQL connector in Rails I think we do have an obligation to making it work.

07/08/05 07:35:44 changed by dan.dickey@savvis.net

I'm seeing this problem here as well, rails 0.13.0, activerecord 1.11.0, actionpack 1.9.0, and mysql 2.6. I tried the SET PASSWORD command, which worked ok. However - I'm still getting Packets out of order.

07/08/05 08:02:34 changed by dan.dickey@savvis.net

Ok, I'm going again. I noticed that in my FC4 install mysql is setup with an old_passwords=1 setting in /etc/my.cnf. I commented this out, and pretty carefully did the SET PASSWORD mysql command for all the users in my user table. I think that all of my mysql clients are happy, and rails is happy too.

09/28/05 19:58:02 changed by bitsweat

  • status changed from reopened to closed.
  • resolution set to worksforme.

The pure-Ruby MySQL driver included with Rails requires new-style password hashing when running MySQL 4.1.