Repository: irods/irods
Pull request #8532: [#8529] Return SYS_EXCEED_CONNECT_CNT on infinite server redirect loop (main)
Author: login: korydraughn
Created: 2025-05-22T19:13:49Z | Merged: 2025-05-23T21:11:45Z

Companion PR: https://github.com/irods/irods_client_icommands/pull/576


Diff:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 53d5789076..77e2632b53 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,7 +121,7 @@ include(IrodsRunpathDefaults)
 
 set(IRODS_VERSION_MAJOR "5")
 set(IRODS_VERSION_MINOR "0")
-set(IRODS_VERSION_PATCH "0")
+set(IRODS_VERSION_PATCH "1")
 set(IRODS_VERSION "${IRODS_VERSION_MAJOR}.${IRODS_VERSION_MINOR}.${IRODS_VERSION_PATCH}")
 set(IRODS_PACKAGE_REVISION "0")
 
diff --git a/packaging/server_upgrade_instructions.txt b/packaging/server_upgrade_instructions.txt
index a6c1af8d6b..fc9d01c6cd 100644
--- a/packaging/server_upgrade_instructions.txt
+++ b/packaging/server_upgrade_instructions.txt
@@ -18,5 +18,9 @@ following command using the service account.
 For additional information, see the help text (irodsServer -h) or
 documentation at https://docs.irods.org.
 
+If using rsyslog, please add irodsAgent to your rsyslog configuration
+to avoid missing important log messages. For detailed instructions, See
+https://docs.irods.org/5.0.1/system_overview/server_log/#rsyslog-configuration.
+
 =======================================================================
 
diff --git a/scripts/irods/test/session.py b/scripts/irods/test/session.py
index 738bdfe87b..13765ad423 100644
--- a/scripts/irods/test/session.py
+++ b/scripts/irods/test/session.py
@@ -22,7 +22,7 @@ def make_session_for_existing_user(username, password, hostname, zone):
     env_dict = lib.make_environment_dict(username, hostname, zone, use_ssl=test.settings.USE_SSL)
     return IrodsSession(env_dict, password, False)
 
-def make_session_for_existing_admin():
+def make_session_for_existing_admin(hostname=None):
     irods_config = IrodsConfig()
     if irods_config.version_tuple < (4, 1, 0):
         client_environment = open_and_load_pre410_env_file(os.path.join(irods_config.home_directory, '.irods', '.irodsEnv'))
@@ -31,7 +31,7 @@ def make_session_for_existing_admin():
     username = client_environment['irods_user_name']
     zone_name = client_environment['irods_zone_name']
     env_dict = lib.make_environment_dict(
-        username, test.settings.ICAT_HOSTNAME, zone_name, use_ssl=test.settings.USE_SSL)
+        username, test.settings.ICAT_HOSTNAME if hostname is None else hostname, zone_name, use_ssl=test.settings.USE_SSL)
     return IrodsSession(env_dict, test.settings.PREEXISTING_ADMIN_PASSWORD, False)
 
 def mkuser_and_return_session(user_type, username, password, hostname):
diff --git a/scripts/irods/test/test_misc.py b/scripts/irods/test/test_misc.py
index 59ccfc556e..9de139d4b5 100644
--- a/scripts/irods/test/test_misc.py
+++ b/scripts/irods/test/test_misc.py
@@ -2,14 +2,10 @@
 import subprocess
 import sys
 import tempfile
+import unittest
 
 from datetime import datetime, timedelta
 
-if sys.version_info < (2, 7):
-    import unittest2 as unittest
-else:
-    import unittest
-
 from . import session
 from .. import test
 from .. import lib
