Project

General

Profile

Actions

Defect #44526

closed

500 error when the LDAP server is unreachable on macOS 26.7

Added by Go MAEDA about 5 hours ago. Updated about 5 hours ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
LDAP
Target version:
Resolution:
Fixed
Affected version:

Description

On macOS 26.7, if the LDAP server is unreachable, logging in as an LDAP user or authenticating to the REST API with HTTP Basic authentication results in a 500 error instead of an authentication error.

This is because Socket.tcp with connect_timeout, which net-ldap uses, returns a socket even when the connection is refused, and the subsequent write raises Errno::EPIPE. Since Errno::EPIPE is not included in AuthSourceLdap::NETWORK_EXCEPTIONS, it is not converted to AuthSourceException.

As a result, the following tests also fail on macOS 26.7:

  • test/unit/user_test.rb
    • test_#try_to_login!_using_LDAP_with_existing_user_and_failed_connection_to_the_LDAP_server
    • test_#try_to_login_using_LDAP_with_existing_user_and_failed_connection_to_the_LDAP_server
  • test/integration/api_test/users_test.rb
    • test_GET_/users/:id.json_should_not_include_auth_source_for_standard_user

The attached patch adds Errno::EPIPE to NETWORK_EXCEPTIONS. This exception can also occur on other platforms when the peer closes the connection, so I think it should be handled in the same way as Errno::ECONNRESET.


Files


Related issues

Related to Redmine - Patch #21137: Rescue network level errors with LDAP authClosedJean-Philippe LangActions
Actions #1

Updated by Go MAEDA about 5 hours ago

  • Related to Patch #21137: Rescue network level errors with LDAP auth added
Actions #2

Updated by Go MAEDA about 5 hours ago

  • Status changed from New to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch in r25142.

Actions #3

Updated by Go MAEDA about 5 hours ago

  • Status changed from Resolved to Closed

Merged the fix into the stable branches in r25143 and r25144.

Actions

Also available in: Atom PDF