"Oops that last request didn't work out" (when deleting conversation messages)

308 views
Skip to first unread message

hazem...@gmail.com

unread,
May 17, 2013, 9:39:38 AM5/17/13
to canvas-l...@googlegroups.com
Has anyone encountered this error? We encountered this while trying to delete a conversation message from inbox. In the user interface the error is displayed as  "Oops that last request didn't work out". We are using the mysql2 adapter to connect to a MySQL instance setup in Ubuntu 12.04.

Thanks in advance,
Hazem

 Joins in delete not supported!
/var/www/canvas/config/initializers/active_record.rb:727:in `delete_all_with_joins' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.17/lib/active_record/named_scope.rb:186:in `block in method_missing' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.17/lib/active_record/base.rb:2186:in `with_scope' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.17/lib/active_record/named_scope.rb:118:in `with_scope' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.17/lib/active_record/named_scope.rb:179:in `method_missing' /var/www/canvas/app/models/conversation_participant.rb:197:in `block in remove_messages' /var/www/canvas/lib/stubs/shard.rb:46:in `activate' /var/www/canvas/app/models/conversation_participant.rb:191:in `remove_messages' /var/www/canvas/app/controllers/conversations_controller.rb:425:in `destroy' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/base.rb:1333:in `perform_action' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/filters.rb:617:in `call_filters' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/filters.rb:638:in `block in run_before_filters' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/filters.rb:189:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/filters.rb:189:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/filters.rb:635:in `run_before_filters' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/filters.rb:615:in `call_filters' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/filters.rb:638:in `block in run_before_filters' /var/www/canvas/app/controllers/application_controller.rb:113:in `set_locale' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activesupport-2.3.17/lib/active_support/callbacks.rb:178:in `evaluate_method' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/filters.rb:186:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/filters.rb:635:in `run_before_filters' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/filters.rb:615:in `call_filters' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/filters.rb:610:in `perform_action_with_filters' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activesupport-2.3.17/lib/active_support/core_ext/benchmark.rb:17:in `block in ms' /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activesupport-2.3.17/lib/active_support/core_ext/benchmark.rb:17:in `ms' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/flash.rb:151:in `perform_action_with_flash' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/base.rb:532:in `process' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/filters.rb:606:in `process_with_filters' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/compass-rails-1.0.2/lib/compass-rails/railties/2_3.rb:9:in `process_with_compass' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/base.rb:391:in `process' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/base.rb:386:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/routing/route_set.rb:438:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/dispatcher.rb:87:in `dispatch' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/dispatcher.rb:121:in `_call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/dispatcher.rb:130:in `block in build_middleware_stack' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.17/lib/active_record/query_cache.rb:29:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.17/lib/active_record/query_cache.rb:29:in `block in call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.17/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.17/lib/active_record/query_cache.rb:9:in `cache' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.17/lib/active_record/query_cache.rb:28:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/sass-3.2.1/lib/sass/plugin/rack.rb:54:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/string_coercion.rb:25:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/rack-1.1.3/lib/rack/head.rb:9:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/rack-1.1.3/lib/rack/methodoverride.rb:24:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/params_parser.rb:15:in `call' /var/www/canvas/vendor/plugins/respondus_soap_endpoint/lib/respondus_api_middleware.rb:60:in `call' /var/www/canvas/lib/request_context_generator.rb:34:in `call' /var/www/canvas/app/middleware/prevent_non_multipart_parse.rb:32:in `call' /var/www/canvas/app/middleware/stats_timing.rb:8:in `block in call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activesupport-2.3.17/lib/active_support/core_ext/benchmark.rb:17:in `block in ms' /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activesupport-2.3.17/lib/active_support/core_ext/benchmark.rb:17:in `ms' /var/www/canvas/app/middleware/stats_timing.rb:8:in `call' /var/www/canvas/app/middleware/load_account.rb:12:in `call' /var/www/canvas/app/middleware/sessions_timeout.rb:24:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/encrypted_cookie_store-instructure-1.0.2/lib/encrypted_cookie_store.rb:32:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/failsafe.rb:26:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/rack-1.1.3/lib/rack/lock.rb:11:in `block in call' <internal:prelude>:10:in `synchronize' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/rack-1.1.3/lib/rack/lock.rb:11:in `call' /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.17/lib/action_controller/dispatcher.rb:106:in `call' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/utils.rb:470:in `safe_fork' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:180:in `start' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:129:in `start' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize' <internal:prelude>:10:in `synchronize' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop' /var/lib/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously' /var/lib/gems/1.9.1/gems/passenger-3.0.19/helper-scripts/passenger-spawn-server:99:in `<main>'

