Welcome Guest | Login

Mysql Server Error

After mucho help from the great people at hostingrails, I got my typo frame up.

but when I try to update it, I get this :


Mysql::Error: Lost connection to MySQL server during query: UPDATE sessions SET `created_at` = '2006-12-29 12:59:57', `sessid` = '5cb3651ede59e73b7b2b3e12fed3b3fe', `data` = 'BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxh
c2g6OkZsYXNo\nSGFzaHsABjoKQHVzZWR7ADoJdXNlcm86CVVzZXIGOhBAYXR0cmlidXRlc3
sQ\nIhZub3RpZnlfdmlhX2phYmJlcjAiCW5hbWUiCWxhbG8iHW5vdGlmeV93YXRj\naF9teV9hcnRpY2xlc
zAiFW5vdGlmeV92aWFfZW1haWwwIgdpZCIGMSILamFi\nYmVyMCIXbm90aWZ5X29uX2NvbW1lbnRzMCINcGFzc3dvcm
QiLWFhMjM1ZTVk\nYTc5YTMyMGI1NjI4N2U2NzcxNGRiZGM1NDlhMDhiNjciCmxvZ2luIg1sYWxv\
nd3VsZiIbbm90aWZ5X29uX25ld19hcnRpY2xlczAiCmVtYWlsIh5nZXJhcmRv\nZXNjYWxlcmFAZ21haWwuY29t\n', `updated_at` = '2006-12-29 13:07:48' WHERE id = 1

is mysql bad?

2006-12-29 01:14 PM

can you restart fastcgi and give it another shot - how often does this error happen (i.e. every time you post, edit, comment, etc...?)

2006-12-29 02:03 PM

only when you try to post an Articles,

2006-12-29 04:08 PM

[~]# killall fastcgi
fastcgi: no process killed

still the same here is the full text :

Mysql::Error: Lost connection to MySQL server during query: UPDATE sessions SET `created_at` = '2006-12-29 16:03:26', `sessid` = 'b91444f5f02a64ee818455dd74a08375', `data` = 'BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsY
XNo\nSGFzaHsABjoKQHVzZWR7ADoJdXNlcm86CVVzZXIGOhBAYXR0cmlidXRlc3s
Q\nIhZub3RpZnlfdmlhX2phYmJlcjAiCW5hbWUiCWxhbG8iHW5vdGlmeV93YXRj\naF9teV9
hcnRpY2xlczAiFW5vdGlmeV92aWFfZW1haWwwIgdpZCIGMSILamFi\nYmVyMCIXbm90aWZ5X29u
X2NvbW1lbnRzMCINcGFzc3dvcmQiLWFhMjM1ZTVk\nYTc5YTMyMGI1NjI4N2U2NzcxNGRiZGM1NDlh
MDhiNjciCmxvZ2luIg1sYWxv\nd3VsZiIbbm90aWZ5X29uX25ld19hcnRpY2xlczAiCmVtYWlsIh5nZXJh
cmRv\nZXNjYWxlcmFAZ21haWwuY29t\n', `updated_at` = '2006-12-29 16:18:09' WHERE id = 2
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/
abstract_adapter.rb:120:in `log'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/
mysql_adapter.rb:184:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/
mysql_adapter.rb:199:in `update'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:1723:in `update_without_lock'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/locking.rb:33:in `update_without_callbacks'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/callbacks.rb:278:in `update_without_timestamps'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/timestamp.rb:39:
in `update'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:1718:in `create_or_update_without_callbacks'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/callbacks.rb:253:in `create_or_update'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:1392:in `save_without_validation'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/validations.rb:736:in `save_without_transactions'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/transactions.rb:126:in `save'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_
adapters/abstract/
database_statements.rb:51:in `transaction'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/transactions.rb:91:in `transaction'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/transactions.rb:118:in `transaction'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/transactions.rb:126:in `save'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session/
active_record_store.rb:307:in `update'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:794:in `silence'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session/
active_record_store.rb:307:in `update'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session/
active_record_store.rb:314:in `close'
/usr/local/lib/ruby/1.8/cgi/session.rb:324:in `close'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:1015:in `close_session'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:1057:in `process_cleanup_without_flash'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/flash.rb:147:in `process_cleanup_without_filters'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:439:in `process_cleanup_without_session_management_support'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/
session_management.rb:126:in `process_cleanup_without_components'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/components.rb:182:in `process_cleanup'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:412:in `process_without_filters'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in `process_without_session_management_support'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/
session_management.rb:117:in `process'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in `dispatch'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:150:in `process_request'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:54:in `process!'
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in `each_cgi'
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each'
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each_cgi'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:53:in `process!'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:23:in `process!'
dispatch.fcgi:24


