martin-denizet / redmine_login_audit

Redmine plugin to log successful login attempts in Redmine
44 stars 30 forks source link

ADMINISTRATION - login_audit page (error 500) #19

Closed Catlon closed 8 years ago

Catlon commented 8 years ago

Hello,

I'm using Redmine V3.1.1 the login_audit page in administration section renders a 500 error.

Here is the log info I am getting:

Started GET "/login_audit" for XXX.XXX.XX.XX at 2015-12-01 09:49:35 +0000
Processing by LoginAuditController#index as HTML
  Current user: John (id=1)
Mysql2::Error: Table 'redmine.login_audits' doesn't exist: SHOW FULL FIELDS FROM `login_audits`
Completed 500 Internal Server Error in 3ms (ActiveRecord: 0.6ms)

ActiveRecord::StatementInvalid (Mysql2::Error: Table 'redmine.login_audits' doesn't exist: SHOW FULL FIELDS FROM `login_audits`):
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Can you help me out?

Thanks,

C.

martin-denizet commented 8 years ago

Seems you didn't run the migration. From the README: RAILS_ENV=production bundle exec rake redmine:plugins:migrate To run in your installation path. Cheers,

Catlon commented 8 years ago

Yes I had in fact already done that. But just in case, I ran it again and rebooted the app.

Here is what I got in the shell when I ran the command:

Migrating redmine_login_audit (Redmine Login Audit plugin)...
== 1 CreateLoginAudits: migrating =============================================
-- create_table(:login_audits)
   -> 0.0542s
-- add_index(:login_audits, :user_id)
   -> 0.0233s
-- add_index(:login_audits, :created_on)
   -> 0.0132s
== 1 CreateLoginAudits: migrated (0.0910s) ====================================

== 2 AddIpAddressLimit: migrating =============================================
-- change_column(:login_audits, :ip_address, :string, {:limit=>39})
   -> 0.0132s
== 2 AddIpAddressLimit: migrated (0.0133s) ====================================

== 3 AddLoginToLoginAudit: migrating ==========================================
-- add_column(:login_audits, :login, :string)
   -> 0.0057s
-- add_column(:login_audits, :api, :boolean, {:default=>false})
   -> 0.0161s
-- add_column(:login_audits, :url, :string, {:limit=>155})
   -> 0.0083s
-- add_column(:login_audits, :method, :string, {:limit=>6})
   -> 0.0115s
-- remove_column(:login_audits, :client)
   -> 0.0054s
== 3 AddLoginToLoginAudit: migrated (0.0474s) =================================

Log file

Started GET "/login_audit" for 173.245.49.83 at 2015-12-01 10:23:50 +0000
Processing by LoginAuditController#index as HTML
  Current user: John (id=1)
  Rendered plugins/redmine_login_audit/app/views/login_audit/index.html.erb within layouts/admin (22.9ms)
Completed 500 Internal Server Error in 35ms (ActiveRecord: 1.4ms)

ActionView::Template::Error (Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.):
    1: <% content_for :header_tags do %>
    2:     <%= stylesheet_link_tag 'login_audit', :plugin => 'redmine_login_audit' %>
    3:     <%= stylesheet_link_tag 'wice_grid', :plugin => 'redmine_login_audit' %>
    4:     <%= javascript_include_tag 'wice_grid' %>
    5:     <script type="text/javascript">
    6:         function filterByDate(value) {
    7:             $('#grid_f_date option[value=' + value + ']').prop('selected', true);
  app/helpers/application_helper.rb:1222:in `javascript_include_tag'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'
martin-denizet commented 8 years ago

Please update to version 0.2.2, that should do it. Note that you will need to run the bundle install again.