upgradeya / redmine-contracts-with-time-tracking-plugin

A Redmine plugin that allows you to manage contracts and associate time-entries with those contracts.
35 stars 22 forks source link

installed the plugin but can not login into redmine #57

Closed archonwang closed 7 years ago

archonwang commented 7 years ago

Hi, @upgradeya , @FireMartZ , I have installed the plugin new version, and found it could not log into redmine. any ideas?

I got the error log as follows

Started POST "/login" for 192.168.60.238 at 2017-03-20 10:06:31 +0800
Processing by AccountController#login as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"AdFZJ+wlje/3hFrh9/umZtRTwtVnaLl5w6e5V1ZEBjOfDrGsDVa5ZV7fROupDHdSwR8YYCOqnlnyKrDtcMWqAA==", "back_url"=>"http://192.168.1.41/", "username"=>"admin", "password"=>"[FILTERED]", "login"=>"login»"}
  Current user: anonymous
Successful authentication for 'admin' from 192.168.60.238 at 2017-03-20 02:06:31 UTC
Completed 500 Internal Server Error in 39ms (ActiveRecord: 7.5ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_request.text.erb (1.4ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_title.text.erb (0.7ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_session.text.erb (1.2ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_title.text.erb (0.2ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_environment.text.erb (5.4ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_title.text.erb (0.6ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_backtrace.text.erb (0.6ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_title.text.erb (0.2ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/exception_notification.text.erb (174.0ms)

TypeError (no implicit conversion of Symbol into Integer):
  plugins/contracts/lib/contracts/hooks/hooks.rb:54:in `[]'
  plugins/contracts/lib/contracts/hooks/hooks.rb:54:in `controller_account_success_authentication_after'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:91:in `call_hook'
  app/controllers/account_controller.rb:272:in `successful_authentication'
  app/controllers/account_controller.rb:213:in `password_authentication'
  app/controllers/account_controller.rb:199:in `authenticate_user'
  app/controllers/account_controller.rb:40:in `login'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'
wesley-jones commented 7 years ago

Hey Steven, did you run the database update command?

bundle exec rake redmine:plugins:migrate RAILS_ENV=production

archonwang commented 7 years ago

@wesoccer2003 , yes, I do the migrate before I tried the plugin. I installed it within my old data. or should I update these data?

wesley-jones commented 7 years ago

I can look at it more later, but for now, if you change line 54 in the file (contracts/lib/contracts/hooks/hooks.rb) to:

last_run = nil

And then try to login, it should work. And then once you login, you can change that line of code back to its original.

Try that and let me know how that works.

archonwang commented 7 years ago

@wesoccer2003 Unfortunately, it seems still not OK

error log when I log into redmine

Successful authentication for 'hui.wang' from 192.168.60.238 at 2017-03-20 06:57:04 UTC
Completed 500 Internal Server Error in 58ms (ActiveRecord: 8.4ms)
NoMethodError (undefined method `update' for "":String):
  plugins/contracts/lib/contracts/hooks/hooks.rb:84:in `controller_account_success_authentication_after'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:91:in `call_hook'
  app/controllers/account_controller.rb:272:in `successful_authentication'
  app/controllers/account_controller.rb:213:in `password_authentication'
  app/controllers/account_controller.rb:199:in `authenticate_user'
  app/controllers/account_controller.rb:40:in `login'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'
wesley-jones commented 7 years ago

Try commenting out line 84 as well.

On Mar 20, 2017, at 2:59 AM, Steven.W notifications@github.com wrote:

@wesoccer2003 Unfortunately, it seems still not OK

error log when I log into redmine

Successful authentication for 'hui.wang' from 192.168.60.238 at 2017-03-20 06:57:04 UTC Completed 500 Internal Server Error in 58ms (ActiveRecord: 8.4ms) NoMethodError (undefined method update' for "":String): plugins/contracts/lib/contracts/hooks/hooks.rb:84:incontroller_account_success_authentication_after' lib/redmine/hook.rb:61:in block (2 levels) in call_hook' lib/redmine/hook.rb:61:ineach' lib/redmine/hook.rb:61:in block in call_hook' lib/redmine/hook.rb:58:intap' lib/redmine/hook.rb:58:in call_hook' lib/redmine/hook.rb:91:incall_hook' app/controllers/account_controller.rb:272:in successful_authentication' app/controllers/account_controller.rb:213:inpassword_authentication' app/controllers/account_controller.rb:199:in authenticate_user' app/controllers/account_controller.rb:40:inlogin' lib/redmine/sudo_mode.rb:63:in `sudo_mode' — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

archonwang commented 7 years ago

@wesoccer2003 Thanks. I tested it and it passed with the workaround.

by the way, there's still some question that I have something confused.