# Host Aggregates Not Showing Availability Status in UI, Instead Displaying "Hosts are Loading"

## Problem

The Host Aggregates of the clusters displayed the status "Hosts are loading" instead of the expected availability status in the Platform9 UI. High Availability (HA) functionality appeared to be affected.

## Environment

* Platform9 Managed OpenStack - v5.10.1 and Higher
* Component - `pf9-hamgr` on the control plane

## Cause

The `pf9-hamgr` service hit the file descriptor limit, which caused:

* Failure to read certificate files required for operation
* Broken connectivity to the Nova API
* The HA Manager service becoming unresponsive
* CURL requests to HA Manager endpoint returning 502 errors

This results in the UI being unable to retrieve and display the Host Aggregate status properly.

{% hint style="info" %}
**Info**

The following diagnosis, resolution steps involve commands that must be run on the **Platform9 control plane**. Please contact **Platform9 Support** for assistance.
{% endhint %}

## Diagnosis

* From the Management Plane, the `/var/log/pf9/hamgr/hamgr.log` logs showed:

{% tabs %}
{% tab title="Management Plane" %}

```bash
OSError: [Errno 24] Too many open files: '/etc/pf9/hamgr/certs/ca/ca.cert.pem'
Failed to establish a new connection: [Errno 24] Too many open files'
```

{% endtab %}
{% endtabs %}

* The `curl` requests to HA reports below 502 error:

{% tabs %}
{% tab title="Management Plane" %}

```bash
$ curl -kv https://<FQDN>/hamgr/v1/ha
< HTTP/1.1 502 Bad Gateway
```

{% endtab %}
{% endtabs %}

* The `pf9-hamgr-server` process was not listening on the expected port , indicating it had stopped responding:

{% tabs %}
{% tab title="Management Plane" %}

```bash
$ netstat -tulpn | grep <hamgr-process-id>
[no output]
```

{% endtab %}
{% endtabs %}

* Too many open files by hamgr process:

{% tabs %}
{% tab title="Management Plane" %}

```bash
$ lsof -p <hamgr-process-id> | wc -l
648
```

{% endtab %}
{% endtabs %}

## Resolution

Restarting the HA Manager service, resolves the issue:

{% tabs %}
{% tab title="Management Plane" %}

```bash
# systemctl restart pf9-hamgr-server.service
```

{% endtab %}
{% endtabs %}

Post-restart:

* The service resumed listening on port
* Open file descriptors dropped to normal operating levels
* Error logs stopped appearing

## Validation

#### From the Management Plane:

After the restart:

* Verified that `pf9-hamgr-server` is listening on port :

{% tabs %}
{% tab title="Management Plane" %}

```bash
$ netstat -tulpn | grep <hamgr-process-id>
tcp        0      0 0.0.0.0:[PORT-NUMBER]           0.0.0.0:*               LISTEN      [HAMGR-PROCESS-ID]/python
```

{% endtab %}
{% endtabs %}

* Check the number of open files:

{% tabs %}
{% tab title="Management Plane" %}

```bash
$ lsof -p <hamgr-process-id> | wc -l
110
```

{% endtab %}
{% endtabs %}

#### From the UI:

In the UI, the user can verify the resolution by navigating to the **Infrastructure** <i class="fa-angle-double-right">:angle-double-right:</i> **Aggregates**. The aggregates should display the status "**Available**" instead of "**Hosts are loading**".


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://platform9.com/kb/pmo/solution/host-aggregates-showing--hosts-are-loading--in-ui-due-to-file-de.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