Processing ArticlesController#index (for 76.178.121.8 at 2006-12-29 16:18:12) [GET]
 Parameters: {"action"=>"index", "controller"=>"articles"}
Filter chain halted as [#<Proc:0xb7bd3f50@/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
action_controller/filters.rb:242>] returned false
Completed in 0.00060 (1658 reqs/sec) | Rendering: 0.00004 (6%) | DB: 0.01133 (1878%) | 304 http://448csudh.augustine.hostingrails.com/]

2006-12-29 04:20 PM

(Note: Please do not post your username - I went ahead and edited it out for you)

Ok - here's the relevant part of your enviornment.rb
  # Use the database for sessions instead of the file system
 # (create the session table with 'rake create_sessions_table')
 config.action_controller.session_store = :active_record_store
Did you run a
rake create_sessions_table RAILS_ENV='production' 
?

Regardless, you should go ahead and use your rails app file system for sessions, so I went ahead and commented it out for you  
  # Use the database for sessions instead of the file system
 # (create the session table with 'rake create_sessions_table')
 # config.action_controller.session_store = :active_record_store
Thus, you shouldn't see this problem again :)  Let me know if you do. (try to restart fastcgi if so..)

~William

2006-12-29 11:54 PM

Its 1 30 am and still we got :
ActiveRecord::StatementInvalid (Mysql::Error: Lost connection to MySQL server during query:
SELECT * FROM page_caches ):
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/
abstract_adapter.rb:120:in `log'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/
mysql_adapter.rb:184:in `execute'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/
mysql_adapter.rb:336:in `select'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/
mysql_adapter.rb:175:in `select_all'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:390:in `find_by_sql'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:924:in `find_every'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:381:in `find'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:461:in `destroy_al

d'oh

2006-12-30 03:24 AM

Just a quick question - did you run rake to populate your database?   I'm assuming you did - ok - please go back into your environemnt.rb and comment out page caching or anything else that gives you a similar error until we figure out the problem.  Thank you.

~William

2006-12-30 03:33 AM

I used php myadmin actually

2006-12-30 11:01 AM

tried it same error

as the hours go by and I slam my head into this, I can see my New Years Eve tab grow....

2006-12-30 11:18 AM

Paste in the environment.rb and make sure to remove sensitive text....there may be more things we can comment out...

2006-12-30 11:38 AM

# Be sure to restart your webserver when you modify this file.

# Uncomment below to force Rails into production mode
# (Use only when you can't set environment variables through your web/app server)
ENV['RAILS_ENV'] ||= 'production'

# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')

Rails::Initializer.run do |config|
 # Skip frameworks you're not going to use
 # config.frameworks -= [ :action_web_service, :action_mailer ]

 # Add additional load paths for your own custom dirs
 # config.load_paths += %W( #{RAILS_ROOT}/app/services )
 config.load_paths += %W(
   vendor/rubypants
   vendor/akismet
   vendor/redcloth/lib
   vendor/bluecloth/lib
   vendor/flickr
   vendor/syntax/lib
   vendor/sparklines/lib
   vendor/uuidtools/lib
   vendor/jabber4r/lib
   vendor/rails/railties
   vendor/rails/railties/lib
   vendor/rails/actionpack/lib
   vendor/rails/activesupport/lib
   vendor/rails/activerecord/lib
   vendor/rails/actionmailer/lib
   vendor/rails/actionwebservice/lib
 ).map {|dir| "#{RAILS_ROOT}/#{dir}"}.select { |dir| File.directory?(dir) }

 # Force all environments to use the same logger level
 # (by default production uses :info, the others :debug)
 # config.log_level = :debug

 # Use the database for sessions instead of the file system
 # (create the session table with 'rake create_sessions_table')
