Mysql::Error: Lock wait timeout exceeded

Added by Lars O. Overskeid over 10 years ago

Hi,

When doing an update on my workflow (see request below), Redmine hangs for a minute or so before crashing (paste from production.log below). I've tried restarting the application server, and database server, but the same thing happens everytime I try this action. The other functions in the system works normally. Should this be reported as a bug, or are there any known fixes for this?

Request:

 Processing RolesController#workflow (for x.x.x.x at 2008-11-20 13:54:14) [POST]
  Session ID: 8b75aa8f73fac8b5f4a9fede5f473dfa
  Parameters: {"commit"=>"Save", "issue_status"=>{"6"=>["1", "2", "3", "4", "5", "8"], "8"=>["1", "2", "3", "4", "5", "6"], "1"=>["2", "3", "4", "5", "6", "8"], "2"=>["1", "3", "4", "5", "6", "8"], "3"=>["1", "2", "4", "5", "6", "8"], "4"=>["1", "2", "3", "5", "6", "8"], "5"=>["1", "2", "3", "4", "6", "8"]}, "action"=>"workflow", "role_id"=>"3", "controller"=>"roles", "tracker_id"=>"1"}

Error from production.log:

ActiveRecord::StatementInvalid (Mysql::Error: Lock wait timeout exceeded; try restarting transaction: UPDATE `roles` SET `builtin` = 0, `position` = 3, `assignable` = 1, `permissions` = '--- \n- :edit_project\n- :select_project_modules\n- :manage_members\n- :manage_versions\n- :manage_categories\n- :add_issues\n- :edit_issues\n- :manage_issue_relations\n- :add_issue_notes\n- :edit_issue_notes\n- :edit_own_issue_notes\n- :move_issues\n- :delete_issues\n- :manage_public_queries\n- :save_queries\n- :view_gantt\n- :view_calendar\n- :log_time\n- :view_time_entries\n- :edit_time_entries\n- :edit_own_time_entries\n- :manage_news\n- :comment_news\n- :manage_documents\n- :view_documents\n- :manage_files\n- :view_files\n- :manage_wiki\n- :rename_wiki_pages\n- :delete_wiki_pages\n- :view_wiki_pages\n- :edit_wiki_pages\n- :manage_repository\n- :browse_repository\n- :view_changesets\n- :manage_boards\n- :add_messages\n- :edit_messages\n- :delete_messages\n', `name` = 'Manager' WHERE `id` = 3):
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:150:in `log'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:281:in `execute'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:162:in `update_sql'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:296:in `update_sql'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:49:in `update_without_query_dirty'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:19:in `update'
    /vendor/rails/activerecord/lib/active_record/base.rb:2247:in `update_without_lock'
    /vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:70:in `update_without_callbacks'
    /vendor/rails/activerecord/lib/active_record/callbacks.rb:240:in `update_without_timestamps'
    /vendor/rails/activerecord/lib/active_record/timestamp.rb:38:in `update'
    /vendor/rails/activerecord/lib/active_record/base.rb:2238:in `create_or_update_without_callbacks'
    /vendor/rails/activerecord/lib/active_record/callbacks.rb:213:in `create_or_update'
    /vendor/rails/activerecord/lib/active_record/base.rb:1972:in `save_without_validation'
    /vendor/rails/activerecord/lib/active_record/validations.rb:934:in `save_without_transactions'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:108:in `save'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:80:in `transaction'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:100:in `transaction'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:108:in `save'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:120:in `rollback_active_record_state!'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:108:in `save'
    /app/controllers/roles_controller.rb:94:in `workflow'
    /vendor/rails/actionpack/lib/action_controller/base.rb:1158:in `send'
    /vendor/rails/actionpack/lib/action_controller/base.rb:1158:in `perform_action_without_filters'
    /vendor/rails/actionpack/lib/action_controller/filters.rb:697:in `call_filters'
    /vendor/rails/actionpack/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark'
    /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
    /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    /vendor/rails/actionpack/lib/action_controller/rescue.rb:199:in `perform_action_without_caching'
    /vendor/rails/actionpack/lib/action_controller/caching.rb:678:in `passenger_orig_perform_action'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
    /vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in `cache'
    /vendor/rails/actionpack/lib/action_controller/caching.rb:677:in `passenger_orig_perform_action'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/request_handler.rb:140:in `perform_action'
    /vendor/rails/actionpack/lib/action_controller/base.rb:524:in `send'
    /vendor/rails/actionpack/lib/action_controller/base.rb:524:in `process_without_filters'
    /vendor/rails/actionpack/lib/action_controller/filters.rb:685:in `process_without_session_management_support'
    /vendor/rails/actionpack/lib/action_controller/session_management.rb:123:in `process'
    /vendor/rails/actionpack/lib/action_controller/base.rb:388:in `process'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:171:in `handle_request'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:in `dispatch'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:in `dispatch'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/request_handler.rb:295:in `process_request'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/request_handler.rb:175:in `main_loop'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/application_spawner.rb:286:in `start_request_handler'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/application_spawner.rb:255:in `handle_spawn_application'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/application_spawner.rb:253:in `fork'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/application_spawner.rb:253:in `handle_spawn_application'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/application_spawner.rb:251:in `fork'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/application_spawner.rb:251:in `handle_spawn_application'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/abstract_server.rb:291:in `__send__'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/abstract_server.rb:291:in `main_loop'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/abstract_server.rb:147:in `start_synchronously'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/abstract_server.rb:114:in `start'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/abstract_server.rb:108:in `fork'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/abstract_server.rb:108:in `start'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/application_spawner.rb:147:in `start'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/framework_spawner.rb:278:in `handle_spawn_application'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/framework_spawner.rb:273:in `synchronize'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/framework_spawner.rb:273:in `handle_spawn_application'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/abstract_server.rb:291:in `__send__'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/abstract_server.rb:291:in `main_loop'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/abstract_server.rb:147:in `start_synchronously'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/abstract_server.rb:114:in `start'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/abstract_server.rb:108:in `fork'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/abstract_server.rb:108:in `start'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/framework_spawner.rb:104:in `start'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/spawn_manager.rb:106:in `spawn_application'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/spawn_manager.rb:102:in `synchronize'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/spawn_manager.rb:102:in `spawn_application'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/spawn_manager.rb:178:in `handle_spawn_application'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/abstract_server.rb:291:in `__send__'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/abstract_server.rb:291:in `main_loop'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/lib/passenger/abstract_server.rb:147:in `start_synchronously'
    /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/bin/passenger-spawn-server:32