thomasklein / redmine2mite

Redmine2mite connects your Redmine account with your mite.account. Track your time easily on issues within Redmine and get them automatically send to mite.
http://mite.yo.lk/
MIT License
13 stars 6 forks source link

undefined method 'connect_to_mite' #25

Closed sunlime closed 12 years ago

sunlime commented 12 years ago

Hi,

I hope anyone can help me. I have set up the wonderful plugin but when I try to synchronize between Redmine and Mite I get the following exception (output from apache log): "EXCEPTION in MiteController#save_preferences: undefined method `connected_to_mite' for #Class:0x7f9cc152b1f0" "Deine Daten konnten nicht aktualisiert werden."

Could anyone please give me some advice?

Thanks, Dominik

sunlime commented 12 years ago

The following line generates the error (in mite_sychronizers/time_entries.rb): @local_records ||= TimeEntry.connected_to_mite.find(:all, :conditions => {:user_id => User.current.id}) (line 48)

thomasklein commented 12 years ago

Hey Dominik! Could you please tell me which version of Redmine your are using? Cheers, Thomas

sunlime commented 12 years ago

1.3.3, it is the last stable version in the repositories of Ubuntu.

thomasklein commented 12 years ago

On first glance, it seems to be a DB problem. Did you already run rake db:migrate_plugins?

sunlime commented 12 years ago

Oh yes, i did rake db:migrate_plugins RAILS_ENV=production because rake db:migrate_plugins threw an error.

thomasklein commented 12 years ago

Ok, I'm going to test it with this precondition this WE.

sunlime commented 12 years ago

Did you find anything?

thomasklein commented 12 years ago

I sunlime! I'm very sorry, but I didn't find the time to try it yet. Could you please try to get the plugin in the development enivironment? If that has no effect: Do you have the change to install Redmine and the plugin on another OS?

sunlime commented 12 years ago

I will try it with another OS. No luck with the development environment. Here is the backtrace, just for information: EXCEPTION in MiteController#save_preferences: undefined methodconnected_to_mite' for #" "Deine Daten konnten nicht aktualisiert werden." "Backtrace: /usr/lib/ruby/vendor_ruby/active_record/base.rb:1998:in method_missing'/usr/share/redmine/vendor/plugins/redmine2mite/lib/mite_synchronizers/time_entries.rb:48:inlocal_records'/usr/share/redmine/vendor/plugins/redmine2mite/lib/mite_synchronizers/time_entries.rb:36:in local_record_ids_to_destroy'/usr/share/redmine/vendor/plugins/redmine2mite/lib/mite_synchronizers/time_entries.rb:5:insynchronize'/usr/share/redmine/vendor/plugins/redmine2mite/app/helpers/mite_controller_helper.rb:24:in synchronize_mite_and_redmine_account_data'/usr/share/redmine/vendor/plugins/redmine2mite/app/controllers/mite_controller.rb:30:insave_account_data'/usr/share/redmine/vendor/plugins/redmine2mite/app/controllers/mite_controller.rb:21:in process_account_form'/usr/lib/ruby/vendor_ruby/action_controller/base.rb:1333:insend'/usr/lib/ruby/vendor_ruby/action_controller/base.rb:1333:in perform_action_without_filters'/usr/lib/ruby/vendor_ruby/action_controller/filters.rb:617:incall_filters'/usr/lib/ruby/vendor_ruby/action_controller/filters.rb:610:in perform_action_without_benchmark'/usr/lib/ruby/vendor_ruby/action_controller/benchmarking.rb:68:inperform_action_without_rescue'/usr/lib/ruby/vendor_ruby/active_support/core_ext/benchmark.rb:17:in ms'/usr/lib/ruby/1.8/benchmark.rb:308:inrealtime'/usr/lib/ruby/vendor_ruby/active_support/core_ext/benchmark.rb:17:in ms'/usr/lib/ruby/vendor_ruby/action_controller/benchmarking.rb:68:inperform_action_without_rescue'/usr/lib/ruby/vendor_ruby/action_controller/rescue.rb:160:in perform_action_without_flash'/usr/lib/ruby/vendor_ruby/action_controller/flash.rb:151:inperform_action'/usr/lib/ruby/vendor_ruby/action_controller/base.rb:532:in send'/usr/lib/ruby/vendor_ruby/action_controller/base.rb:532:inprocess_without_filters'/usr/lib/ruby/vendor_ruby/action_controller/filters.rb:606:in process'/usr/lib/ruby/vendor_ruby/action_controller/base.rb:391:inprocess'/usr/lib/ruby/vendor_ruby/action_controller/base.rb:386:in call'/usr/lib/ruby/vendor_ruby/action_controller/routing/route_set.rb:438:incall'/usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:87:in dispatch'/usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:121:in_call'/usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:130:in build_middleware_stack'/usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:29:incall'/usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:29:in call'/usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/query_cache.rb:34:incache'/usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:9:in cache'/usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:28:incall'/usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:361:in call'/usr/lib/ruby/vendor_ruby/action_controller/string_coercion.rb:25:incall'/usr/lib/ruby/vendor_ruby/rack/head.rb:9:in call'/usr/lib/ruby/vendor_ruby/rack/methodoverride.rb:21:incall'/usr/lib/ruby/vendor_ruby/action_controller/params_parser.rb:15:in call'/usr/lib/ruby/vendor_ruby/action_controller/session/cookie_store.rb:99:incall'/usr/lib/ruby/vendor_ruby/action_controller/failsafe.rb:26:in call'/usr/lib/ruby/vendor_ruby/rack/lock.rb:15:incall'/usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:106:in call'/usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:92:inprocess_request'/usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in main_loop'/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:418:instart_request_handler'/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:358:in handle_spawn_application'/usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:insafe_fork'/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:354:in handle_spawn_application'/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:insend'/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in main_loop'/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:instart_synchronously'/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in start'/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:213:instart'/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in spawn_rails_application'/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:inlookup_or_add'/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in spawn_rails_application'/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:insynchronize'/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in synchronize'/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:inspawn_rails_application'/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in spawn_application'/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:inhandle_spawn_application'/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in __send__'/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:inmain_loop'/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in start_synchronously'/usr/lib/phusion_passenger/passenger-spawn-server:61

sunlime commented 12 years ago

It works with a brand new ubuntu installation and Redmine 1.3.3. There is obviously a problem with my configuration and/or add-ons. How can I uninstall some add-ons?

thomasklein commented 12 years ago

Hi Dominik! Glad it turned out to be working! Regarding your question: At the moment there's no automatic way to uninstall (any) plugins. You have to do it manually: https://github.com/thomasklein/redmine2mite#known-issues

Cheers, Thomas

sunlime commented 12 years ago

I will try to check both databases to see what is going wrong with the production site. There are two plugins activated which could cause problems:

Let's see :) Thank you for your help, Thomas.

thomasklein commented 12 years ago

Welcome you are!

thomasklein commented 12 years ago

Btw - I would be really interested in the cause of your problem. So if it is one of the two plugins you mentioned, please let me know!

sunlime commented 12 years ago

AND FINALLY!!! It works with my production site! The Timesheet Extensions Plugin is incompatible! I deactivated that one and re-installed Redmine2Mite. This caused some problems (not all tables and attributes were re-installed). I installed it manually from a database backup and now the entries are syncing. HURRAAAAAYYY!

thomasklein commented 12 years ago

Hehe, hurraayy!