Project

General

Profile

LDAP /auth_sources/new page appears 404 error

Added by Михаил Полковников over 2 years ago

Hello. Redmine was installed a long time ago. Now there is a need to add authentication via LDAP. But when you click on the "New authentication mode" button and go to the page /auth_sources/new, an error appears 404 "The page you are trying to access does not exist or has been deleted."

Where can I find this page and how can I add it?

/admin/info

Environment:
  Redmine version                4.2.3.stable
  Ruby version                   2.6.8-p205 (2021-07-07) [x86_64-linux]
  Rails version                  5.2.6
  Environment                    production
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
SCM:
  Subversion                     1.14.1
  Git                            2.33.1
  Filesystem                     
Redmine plugins:
  redmine_code_review            1.0.0


Replies (3)

RE: LDAP /auth_sources/new page appears 404 error - Added by Go MAEDA over 2 years ago

Probably some errors were logged in the log file log/production.log. Could you paste the errors here?

RE: LDAP /auth_sources/new page appears 404 error - Added by Михаил Полковников over 2 years ago

I, [2021-12-20T12:27:43.990906 #31009]  INFO -- : Started GET "/auth_sources/new" for 192.168.2.145 at 2021-12-20 12:27:43 +0300
I, [2021-12-20T12:27:43.991557 #31009]  INFO -- : Processing by AuthSourcesController#new as HTML
I, [2021-12-20T12:27:44.006118 #31009]  INFO -- :   Current user: polkovnikov (id=59)
I, [2021-12-20T12:27:44.006757 #31009]  INFO -- :   Rendering common/error.html.erb within layouts/base
I, [2021-12-20T12:27:44.006900 #31009]  INFO -- :   Rendered common/error.html.erb within layouts/base (0.1ms)
I, [2021-12-20T12:27:44.009057 #31009]  INFO -- :   Rendered plugins/redmine_code_review/app/views/code_review/_html_header.html.erb (0.0ms)
I, [2021-12-20T12:27:44.013847 #31009]  INFO -- :   Rendered plugins/redmine_code_review/app/views/code_review/_body_bottom.html.erb (0.0ms)
I, [2021-12-20T12:27:44.013947 #31009]  INFO -- : Filter chain halted as :build_new_auth_source rendered or redirected
I, [2021-12-20T12:27:44.014028 #31009]  INFO -- : Completed 404 Not Found in 22ms (Views: 6.4ms | ActiveRecord: 13.0ms)

RE: LDAP /auth_sources/new page appears 404 error - Added by Go MAEDA over 2 years ago

I cannot figure out the cause for now.

The log implies that some problem was occurred in build_new_auth_source method in app/controllers/auth_sources_controller.rb. It never renders 404 error unless an invalid type parameter is given.

  def build_new_auth_source
    @auth_source = AuthSource.new_subclass_instance(params[:type] || 'AuthSourceLdap')
    if @auth_source
      @auth_source.safe_attributes = params[:auth_source]
    else
      render_404
    end
  end
    (1-3/3)