@@ -512,3 +508,35 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_when_redirect_loop_to_self_is_detected__issue_8529(self):
+        # This test requires that the Catalog Service Provider be identifiable by two names. This
+        # requirement is satisfied by the iRODS Testing Environment because setup_irods.py produces a
+        # server_config.json which initializes the "host" property to the container id while also allowing
+        # the same container to be identified (internally) as "irods-catalog-provider".
+
+        # Force the test to fail if the provider cannot be reached by its alternative name. This test is
+        # designed to align with the environment seen in the iRODS Testing Environment.
+        hostname_alias = 'irods-catalog-provider'
+        try:
+            admin = session.make_session_for_existing_admin(hostname_alias)
+            admin.__exit__()
+        except AssertionError:
+            raise EnvironmentError('Catalog Service Provider must be reachable by hostname [irods-catalog-provider]')
+
+        # Force the test to fail if the provider cannot be identified by at least two different names.
+        if IrodsConfig().server_config['host'] == hostname_alias:
+            raise EnvironmentError('[host] property in server_config.json cannot match [irods-catalog-provider]')
+
+        resc_name = 'issue_8529_resc'
+        local_file = os.path.join(self.admin.local_session_dir, 'issue_8529_file.txt')
+
+        try:
+            lib.create_ufs_resource(self.admin, resc_name, hostname=hostname_alias)
+            lib.create_ascii_printable_file(local_file, 1)
+            self.admin.assert_icommand(['iput', '-R', resc_name, local_file], 'STDERR', ['-9000 SYS_EXCEED_CONNECT_CNT'])
+
+        finally:
+            self.admin.run_icommand(['irm', '-f', os.path.basename(local_file)])
+            self.admin.run_icommand(['iadmin', 'rmresc', resc_name])
diff --git a/server/core/src/initServer.cpp b/server/core/src/initServer.cpp
index addbadbc45..ae55f846f0 100644
--- a/server/core/src/initServer.cpp
+++ b/server/core/src/initServer.cpp
@@ -683,7 +683,15 @@ int initRsCommWithStartupPack(rsComm_t& rsComm, const startupPack_t& startupPack
     snprintf( tmpStr2, LONG_NAME_LEN, "%s=%d", IRODS_PROT, NATIVE_PROT );
     putenv( tmpStr2 );
 
-    rsComm.connectCnt = startupPack.connectCnt;
+    // The connect count is incremented to detect imminent infinite loops in server redirection. This can
+    // happen when the following is true:
+    // - The computer has multiple hostnames
+    // - The iRODS process is not configured to recognize all hostname aliases
+    // - The iRODS process is passed a hostname alias which causes it to redirect to itself
+    //
+    // Once the connect count exceeds a certain threshold, the server will terminate the request.
+    rsComm.connectCnt = startupPack.connectCnt + 1;
+
     rsComm.irodsProt = startupPack.irodsProt;
     rsComm.reconnFlag = startupPack.reconnFlag;
     rstrcpy(rsComm.proxyUser.userName, startupPack.proxyUser, NAME_LEN);
diff --git a/test/c_api_test/test.c b/test/c_api_test/test.c
index f4d830e8e1..128547069c 100644
--- a/test/c_api_test/test.c
+++ b/test/c_api_test/test.c
@@ -15,7 +15,7 @@
 #include "irods/dataObjClose.h"
 #include "irods/checksum.h"
 
-#if IRODS_VERSION_INTEGER != 5000000
+#if IRODS_VERSION_INTEGER != 5000001
 #  error "IRODS_VERSION_INTEGER needs attention"
 #endif
 


Reviews:
user: login: alanking
body: Is there a test we can add for this from the use case(s) in #8529? Maybe more words around the code change and/or in the commit message could be helpful as well.
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T19:39:04Z
user: login: trel
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-22T20:07:09Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T22:49:07Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T22:49:33Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T22:49:57Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T22:55:40Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T22:55:44Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T23:17:13Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T23:17:37Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T23:24:47Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T23:26:46Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T23:28:03Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T12:46:05Z
user: login: trel
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-23T12:50:58Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T12:55:42Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T13:21:23Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T13:33:04Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T13:33:13Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T13:41:53Z
user: login: alanking
body: Looks good. Minor comments in the test which can be ignored for now
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T14:19:32Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T14:22:27Z
user: login: alanking
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T14:23:37Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T15:38:34Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T15:40:06Z
user: login: alanking
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T15:49:17Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T15:54:35Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T19:43:48Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T19:43:57Z
user: login: alanking
body: I think we're good to squash?
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T19:46:19Z
user: login: trel
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-23T19:49:11Z
user: login: korydraughn
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T20:29:19Z
user: login: alanking
body: Yes, squash em
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T20:38:11Z
user: login: alanking
body: \# it
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T21:01:28Z

Review comments:
diff_hunk: @@ -683,7 +683,7 @@ int initRsCommWithStartupPack(rsComm_t& rsComm, const startupPack_t& startupPack
     snprintf( tmpStr2, LONG_NAME_LEN, "%s=%d", IRODS_PROT, NATIVE_PROT );
     putenv( tmpStr2 );
 
-    rsComm.connectCnt = startupPack.connectCnt;
+    rsComm.connectCnt = startupPack.connectCnt + 1;
path: server/core/src/initServer.cpp
user: login: trel
body: need a comment here to explain what this is for - help the next reader.

edit: oops, a dupe.   everybody is great.
created_at: 2025-05-22T20:07:09Z
author_association: MEMBER
diff_hunk: @@ -683,7 +683,7 @@ int initRsCommWithStartupPack(rsComm_t& rsComm, const startupPack_t& startupPack
     snprintf( tmpStr2, LONG_NAME_LEN, "%s=%d", IRODS_PROT, NATIVE_PROT );
     putenv( tmpStr2 );
 
-    rsComm.connectCnt = startupPack.connectCnt;
+    rsComm.connectCnt = startupPack.connectCnt + 1;
path: server/core/src/initServer.cpp
user: login: korydraughn
body: Done.
created_at: 2025-05-22T22:49:07Z
author_association: CONTRIBUTOR
diff_hunk: @@ -512,3 +509,34 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        hostname_alias = 'irods-catalog-provider'
+
+        # This test requires that the Catalog Service Provider be identifiable by two DNS names. This
+        # requirement is satisfied by the iRODS Testing Environment becauset setup_irods.py produces a
+        # server_config.json which initializes the "host" property to the container id while also allowing
+        # the same container to be identified (internally) as "irods-catalog-provider".
+        #
+        # The following code blocks will cause the test to fail if the requirements are not satisfied.
+        with session.make_session_for_existing_admin(hostname_alias) as admin:
+            admin.assert_icommand(['imiscsvrinfo'], 'STDOUT', ['RCAT_ENABLED'])
+#       with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
+#           if sock.connect_ex(hostname_alias) != 0:
+#               self.fail('[irods-catalog-provider] must identify the Catalog Service Provider')
path: scripts/irods/test/test_misc.py
user: login: korydraughn
body: Remove this.
created_at: 2025-05-22T22:49:32Z
author_association: CONTRIBUTOR
diff_hunk: @@ -512,3 +509,34 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        hostname_alias = 'irods-catalog-provider'
+
+        # This test requires that the Catalog Service Provider be identifiable by two DNS names. This
+        # requirement is satisfied by the iRODS Testing Environment becauset setup_irods.py produces a
+        # server_config.json which initializes the "host" property to the container id while also allowing
+        # the same container to be identified (internally) as "irods-catalog-provider".
+        #
+        # The following code blocks will cause the test to fail if the requirements are not satisfied.
path: scripts/irods/test/test_misc.py
user: login: korydraughn
body: Remove.
created_at: 2025-05-22T22:49:57Z
author_association: CONTRIBUTOR
diff_hunk: @@ -512,3 +509,34 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        hostname_alias = 'irods-catalog-provider'
+
+        # This test requires that the Catalog Service Provider be identifiable by two DNS names. This
+        # requirement is satisfied by the iRODS Testing Environment becauset setup_irods.py produces a
+        # server_config.json which initializes the "host" property to the container id while also allowing
+        # the same container to be identified (internally) as "irods-catalog-provider".
+        #
+        # The following code blocks will cause the test to fail if the requirements are not satisfied.
+        with session.make_session_for_existing_admin(hostname_alias) as admin:
+            admin.assert_icommand(['imiscsvrinfo'], 'STDOUT', ['RCAT_ENABLED'])
+#       with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
+#           if sock.connect_ex(hostname_alias) != 0:
+#               self.fail('[irods-catalog-provider] must identify the Catalog Service Provider')
path: scripts/irods/test/test_misc.py
user: login: korydraughn
body: Done.
created_at: 2025-05-22T22:55:39Z
author_association: CONTRIBUTOR
diff_hunk: @@ -512,3 +509,34 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        hostname_alias = 'irods-catalog-provider'
+
+        # This test requires that the Catalog Service Provider be identifiable by two DNS names. This
+        # requirement is satisfied by the iRODS Testing Environment becauset setup_irods.py produces a
+        # server_config.json which initializes the "host" property to the container id while also allowing
+        # the same container to be identified (internally) as "irods-catalog-provider".
+        #
+        # The following code blocks will cause the test to fail if the requirements are not satisfied.
path: scripts/irods/test/test_misc.py
user: login: korydraughn
body: Done.
created_at: 2025-05-22T22:55:44Z
author_association: CONTRIBUTOR
diff_hunk: @@ -18,5 +18,9 @@ following command using the service account.
 For additional information, see the help text (irodsServer -h) or
 documentation at https://docs.irods.org.
 
+If using rsyslog, please add irodsAgent to your rsyslog configuration
+to avoid missing important log messages. For detailed instructions, See
+https://docs.irods.org/5.0.0/system_overview/server_log/#rsyslog-configuration.
+
path: packaging/server_upgrade_instructions.txt
user: login: korydraughn
body: Confirm this shows up only during an upgrade.
created_at: 2025-05-22T23:17:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -512,3 +508,31 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        # This test requires that the Catalog Service Provider be identifiable by two DNS names. This
path: scripts/irods/test/test_misc.py
user: login: korydraughn
body: Remove "DNS".
created_at: 2025-05-22T23:17:37Z
author_association: CONTRIBUTOR
diff_hunk: @@ -18,5 +18,9 @@ following command using the service account.
 For additional information, see the help text (irodsServer -h) or
 documentation at https://docs.irods.org.
 
+If using rsyslog, please add irodsAgent to your rsyslog configuration
+to avoid missing important log messages. For detailed instructions, See
+https://docs.irods.org/5.0.0/system_overview/server_log/#rsyslog-configuration.
+
path: packaging/server_upgrade_instructions.txt
user: login: korydraughn
body: Message appears on upgrade of package.

```
Upgrading Existing iRODS Installation
Unpacking irods-server (5.0.1-0~jammy) over (4.3.4-0~jammy) ...
Preparing to unpack .../7-irods-runtime_5.0.1-0~jammy_amd64.deb ...
Unpacking irods-runtime (5.0.1-0~jammy) over (4.3.4-0~jammy) ...
Setting up irods-externals-boost1.81.0-2 (1.0-0~jammy) ...
Setting up irods-externals-nanodbc2.13.0-3 (1.0-0~jammy) ...
Setting up libfmt8:amd64 (8.1.1+ds1-2) ...
Setting up libspdlog1:amd64 (1:1.9.2+ds-0.2) ...
Setting up irods-runtime (5.0.1-0~jammy) ...
Setting up irods-server (5.0.1-0~jammy) ...

=======================================================================

Welcome to iRODS.

This upgrade of an iRODS server is currently incomplete.

To complete the upgrade, run the following command using the service
account.

  python3 scripts/upgrade_irods.py

Once the script completes, you may launch the server by running the
following command using the service account.

  irodsServer -d

For additional information, see the help text (irodsServer -h) or
documentation at https://docs.irods.org.

If using rsyslog, please add irodsAgent to your rsyslog configuration
to avoid missing important log messages. For detailed instructions, See
https://docs.irods.org/5.0.0/system_overview/server_log/#rsyslog-configuration.

=======================================================================

Setting up irods-icommands (5.0.1-0~jammy) ...
Setting up irods-database-plugin-postgres (5.0.1-0~jammy) ...
Processing triggers for libc-bin (2.35-0ubuntu3.9) ...
root@be3472317e6f:/#
```
created_at: 2025-05-22T23:24:47Z
author_association: CONTRIBUTOR
diff_hunk: @@ -18,5 +18,9 @@ following command using the service account.
 For additional information, see the help text (irodsServer -h) or
 documentation at https://docs.irods.org.
 
+If using rsyslog, please add irodsAgent to your rsyslog configuration
+to avoid missing important log messages. For detailed instructions, See
+https://docs.irods.org/5.0.0/system_overview/server_log/#rsyslog-configuration.
path: packaging/server_upgrade_instructions.txt
user: login: korydraughn
body: Open issue to make version number change with each release. Or open issue to remove this in a later release - but which one? 5.1 or 6.0?
created_at: 2025-05-22T23:26:46Z
author_association: CONTRIBUTOR
diff_hunk: @@ -512,3 +508,31 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        # This test requires that the Catalog Service Provider be identifiable by two DNS names. This
path: scripts/irods/test/test_misc.py
user: login: korydraughn
body: Done.
created_at: 2025-05-22T23:28:03Z
author_association: CONTRIBUTOR
diff_hunk: @@ -18,5 +18,9 @@ following command using the service account.
 For additional information, see the help text (irodsServer -h) or
 documentation at https://docs.irods.org.
 
+If using rsyslog, please add irodsAgent to your rsyslog configuration
+to avoid missing important log messages. For detailed instructions, See
+https://docs.irods.org/5.0.0/system_overview/server_log/#rsyslog-configuration.
path: packaging/server_upgrade_instructions.txt
user: login: korydraughn
body: 5.0.0 -> 5.0.1
created_at: 2025-05-23T12:46:05Z
author_association: CONTRIBUTOR
diff_hunk: @@ -18,5 +18,9 @@ following command using the service account.
 For additional information, see the help text (irodsServer -h) or
 documentation at https://docs.irods.org.
 
+If using rsyslog, please add irodsAgent to your rsyslog configuration
+to avoid missing important log messages. For detailed instructions, See
+https://docs.irods.org/5.0.0/system_overview/server_log/#rsyslog-configuration.
path: packaging/server_upgrade_instructions.txt
user: login: trel
body: that suggests we'll be releasing/pushing docs for 5.0.1.... which i suppose is correct.
created_at: 2025-05-23T12:50:58Z
author_association: MEMBER
diff_hunk: @@ -512,3 +508,31 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        # This test requires that the Catalog Service Provider be identifiable by two names. This
+        # requirement is satisfied by the iRODS Testing Environment becauset setup_irods.py produces a
path: scripts/irods/test/test_misc.py
user: login: korydraughn
body: becauset -> because
created_at: 2025-05-23T12:55:42Z
author_association: CONTRIBUTOR
diff_hunk: @@ -18,5 +18,9 @@ following command using the service account.
 For additional information, see the help text (irodsServer -h) or
 documentation at https://docs.irods.org.
 
+If using rsyslog, please add irodsAgent to your rsyslog configuration
+to avoid missing important log messages. For detailed instructions, See
+https://docs.irods.org/5.0.0/system_overview/server_log/#rsyslog-configuration.
path: packaging/server_upgrade_instructions.txt
user: login: korydraughn
body: Correct.
created_at: 2025-05-23T13:21:23Z
author_association: CONTRIBUTOR
diff_hunk: @@ -18,5 +18,9 @@ following command using the service account.
 For additional information, see the help text (irodsServer -h) or
 documentation at https://docs.irods.org.
 
+If using rsyslog, please add irodsAgent to your rsyslog configuration
+to avoid missing important log messages. For detailed instructions, See
+https://docs.irods.org/5.0.0/system_overview/server_log/#rsyslog-configuration.
path: packaging/server_upgrade_instructions.txt
user: login: korydraughn
body: Done.
created_at: 2025-05-23T13:33:04Z
author_association: CONTRIBUTOR
diff_hunk: @@ -512,3 +508,31 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        # This test requires that the Catalog Service Provider be identifiable by two names. This
+        # requirement is satisfied by the iRODS Testing Environment becauset setup_irods.py produces a
path: scripts/irods/test/test_misc.py
user: login: korydraughn
body: Done.
created_at: 2025-05-23T13:33:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -18,5 +18,9 @@ following command using the service account.
 For additional information, see the help text (irodsServer -h) or
 documentation at https://docs.irods.org.
 
+If using rsyslog, please add irodsAgent to your rsyslog configuration
+to avoid missing important log messages. For detailed instructions, See
+https://docs.irods.org/5.0.0/system_overview/server_log/#rsyslog-configuration.
path: packaging/server_upgrade_instructions.txt
user: login: korydraughn
body: Created #8536.
created_at: 2025-05-23T13:41:53Z
author_association: CONTRIBUTOR
diff_hunk: @@ -18,5 +18,9 @@ following command using the service account.
 For additional information, see the help text (irodsServer -h) or
 documentation at https://docs.irods.org.
 
+If using rsyslog, please add irodsAgent to your rsyslog configuration
+to avoid missing important log messages. For detailed instructions, See
+https://docs.irods.org/5.0.1/system_overview/server_log/#rsyslog-configuration.
path: packaging/server_upgrade_instructions.txt
user: login: alanking
body: Are we going to update this every release? Is there a way to just say... see https://docs.irods.org?
created_at: 2025-05-23T13:57:33Z
author_association: CONTRIBUTOR
diff_hunk: @@ -512,3 +508,31 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        # This test requires that the Catalog Service Provider be identifiable by two names. This
+        # requirement is satisfied by the iRODS Testing Environment because setup_irods.py produces a
+        # server_config.json which initializes the "host" property to the container id while also allowing
+        # the same container to be identified (internally) as "irods-catalog-provider".
+
+        # Force the test to fail if it is not run from the provider.
+        hostname_alias = 'irods-catalog-provider'
+        with session.make_session_for_existing_admin(hostname_alias) as admin:
+            admin.assert_icommand(['imiscsvrinfo'], 'STDOUT', ['RCAT_ENABLED'])
+
+        # Force the test to fail if the provider cannot be identified by at least two different names.
+        if IrodsConfig().server_config['host'] == hostname_alias:
+            self.fail('[host] property in server_config.json cannot match [irods-catalog-provider]')
path: scripts/irods/test/test_misc.py
user: login: alanking
body: This could be a `self.assertEqual`, *or*, if this is a precondition for the test, we have in other instances raised an `EnvironmentError` when a test's pre-conditions are not being met: https://github.com/irods/irods/blob/c1fc9f2c4835c51355ec4b277bd3a663e4f9e095/scripts/irods/test/test_pam_password_authentication.py#L79-L89
created_at: 2025-05-23T14:09:01Z
author_association: CONTRIBUTOR
diff_hunk: @@ -512,3 +508,31 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        # This test requires that the Catalog Service Provider be identifiable by two names. This
+        # requirement is satisfied by the iRODS Testing Environment because setup_irods.py produces a
+        # server_config.json which initializes the "host" property to the container id while also allowing
+        # the same container to be identified (internally) as "irods-catalog-provider".
+
+        # Force the test to fail if it is not run from the provider.
+        hostname_alias = 'irods-catalog-provider'
+        with session.make_session_for_existing_admin(hostname_alias) as admin:
+            admin.assert_icommand(['imiscsvrinfo'], 'STDOUT', ['RCAT_ENABLED'])
path: scripts/irods/test/test_misc.py
user: login: alanking
body: Does this rather (or, additionally) test that `irods-catalog-provider` is a valid hostname alias for the host running the test? We have the `skipIf` above to ensure that this is running on a catalog provider
created_at: 2025-05-23T14:16:07Z
author_association: CONTRIBUTOR
diff_hunk: @@ -18,5 +18,9 @@ following command using the service account.
 For additional information, see the help text (irodsServer -h) or
 documentation at https://docs.irods.org.
 
+If using rsyslog, please add irodsAgent to your rsyslog configuration
+to avoid missing important log messages. For detailed instructions, See
+https://docs.irods.org/5.0.1/system_overview/server_log/#rsyslog-configuration.
path: packaging/server_upgrade_instructions.txt
user: login: korydraughn
body: See #8536.
created_at: 2025-05-23T14:22:27Z
author_association: CONTRIBUTOR
diff_hunk: @@ -18,5 +18,9 @@ following command using the service account.
 For additional information, see the help text (irodsServer -h) or
 documentation at https://docs.irods.org.
 
+If using rsyslog, please add irodsAgent to your rsyslog configuration
+to avoid missing important log messages. For detailed instructions, See
+https://docs.irods.org/5.0.1/system_overview/server_log/#rsyslog-configuration.
path: packaging/server_upgrade_instructions.txt
user: login: alanking
body: Okey dokey. Haven't caught up on the emails, I guess. Resolving
created_at: 2025-05-23T14:23:37Z
author_association: CONTRIBUTOR
diff_hunk: @@ -512,3 +508,31 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        # This test requires that the Catalog Service Provider be identifiable by two names. This
+        # requirement is satisfied by the iRODS Testing Environment because setup_irods.py produces a
+        # server_config.json which initializes the "host" property to the container id while also allowing
+        # the same container to be identified (internally) as "irods-catalog-provider".
+
+        # Force the test to fail if it is not run from the provider.
+        hostname_alias = 'irods-catalog-provider'
+        with session.make_session_for_existing_admin(hostname_alias) as admin:
+            admin.assert_icommand(['imiscsvrinfo'], 'STDOUT', ['RCAT_ENABLED'])
+
+        # Force the test to fail if the provider cannot be identified by at least two different names.
+        if IrodsConfig().server_config['host'] == hostname_alias:
+            self.fail('[host] property in server_config.json cannot match [irods-catalog-provider]')
path: scripts/irods/test/test_misc.py
user: login: korydraughn
body: Will update.
created_at: 2025-05-23T15:38:34Z
author_association: CONTRIBUTOR
diff_hunk: @@ -512,3 +508,31 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        # This test requires that the Catalog Service Provider be identifiable by two names. This
+        # requirement is satisfied by the iRODS Testing Environment because setup_irods.py produces a
+        # server_config.json which initializes the "host" property to the container id while also allowing
+        # the same container to be identified (internally) as "irods-catalog-provider".
+
+        # Force the test to fail if it is not run from the provider.
+        hostname_alias = 'irods-catalog-provider'
+        with session.make_session_for_existing_admin(hostname_alias) as admin:
+            admin.assert_icommand(['imiscsvrinfo'], 'STDOUT', ['RCAT_ENABLED'])
path: scripts/irods/test/test_misc.py
user: login: korydraughn
body: > Does this rather (or, additionally) test that `irods-catalog-provider` is a valid hostname alias for the host running the test?

That's correct.
created_at: 2025-05-23T15:40:06Z
author_association: CONTRIBUTOR
diff_hunk: @@ -512,3 +508,31 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        # This test requires that the Catalog Service Provider be identifiable by two names. This
+        # requirement is satisfied by the iRODS Testing Environment because setup_irods.py produces a
+        # server_config.json which initializes the "host" property to the container id while also allowing
+        # the same container to be identified (internally) as "irods-catalog-provider".
+
+        # Force the test to fail if it is not run from the provider.
+        hostname_alias = 'irods-catalog-provider'
+        with session.make_session_for_existing_admin(hostname_alias) as admin:
+            admin.assert_icommand(['imiscsvrinfo'], 'STDOUT', ['RCAT_ENABLED'])
path: scripts/irods/test/test_misc.py
user: login: alanking
body: Okay. Maybe a comment with that info would be helpful here?
created_at: 2025-05-23T15:49:17Z
author_association: CONTRIBUTOR
diff_hunk: @@ -512,3 +508,31 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        # This test requires that the Catalog Service Provider be identifiable by two names. This
+        # requirement is satisfied by the iRODS Testing Environment because setup_irods.py produces a
+        # server_config.json which initializes the "host" property to the container id while also allowing
+        # the same container to be identified (internally) as "irods-catalog-provider".
+
+        # Force the test to fail if it is not run from the provider.
+        hostname_alias = 'irods-catalog-provider'
+        with session.make_session_for_existing_admin(hostname_alias) as admin:
+            admin.assert_icommand(['imiscsvrinfo'], 'STDOUT', ['RCAT_ENABLED'])
path: scripts/irods/test/test_misc.py
user: login: korydraughn
body: Will include more words.
created_at: 2025-05-23T15:54:35Z
author_association: CONTRIBUTOR
diff_hunk: @@ -512,3 +508,31 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        # This test requires that the Catalog Service Provider be identifiable by two names. This
+        # requirement is satisfied by the iRODS Testing Environment because setup_irods.py produces a
+        # server_config.json which initializes the "host" property to the container id while also allowing
+        # the same container to be identified (internally) as "irods-catalog-provider".
+
+        # Force the test to fail if it is not run from the provider.
+        hostname_alias = 'irods-catalog-provider'
+        with session.make_session_for_existing_admin(hostname_alias) as admin:
+            admin.assert_icommand(['imiscsvrinfo'], 'STDOUT', ['RCAT_ENABLED'])
+
+        # Force the test to fail if the provider cannot be identified by at least two different names.
+        if IrodsConfig().server_config['host'] == hostname_alias:
+            self.fail('[host] property in server_config.json cannot match [irods-catalog-provider]')
path: scripts/irods/test/test_misc.py
user: login: korydraughn
body: Done.
created_at: 2025-05-23T19:43:48Z
author_association: CONTRIBUTOR
diff_hunk: @@ -512,3 +508,31 @@ def test_configuration_validation_reports_fqdn_size_violations__issue_8287(self)
                 self.assertIn('"valid": false', res.stderr)
                 self.assertIn('"instanceLocation": "/host"', res.stderr)
                 self.assertIn('"error": "Number of characters must be at most 253"', res.stderr)
+
+    @unittest.skipIf(test.settings.TOPOLOGY_FROM_RESOURCE_SERVER, 'Test must be run from the Catalog Service Provider')
+    def test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529(self):
+        # This test requires that the Catalog Service Provider be identifiable by two names. This
+        # requirement is satisfied by the iRODS Testing Environment because setup_irods.py produces a
+        # server_config.json which initializes the "host" property to the container id while also allowing
+        # the same container to be identified (internally) as "irods-catalog-provider".
+
+        # Force the test to fail if it is not run from the provider.
+        hostname_alias = 'irods-catalog-provider'
+        with session.make_session_for_existing_admin(hostname_alias) as admin:
+            admin.assert_icommand(['imiscsvrinfo'], 'STDOUT', ['RCAT_ENABLED'])
path: scripts/irods/test/test_misc.py
user: login: korydraughn
body: Done.
created_at: 2025-05-23T19:43:57Z
author_association: CONTRIBUTOR
diff_hunk: @@ -683,7 +683,15 @@ int initRsCommWithStartupPack(rsComm_t& rsComm, const startupPack_t& startupPack
     snprintf( tmpStr2, LONG_NAME_LEN, "%s=%d", IRODS_PROT, NATIVE_PROT );
     putenv( tmpStr2 );
 
-    rsComm.connectCnt = startupPack.connectCnt;
+    // The connect count is incremented to detect infinite loops in server redirection. This can happen
path: server/core/src/initServer.cpp
user: login: trel
body: ```suggestion
    // The connect count is incremented to detect imminent infinite loops in server redirection. This can happen
```
created_at: 2025-05-23T19:49:11Z
author_association: MEMBER
diff_hunk: @@ -683,7 +683,15 @@ int initRsCommWithStartupPack(rsComm_t& rsComm, const startupPack_t& startupPack
     snprintf( tmpStr2, LONG_NAME_LEN, "%s=%d", IRODS_PROT, NATIVE_PROT );
     putenv( tmpStr2 );
 
-    rsComm.connectCnt = startupPack.connectCnt;
+    // The connect count is incremented to detect infinite loops in server redirection. This can happen
path: server/core/src/initServer.cpp
user: login: korydraughn
body: Done.
created_at: 2025-05-23T20:29:18Z
author_association: CONTRIBUTOR

PR comments:
user: login: korydraughn
created_at: 2025-05-22T19:47:23Z
body: A test would involve monitoring the log file and/or process tree. We also had to fiddle with /etc/hosts to get the desired failure case. I don't think we can write a reliable test for this yet.

Will add more words around the commit message and code.
author_association: CONTRIBUTOR
user: login: korydraughn
created_at: 2025-05-22T19:48:24Z
body: Happy to discuss ways to add a test though.
author_association: CONTRIBUTOR
user: login: alanking
created_at: 2025-05-22T19:50:24Z
body: I think we just need to ensure that the right error is returned... This reproduced the issue in our testing environment:

```
$ iadmin mkresc ufs1 unixfilesystem irods-catalog-provider:/var/lib/irods/ufs1vault
Creating resource:
Name:           "ufs1"
Type:           "unixfilesystem"
Host:           "irods-catalog-provider"
Path:           "/var/lib/irods/ufs1vault"
Context:        ""
$ ils
/tempZone/home/rods:
$ ilsresc
db9688c8292dResource:unixfilesystem
demoResc:unixfilesystem
ufs1:unixfilesystem
$ iput -R ufs1 version.json foo
remote addresses: 172.19.0.3 ERROR: putUtil: put error for /tempZone/home/rods/goo, status = -167000 status = -167000 SYS_LIBRARY_ERROR
```
Or maybe you had something else in mind?
author_association: CONTRIBUTOR
user: login: korydraughn
created_at: 2025-05-22T20:32:02Z
body: We've confirmed that https://github.com/irods/irods/pull/8532#issuecomment-2902389581 is solved by this PR.

Will add that as a test.
author_association: CONTRIBUTOR
user: login: korydraughn
created_at: 2025-05-22T22:51:30Z
body: Verified the test produces `SYS_LIBRARY_ERROR` without the C++ code change.

```
 --- IrodsSession: icommand executed by [rods#tempZone] [imiscsvrinfo] --- 
Assert Command: imiscsvrinfo                                                          
Expecting STDOUT: ['RCAT_ENABLED']     
  stdout:            
    | RCAT_ENABLED
    | relVersion=rods5.0.0
    | apiVersion=d
    | rodsZone=tempZone
    | SSL/TLS Info:
    |     enabled: false
  stderr:
    |                     
Output found                                                          
                                                                                                                                                                                              
 --- IrodsSession: icommand executed by [otherrods#tempZone] [iadmin mkresc issue_8529_resc unixfilesystem irods-catalog-provider:/tmp/irods-testing-ycdng34d/issue_8529_resc_vault] --- 
Assert Command: iadmin mkresc issue_8529_resc unixfilesystem irods-catalog-provider:/tmp/irods-testing-ycdng34d/issue_8529_resc_vault
Expecting STDOUT: ['issue_8529_resc']                                                                                                                                                         
  stdout:                                                                                                                                                                                     
    | Creating resource:                                                           
    | Name:             "issue_8529_resc" 
    | Type:             "unixfilesystem"                                         
    | Host:             "irods-catalog-provider"             
    | Path:             "/tmp/irods-testing-ycdng34d/issue_8529_resc_vault"       
    | Context:  ""
  stderr:     
    | 
Output found                                                          
                                                                                               
 --- IrodsSession: icommand executed by [otherrods#tempZone] [iput -R issue_8529_resc /tmp/irods-testing-ycdng34d/issue_8529_file.txt] --- 
Assert Command: iput -R issue_8529_resc /tmp/irods-testing-ycdng34d/issue_8529_file.txt
Expecting STDERR: ['-9000 SYS_EXCEED_CONNECT_CNT']
  stdout:
    |                    
  stderr:
    | remote addresses: 172.18.0.3 ERROR: putUtil: put error for /tempZone/home/otherrods/2025-05-22Z22:34:58--irods-testing-ycdng34d/issue_8529_file.txt, status = -167000 status = -167000 SYS_LIBRARY_ERROR
Output not found
                                                                                               
FAILED TESTING ASSERTION
```
author_association: CONTRIBUTOR
user: login: korydraughn
created_at: 2025-05-22T23:02:58Z
body: Test passes with C++ code change.

```
 --- IrodsSession: icommand executed by [rods#tempZone] [imiscsvrinfo] --- 
Assert Command: imiscsvrinfo
Expecting STDOUT: ['RCAT_ENABLED']
  stdout:
    | RCAT_ENABLED
    | relVersion=rods5.0.1
    | apiVersion=d
    | rodsZone=tempZone
    | SSL/TLS Info:                                                                                                                                                                           
    |     enabled: false
  stderr:                                                                            
    | 
Output found                                                                                                                                                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                                                                                                             
 --- IrodsSession: icommand executed by [otherrods#tempZone] [iadmin mkresc issue_8529_resc unixfilesystem irods-catalog-provider:/tmp/irods-testing-6m7g5caa/issue_8529_resc_vault] --- 
Assert Command: iadmin mkresc issue_8529_resc unixfilesystem irods-catalog-provider:/tmp/irods-testing-6m7g5caa/issue_8529_resc_vault
Expecting STDOUT: ['issue_8529_resc']
  stdout:                                                 
    | Creating resource:
    | Name:             "issue_8529_resc"                     
    | Type:             "unixfilesystem"
    | Host:             "irods-catalog-provider"                                                                                                                                              
    | Path:             "/tmp/irods-testing-6m7g5caa/issue_8529_resc_vault"
    | Context:  ""   
  stderr:              
    |                                                                    
Output found
                                                                                               
 --- IrodsSession: icommand executed by [otherrods#tempZone] [iput -R issue_8529_resc /tmp/irods-testing-6m7g5caa/issue_8529_file.txt] --- 
Assert Command: iput -R issue_8529_resc /tmp/irods-testing-6m7g5caa/issue_8529_file.txt
Expecting STDERR: ['-9000 SYS_EXCEED_CONNECT_CNT']
  stdout:                      
    |                                    
  stderr:                                                               
    | remote addresses: 172.18.0.3 ERROR: putUtil: put error for /tempZone/home/otherrods/2025-05-22Z22:59:02--irods-testing-6m7g5caa/issue_8529_file.txt, status = -9000 status = -9000 SYS_EXCEED_CONNECT_CNT
Output found                                                      
                                                                                               
 --- IrodsSession: icommand executed by [otherrods#tempZone] [irm -f issue_8529_file.txt] --- 
 --- IrodsSession: icommand executed by [otherrods#tempZone] [iadmin rmresc issue_8529_resc] --- 

<snip>

-----
results for [ubuntu-2204-postgres-14_irods-catalog-provider_1]
        passed tests:
                [[   6.0097]s]  [test_misc.Test_Misc.test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529]
        skipped tests:
        failed tests:
        return code:[0]
        time elapsed: [    6.012]seconds ([   0]hours [   0.1002]minutes)
-----
All tests passed! :)
time elapsed: [   6.0130]seconds ([   0]hours [ 0.1002]minutes)
==== end of test run results ====

2025-05-22 18:59:05,529 - [[0]]
2025-05-22 18:59:05,631 - version:[5.0.1]
2025-05-22 18:59:05,632 - sha:[4a8c5e5558f6fb4d2f6524af5d2dcf4d901cb3ae]
```
author_association: CONTRIBUTOR
user: login: korydraughn
created_at: 2025-05-22T23:06:23Z
body: Test is skipped when run in a topology from a consumer, as intended.

```
2025-05-22 19:05:09,615 - host resolution configured successfully [ubuntu-2204-postgres-14_irods-catalog-provider_1]
2025-05-22 19:05:09,625 - host resolution configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_2]
2025-05-22 19:05:09,625 - host resolution configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_1]
2025-05-22 19:05:09,627 - host resolution configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_3]
2025-05-22 19:05:10,048 - hello script configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_2]
2025-05-22 19:05:10,056 - hello script configured successfully [ubuntu-2204-postgres-14_irods-catalog-provider_1]
2025-05-22 19:05:10,058 - hello script configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_1]
2025-05-22 19:05:10,059 - hello script configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_3]
2025-05-22 19:05:10,470 - univMSS script configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_2]
2025-05-22 19:05:10,471 - univMSS script configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_1]
2025-05-22 19:05:10,481 - univMSS script configured successfully [ubuntu-2204-postgres-14_irods-catalog-provider_1]
2025-05-22 19:05:10,483 - univMSS script configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_3]
2025-05-22 19:05:10,626 - [ubuntu-2204-postgres-14_irods-catalog-consumer_1] successfully configured pam
2025-05-22 19:05:10,635 - [ubuntu-2204-postgres-14_irods-catalog-provider_1] successfully configured pam
2025-05-22 19:05:10,640 - [ubuntu-2204-postgres-14_irods-catalog-consumer_3] successfully configured pam
2025-05-22 19:05:10,641 - [ubuntu-2204-postgres-14_irods-catalog-consumer_2] successfully configured pam
2025-05-22 19:05:11,420 - [ubuntu-2204-postgres-14_irods-catalog-provider_1] successfully created test user accounts
2025-05-22 19:05:11,437 - [ubuntu-2204-postgres-14_irods-catalog-consumer_3] successfully created test user accounts
2025-05-22 19:05:11,437 - [ubuntu-2204-postgres-14_irods-catalog-consumer_1] successfully created test user accounts
2025-05-22 19:05:11,447 - [ubuntu-2204-postgres-14_irods-catalog-consumer_2] successfully created test user accounts
2025-05-22 19:05:11,598 - [['--xml_output', '--topology=resource', '--hostnames', '9f9927d1d10e', 'eea4bec6f672', 'c98dfa0da072', '68d5b7136482']]
2025-05-22 19:05:11,599 - options:[['--xml_output', '--topology=resource', '--hostnames', '9f9927d1d10e', 'eea4bec6f672', 'c98dfa0da072', '68d5b7136482']]
2025-05-22 19:05:11,600 - before [{'executing_container': 'ubuntu-2204-postgres-14_irods-catalog-consumer_1', 'return_code': 0, 'test_list': [], 'passed_tests': [], 'failed_tests': [], 'duration': -1}]
2025-05-22 19:05:11,600 - after  [{'executing_container': 'ubuntu-2204-postgres-14_irods-catalog-consumer_1', 'return_code': 0, 'test_list': ['test_misc.Test_Misc.test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529'], 'passed_tests': [], 'failed_tests': [], 'duration': -1}]
2025-05-22 19:05:11,600 - [ubuntu-2204-postgres-14_irods-catalog-consumer_1]: running test [test_misc.Test_Misc.test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529]
2025-05-22 19:05:13,859 - 
Running tests...
----------------------------------------------------------------------

2025-05-22 19:05:13,867 -   test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529 (irods.test.test_misc.Test_Misc) ... 
2025-05-22 19:05:13,867 - skip (0.008s)

----------------------------------------------------------------------
Ran 1 test in 0.008s

OK (skipped=1)
```
author_association: CONTRIBUTOR
user: login: korydraughn
created_at: 2025-05-22T23:09:17Z
body: Test runs and passes when launched in a topology from a provider, as intended.

```
2025-05-22 19:07:10,029 - host resolution configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_2]
2025-05-22 19:07:10,040 - host resolution configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_3]
2025-05-22 19:07:10,040 - host resolution configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_1]
2025-05-22 19:07:10,495 - hello script configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_1]
2025-05-22 19:07:10,496 - hello script configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_2]
2025-05-22 19:07:10,496 - hello script configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_3]
2025-05-22 19:07:10,496 - hello script configured successfully [ubuntu-2204-postgres-14_irods-catalog-provider_1]
2025-05-22 19:07:10,999 - univMSS script configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_3]
2025-05-22 19:07:11,000 - univMSS script configured successfully [ubuntu-2204-postgres-14_irods-catalog-provider_1]
2025-05-22 19:07:11,006 - univMSS script configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_2]                            
2025-05-22 19:07:11,008 - univMSS script configured successfully [ubuntu-2204-postgres-14_irods-catalog-consumer_1]
2025-05-22 19:07:11,178 - [ubuntu-2204-postgres-14_irods-catalog-provider_1] successfully configured pam
2025-05-22 19:07:11,182 - [ubuntu-2204-postgres-14_irods-catalog-consumer_3] successfully configured pam
2025-05-22 19:07:11,184 - [ubuntu-2204-postgres-14_irods-catalog-consumer_2] successfully configured pam
2025-05-22 19:07:11,184 - [ubuntu-2204-postgres-14_irods-catalog-consumer_1] successfully configured pam
2025-05-22 19:07:11,727 - [ubuntu-2204-postgres-14_irods-catalog-consumer_1] successfully created test user accounts
2025-05-22 19:07:11,745 - [ubuntu-2204-postgres-14_irods-catalog-consumer_2] successfully created test user accounts
2025-05-22 19:07:11,747 - [ubuntu-2204-postgres-14_irods-catalog-provider_1] successfully created test user accounts
2025-05-22 19:07:11,748 - [ubuntu-2204-postgres-14_irods-catalog-consumer_3] successfully created test user accounts
2025-05-22 19:07:11,898 - [['--xml_output', '--topology=icat', '--hostnames', '59d4907a5a3e', '6b30cb3cc0bd', 'ffc8bf089c12', 'adc75ffa9819']]
2025-05-22 19:07:11,898 - options:[['--xml_output', '--topology=icat', '--hostnames', '59d4907a5a3e', '6b30cb3cc0bd', 'ffc8bf089c12', 'adc75ffa9819']]
2025-05-22 19:07:11,899 - before [{'executing_container': 'ubuntu-2204-postgres-14_irods-catalog-provider_1', 'return_code': 0, 'test_list': [], 'passed_tests': [], 'failed_tests': [], 'duration': -1}]
2025-05-22 19:07:11,899 - after  [{'executing_container': 'ubuntu-2204-postgres-14_irods-catalog-provider_1', 'return_code': 0, 'test_list': ['test_misc.Test_Misc.test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529'], 'passed_tests': [], 'failed_tests': [], 'duration': -1}]
2025-05-22 19:07:11,900 - [ubuntu-2204-postgres-14_irods-catalog-provider_1]: running test [test_misc.Test_Misc.test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529]
2025-05-22 19:07:15,141 - 
Running tests...
----------------------------------------------------------------------

2025-05-22 19:07:15,154 -   test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529 (irods.test.test_misc.Test_Misc) ... 
2025-05-22 19:07:18,821 - ok (3.680s)

<snip>

 --- IrodsSession: icommand executed by [otherrods#tempZone] [iadmin mkresc issue_8529_resc unixfilesystem irods-catalog-provider:/tmp/irods-testing-u03ji180/issue_8529_resc_vault] --- 
Assert Command: iadmin mkresc issue_8529_resc unixfilesystem irods-catalog-provider:/tmp/irods-testing-u03ji180/issue_8529_resc_vault
Expecting STDOUT: ['issue_8529_resc']
  stdout:
    | Creating resource:
    | Name:             "issue_8529_resc"
    | Type:             "unixfilesystem"
    | Host:             "irods-catalog-provider"
    | Path:             "/tmp/irods-testing-u03ji180/issue_8529_resc_vault"
    | Context:  ""
  stderr:
    | 
Output found

 --- IrodsSession: icommand executed by [otherrods#tempZone] [iput -R issue_8529_resc /tmp/irods-testing-u03ji180/issue_8529_file.txt] --- 
Assert Command: iput -R issue_8529_resc /tmp/irods-testing-u03ji180/issue_8529_file.txt
Expecting STDERR: ['-9000 SYS_EXCEED_CONNECT_CNT']
  stdout:
    | 
  stderr:
    | remote addresses: 172.18.0.3 ERROR: putUtil: put error for /tempZone/home/otherrods/2025-05-22Z23:07:15--irods-testing-u03ji180/issue_8529_file.txt, status = -9000 status = -9000 SYS_EXCEED_CONNECT_CNT
Output found

<snip>

2025-05-22 19:07:18,876 - [ubuntu-2204-postgres-14_irods-catalog-provider_1]: cmd [0] [['python3', '/var/lib/irods/scripts/run_tests.py', '--run_specific_test', 'test_misc.Test_Misc.test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529', '--xml_output', '--topology=icat', '--hostnames', '59d4907a5a3e', '6b30cb3cc0bd', 'ffc8bf089c12', 'adc75ffa98
19']]
2025-05-22 19:07:18,876 - [ubuntu-2204-postgres-14_irods-catalog-provider_1]: test passed [[   6.9760]s] [test_misc.Test_Misc.test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529]
2025-05-22 19:07:18,877 - [ubuntu-2204-postgres-14_irods-catalog-provider_1]: Queue is empty!
2025-05-22 19:07:18,877 - [ubuntu-2204-postgres-14_irods-catalog-provider_1]: tests completed successfully
2025-05-22 19:07:18,878 - [[0]]
2025-05-22 19:07:18,878 - ==== begin test run results ====
-----
results for [ubuntu-2204-postgres-14_irods-catalog-provider_1]
        passed tests:
                [[   6.9760]s]  [test_misc.Test_Misc.test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529]
        skipped tests:
        failed tests:
        return code:[0]
        time elapsed: [    6.978]seconds ([   0]hours [   0.1163]minutes)
-----
All tests passed! :)
time elapsed: [   6.9794]seconds ([   0]hours [ 0.1163]minutes)
==== end of test run results ====

2025-05-22 19:07:18,879 - [[0]]
2025-05-22 19:07:18,981 - version:[5.0.1]
2025-05-22 19:07:18,981 - sha:[4a8c5e5558f6fb4d2f6524af5d2dcf4d901cb3ae]
```
author_association: CONTRIBUTOR
user: login: korydraughn
created_at: 2025-05-22T23:37:38Z
body: All unit tests passed.

```
-----
All tests passed! :)
time elapsed: [ 156.5797]seconds ([   0]hours [ 2.6097]minutes)
==== end of test run results ====

2025-05-22 19:36:08,727 - version:[5.0.1]
2025-05-22 19:36:08,727 - sha:[3401f5cff14a6230350a13673c2d03d1079bfe8d]
```

Running core tests.
author_association: CONTRIBUTOR
user: login: korydraughn
created_at: 2025-05-23T01:51:42Z
body: All core tests passed.

```
-----
All tests passed! :)
time elapsed: [4368.9848]seconds ([   1]hours [12.8164]minutes)
==== end of test run results ====

2025-05-22 20:52:05,253 - version:[5.0.1]
2025-05-22 20:52:05,253 - sha:[3401f5cff14a6230350a13673c2d03d1079bfe8d]
```
author_association: CONTRIBUTOR
user: login: trel
created_at: 2025-05-23T16:52:46Z
body: please update the commit message to not say `infinite redirect loop`...  or at least point out that this only happened (and is now caught) when there is a hostname misconfiguration...
author_association: MEMBER
user: login: trel
created_at: 2025-05-23T16:54:35Z
body: perhaps...
```
Return `SYS_EXCEED_CONNECT_CNT` when server redirects to self due to misconfiguration
```
author_association: MEMBER
user: login: korydraughn
created_at: 2025-05-23T19:49:38Z
body: Almost. Confirming the changes to the test work.
author_association: CONTRIBUTOR
user: login: korydraughn
created_at: 2025-05-23T20:06:37Z
body: Confirmed the skipIf annotation and EnvironmentError change work.
```
======================================================================                                                                                       
ERROR: test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529 (irods.test.test_misc.Test_Misc)                              
----------------------------------------------------------------------                                                                                       
Traceback (most recent call last):                                                                                                                           
  File "/var/lib/irods/scripts/irods/test/test_misc.py", line 527, in test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529
    raise EnvironmentError('[host] property in server_config.json cannot match [irods-catalog-provider]')                                                    
OSError: [host] property in server_config.json cannot match [irods-catalog-provider]                                                                         
                                                                                                                                                             
----------------------------------------------------------------------                                                                                       
Ran 1 test in 2.208s                                                                                                                                         
                                                                                                                                                             
FAILED (errors=1)                                                                                                                                            
<__main__.RegisteredTestResult run=1 errors=1 failures=0>                                                                                                    
```

Turns out that these lines ...
```py
hostname_alias = 'irods-catalog-provider'
with session.make_session_for_existing_admin(hostname_alias) as admin:
```
... result in the test failing with the following when `irods-catalog-provider` doesn't resolve to anything. So, the assertion which invokes `imiscsvrinfo` isn't needed.
```
 --- IrodsSession: icommand executed by [rods#tempZone] [iinit] --- 
Assert Command: iinit                                                                          
Expecting STDOUT_SINGLELINE: ['']                                                              
  stdout:                                                                                      
    | Connecting as rods#tempZone to irods-catalog-provider:1247 ...                           
  stderr:                                                                                      
    |  ERROR: getaddrinfo_with_retry address resolution timeout [irods-catalog-provider] [ai_flags: [0] ai_family: [2] ai_socktype: [0] ai_protocol: [0]]
    |  ERROR: _rcConnect: setRhostInfo error, IRODS_HOST is probably not set correctly status = -303000 USER_RODS_HOSTNAME_ERR
Unexpected output on stderr                                                                    

FAILED TESTING ASSERTION                                                                       
```
author_association: CONTRIBUTOR
user: login: korydraughn
created_at: 2025-05-23T20:26:38Z
body: Adjusted test based on the imiscsvrinfo situation and confirmed it works as intended.

```
irods.test.test_misc.Test_Misc.test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529 ... ERROR                                                              
                                                                                                                                                                                              
======================================================================                     
ERROR: test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529 (irods.test.test_misc.Test_Misc)                                                               
----------------------------------------------------------------------                         
Traceback (most recent call last):                                                             
  File "/var/lib/irods/scripts/irods/test/test_misc.py", line 523, in test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529                                 
    admin = session.make_session_for_existing_admin(hostname_alias)                            
  File "/var/lib/irods/scripts/irods/test/session.py", line 35, in make_session_for_existing_admin                                                                                            
    return IrodsSession(env_dict, test.settings.PREEXISTING_ADMIN_PASSWORD, False)             
  File "/var/lib/irods/scripts/irods/test/session.py", line 101, in __init__                                                                                                                  
    self.assert_icommand('iinit', 'STDOUT_SINGLELINE',                                  
  File "/var/lib/irods/scripts/irods/test/session.py", line 162, in assert_icommand            
    return assert_command(*args, **kwargs)                                                     
  File "/var/lib/irods/scripts/irods/test/command.py", line 76, in assert_command              
    return _assert_helper(*args, should_fail=False, **kwargs)                                  
  File "/var/lib/irods/scripts/irods/test/command.py", line 104, in _assert_helper             
    assert result                                                                              
AssertionError                                                                                 
                                                                                               
During handling of the above exception, another exception occurred:
                                                                                               
Traceback (most recent call last):
  File "/var/lib/irods/scripts/irods/test/test_misc.py", line 526, in test_server_returns_SYS_EXCEED_CONNECT_CNT_on_infinite_server_redirect_loop__issue_8529                                 
    raise EnvironmentError('Catalog Service Provider must be reachable by hostname [irods-catalog-provider]')                                                                                 
OSError: Catalog Service Provider must be reachable by hostname [irods-catalog-provider]                                                                                                      
                                                                                                                                                                                              
----------------------------------------------------------------------
Ran 1 test in 33.726s                                                                          
                                                                                               
FAILED (errors=1)                                                                              
<__main__.RegisteredTestResult run=1 errors=1 failures=0>
```

If I add `irods-catalog-provider` to /etc/hosts, the test passes.
author_association: CONTRIBUTOR
user: login: korydraughn
created_at: 2025-05-23T20:31:35Z
body: This is now ready for squashing if others agree.
author_association: CONTRIBUTOR
user: login: korydraughn
created_at: 2025-05-23T20:46:36Z
body: Squashed.
author_association: CONTRIBUTOR
user: login: korydraughn
created_at: 2025-05-23T20:50:43Z
body: Going to rename the test.
author_association: CONTRIBUTOR
user: login: korydraughn
created_at: 2025-05-23T20:59:43Z
body: Test name updated.

Ready to pound.
author_association: CONTRIBUTOR
user: login: korydraughn
created_at: 2025-05-23T21:07:28Z
body: Added pounds.
author_association: CONTRIBUTOR