Cody Cutrer

unread,
May 17, 2013, 11:01:00 AM5/17/13
to canvas-l...@googlegroups.com
Hazem,

Can you open script/console and tell me what the output of `User.connection.adapter_name` is? (please preserve case). It *should* be "Mysql2", but according to the error, it's not matching that exactly.

Thanks,

Cody Cutrer
Software Engineer
Instructure


--
 
---
You received this message because you are subscribed to the Google Groups "Canvas LMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to canvas-lms-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

hazem...@gmail.com

unread,
May 18, 2013, 2:40:18 AM5/18/13
to canvas-l...@googlegroups.com, hazem...@gmail.com
Cody,

      The console threw an error while I did that. Please see the shell dump below:

root@ip-<IP here>:/var/www/canvas# script/console
Loading development environment (Rails 2.3.17)
/var/lib/gems/1.9.1/gems/bundler-1.3.1/lib/bundler/runtime.rb:216: warning: Insecure world writable dir /var/www/canvas/vendor in PATH, mode 040777
/var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activesupport-2.3.17/lib/active_support/inflector.rb:3:in `<top (required)>': iconv will be deprecated in the future, use String#encode instead.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/rails-2.3.17/lib/rails/gem_dependency.rb:21.
User.connection.adapter_name
encryption key is incorrect. if you have intentionally changed it, you may want to run `rake db:reset_encryption_key_hash`

The development,test and production environment connects to the same database using the same user and adapter. Do you have a clue why the encryption key is shown as incorrect here ? It shouldn't be because the application works fine except the delete conversation error.

PS: Sorry about the delay in reply, I am located in a different part (11.2500° N, 75.7833° E) of the world and follow a different timezone.

Thanks a lot,
Hazem

hazem...@gmail.com

unread,
May 18, 2013, 3:09:30 AM5/18/13
to canvas-l...@googlegroups.com, hazem...@gmail.com
Cody,

         For some reason (let's forget that for the moment), the development, production and test environments use different encryption keys. I edited config/security.yml and copied the encryption key from Production to Development. Now the command shows 'Mysql2' as you said it should.

root@ip-<IP here>:/var/www/canvas/config# cp security.yml security.yml20130518
root@ip-<IP here>:/var/www/canvas/config# vi security.yml
root@ip-<IP here>:/var/www/canvas/config# service apache2 restart
 * Restarting web server apache2                                                 ... waiting                                                             [ OK ]
root@ip-<IP here>:/var/www/canvas/config# cd ..
root@ip-<IP here>:/var/www/canvas# script/console
Loading development environment (Rails 2.3.17)
/var/lib/gems/1.9.1/gems/bundler-1.3.1/lib/bundler/runtime.rb:216: warning: Insecure world writable dir /var/www/canvas/vendor in PATH, mode 040777
/var/www/canvas/vendor/bundle/ruby/1.9.1/gems/activesupport-2.3.17/lib/active_support/inflector.rb:3:in `<top (required)>': iconv will be deprecated in the future, use String#encode instead.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /var/www/canvas/vendor/bundle/ruby/1.9.1/gems/rails-2.3.17/lib/rails/gem_dependency.rb:21.
User.connection.adapter_name
>> User.connection.adapter_name
=> "Mysql2"
>>

Please let me know if there is anything else you would like me to check. I will look for hints, meanwhile.

Thanks,
Hazem

On Friday, 17 May 2013 19:09:38 UTC+5:30, hazem...@gmail.com wrote:

hazem...@gmail.com

unread,
May 21, 2013, 6:24:44 AM5/21/13
to canvas-l...@googlegroups.com, hazem...@gmail.com
Cody,

           Just figured out what went wrong. Support for the MySQL2 gem was added on Feb 27, 2013. We cloned the repository a few days before this commit (https://github.com/instructure/canvas-lms/commit/56e317e4abdc7bf013cb2d86e3cfe9354b35453c#config/initializers/active_record.rb) and hence the error.

           It appears that we have a lot to fetch & merge :) Thanks for your time, it would have been harder to figure this out without your questions.

-Hazem


On Friday, 17 May 2013 19:09:38 UTC+5:30, hazem...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages