The Candlepin service fails in Red Hat Satellite 6 with error "Failed to open TCP connection to localhost:23443 (Connection refused - connect(2) for "localhost" port 23443)"

Solution Verified - Updated

Environment

  • Red Hat Satellite 6

Issue

  • The candlepin and candlepin_auth fails to start on the Satellite server.

    candlepin:        
        Status:          FAIL
        Server Response: Message: Failed to open TCP connection to localhost:23443 (Connection refused - connect(2) for "localhost" port 23443)
    candlepin_auth:   
        Status:          FAIL
        Server Response: Message: A backend service [ Candlepin ] is unreachable
    
  • tomcat service on satellite may also fail with:

       Jun 21 08:31:31 satellite.example.com server[104016]: Error: Could not find or load main class org.apache.catalina.startup.Bootstrap
    Jun 21 08:31:31 satellite.example.com server[104016]: Caused by: java.lang.ClassNotFoundException: org.apache.catalina.startup.Bootstrap
    

Resolution

  • Ensure Satellite is properly tuned as per the following documentation and relevant memory is assigned to it depending upon the number of content hosts registered to Satellite and tasks being performed by Satellite.

  • If the memory utilization was high on the Satellite server at the time of occurrence, as mentioned in the Root Cause section, and there are currently no running tasks, run the installer command and check the service status again.

    # satellite-installer
    # hammer ping
    
  • Incase tomcat service is unable to start with the error mentioned in ISSUE section of this article, make sure the below listed files and directories have similar permissions:

    # ls -ld /usr/share/tomcat/bin
    drwxr-xr-x. 2 root root 76 Mar 20 22:19 /usr/share/tomcat/bin
    
    # ll /usr/share/tomcat/bin
    total 88
    -rw-r--r--. 1 root tomcat 34677 Jun 25  2022 bootstrap.jar
    -rw-r--r--. 1 root tomcat  1664 Jun 25  2022 catalina-tasks.xml
    -rw-r--r--. 1 root root   45807 Jun 25  2022 tomcat-juli.jar
    

For more KB articles/solutions related to Red Hat Satellite 6.x Candlepin Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Candlepin Issues

Root Cause

  • The memory consumption of Red Hat Satellite server is high due to multiple tasks running in the background.

    Total Memory                       : 23.62 GB
    Free Memory                        : 0.19 GB  <---
    Total Swap                         : 7.95 GB
    Free Swap                          : 2.23 GB
    

Diagnostic Steps

  • Identify how much memory is free on Red Hat Satellite server.

    # free -g
    
SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.