# config.action_controller.session_store = :active_record_store

 # Enable page/fragment caching by setting a file-based store
 # (remember to create the caching directory and make it readable to the application)
 #config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/tmp/cache"

 # Activate observers that should always be running
 # config.active_record.observers = :cacher, :garbage_collector
config.active_record.observers = :content_observer, :email_notifier, :web_notifier

 # Make Active Record use UTC-base instead of local time
 # config.active_record.default_timezone = :utc

 # Use Active Record's schema dumper instead of SQL when creating the test database
 # (enables use of different database adapters for development and test environments)
 # config.active_record.schema_format = :ruby

 # See Rails::Configuration for more options
end

# Add new inflection rules using the following format
# (all these examples are active by default):
# Inflector.inflections do |inflect|
#   inflect.plural /^(ox)$/i, '\1en'
#   inflect.singular /^(ox)en/i, '\1'
#   inflect.irregular 'person', 'people'
#   inflect.uncountable %w( fish sheep )
# end

# Include your application configuration below

# Load included libraries.
require 'redcloth'
require 'bluecloth'
require 'rubypants'
require 'flickr'
require 'uuidtools'

require_dependency 'spam_protection'
require_dependency 'migrator'
require_dependency 'rails_patch/components'
require_dependency 'rails_patch/active_record'
require_dependency 'login_system'
require_dependency 'typo_version'
require_dependency 'metafragment'
require_dependency 'actionparamcache'
$KCODE = 'u'
require_dependency 'jcode'
require_dependency 'aggregations/audioscrobbler'
require_dependency 'aggregations/delicious'
require_dependency 'aggregations/tada'
require_dependency 'aggregations/flickr'
require_dependency 'aggregations/fortythree'
require_dependency 'aggregations/magnolia'
require_dependency 'aggregations/upcoming'
require_dependency 'xmlrpc_fix'
require_dependency 'transforms'
require_dependency 'builder'

unless Builder::XmlMarkup.methods.include? '_attr_value'
 # Builder 2.0 has many important fixes, but for now we will only backport
 # this one...
 class Builder::XmlMarkup
   # Insert the attributes (given in the hash).
   def _insert_attributes(attrs, order=[])
     return if attrs.nil?
     order.each do |k|
       v = attrs[k]
       @target << %{ #{k}="#{_attr_value(v)}"} if v # " WART
     end
     attrs.each do |k, v|
       @target << %{ #{k}="#{_attr_value(v)}"} unless order.member?(k) # " WART
     end
   end

  def _attr_value(value)
     case value
     when Symbol
       value.to_s
     else
       _escape(value.to_s).gsub(%r{"}, '"')  # " WART
     end
   end
 end
end

ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(
 :long_weekday => '%a %B %e, %Y %H:%M'
)

ActionMailer::Base.default_charset = 'utf-8'

if RAILS_ENV != 'test'
 begin
   mail_settings = YAML.load(File.read("#{RAILS_ROOT}/config/mail.yml"))

   ActionMailer::Base.delivery_method = mail_settings['method']
   ActionMailer::Base.server_settings = mail_settings['settings']
 rescue
   # Fall back to using sendmail by default
   ActionMailer::Base.delivery_method = :sendmail
 end
end

FLICKR_KEY='84f652422f05b96b29b9a960e0081c50'

2006-12-30 01:18 PM

Ok comment out this line
config.active_record.observers = :content_observer, :email_notifier, :web_notifier
Restart your dispatcher and try again...

Sorry for the continued trouble - I'll try to pop into your account later if its still not working for you...

~William

2006-12-30 01:33 PM

WEEEEEEEEEEEEE GOT IT IT WORKS IT WORKSQQQQQ

2006-12-30 01:54 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.