# Applications Failing With Error "504 Gateway Timeout

## Problem

Ingress controller logs shows a gateway timeout error.

{% tabs %}
{% tab title="None" %}

```none
time="YYYY-YYY-YYTXX:XX:XXZ" level=debug msg="'504 Gateway Timeout' caused by: dial tcp X.X.X.X:YY: i/o timeout"
```

{% endtab %}
{% endtabs %}

## Environment

* Platform9 Managed Kubernetes - All Versions

## Cause

* The flannel container is not able to connect to the *etcd* database to obtain network configuration because port 4001 is blocked by Security Groups on the master nodes.
* The following errors will be logged by the flannel container.

{% tabs %}
{% tab title="None" %}

```none
3261621 main.go:349] Couldn't fetch network config: client: etcd cluster is unavailable or misconfigured; error #0: dial tcp X.X.X.X:YYYY: i/o timeouttimed out
3266981 main.go:349] Couldn't fetch network config: client: etcd cluster is unavailable or misconfigured; error #0: dial tcp X.X.X.X:YYYY: i/o timeouttimed out
```

{% endtab %}
{% endtabs %}

## Resolution

Edit the Security Groups for the master node to **allow traffic on port 4001**.


---

# 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/pmk/solutions/applications-failing-with-error-504-gateway-timeout.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.
