# 504 Gateway Time-out Err

**URL:** <https://forum.mautic.org/t/504-gateway-time-out-err/22713>\
**Category:** Product Support\
**Created:** [February 15, 2022, 12:38am UTC](https://forum.mautic.org/t/504-gateway-time-out-err/22713 "2022-02-15T00:38:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rankinit](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rankinit/32/412_2.png) [@rankinit](https://forum.mautic.org/u/rankinit)\
**Post date:** [February 15, 2022, 12:38am UTC](https://forum.mautic.org/t/504-gateway-time-out-err/22713/1 "2022-02-15T00:38:08Z")

</div>

My Mautic version is: 4.1.2  
My PHP version is: 7.4.27  
My Database type and version is: mysql 5.7.35-38-log (mysql) Percona Server

My problem is: Everytime I login I get a 504 gateway timeout issue

These errors are showing in the log: I don’t see any in mautic.. but I do see this slow query in the database:

# Time: 2022-02-15T00:34:16.422342Z

# Schema: mauticdbtwo Last\_errno: 0 Killed: 0

# Query\_time: 10.900411 Lock\_time: 0.000243 Rows\_sent: 4 Rows\_examined: 1608254 Rows\_affected: 0 Bytes\_sent: 1112

SET timestamp=1644885256;  
SELECT ll.event\_id,  
ll.campaign\_id,  
ll.trigger\_date,  
ll.lead\_id,  
e.name AS event\_name,  
e.description AS event\_description,  
c.name AS campaign\_name,  
c.description AS campaign\_description,  
ll.metadata,  
CONCAT(CONCAT(l.firstname, ’ '), l.lastname) AS lead\_name FROM campaign\_lead\_event\_log ll LEFT JOIN campaign\_events e ON e.id = ll.event\_id LEFT JOIN campaigns c ON c.id = e.campaign\_id LEFT JOIN leads l ON l.id = ll.lead\_id WHERE (ll.is\_scheduled = 1) AND (e.type = ‘email.send’) ORDER BY ll.trigger\_date ASC LIMIT 4;

Steps I have tried to fix the problem: I have increase timeout on nginx and php-fpm.. but honestly this does not seem like any solution … it is just slow on the first load.

---

<div class="post-metadata">

**Author:** ![raramuridesign](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raramuridesign/32/13226_2.png) [@raramuridesign](https://forum.mautic.org/u/raramuridesign)\
**Post date:** [February 15, 2022, 7:37am UTC](https://forum.mautic.org/t/504-gateway-time-out-err/22713/2 "2022-02-15T07:37:41Z")

</div>

@rankinit  
Did you create a custom dashboard with a query on a custom field?

You should try to login and then go here  
[https://domain.com/s/contacts](https://domain.com/s/contacts) Which is the direct link to the contacts.  
See if this loads, if yes, then you have an issue with the dashboard.

You can then try to remove the widgets on the dashboard via the database, so you can access the dashboard normally.

The above assumes you can get to the contacts link.  
M

---

<div class="post-metadata">

**Author:** ![rankinit](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rankinit/32/412_2.png) [@rankinit](https://forum.mautic.org/u/rankinit)\
**Post date:** [February 15, 2022, 3:50pm UTC](https://forum.mautic.org/t/504-gateway-time-out-err/22713/3 "2022-02-15T15:50:40Z")

</div>

/s/contacts loads fast. So it is something with the dashboard. I don’t remember creating a custom dash but I have had mautic since 2.x version so that is a possibility.

I went ahead and cut down my widgets to only 5 on dashboard:

- Contacts Created
- Emails Sent opened
- Ignored opened emails
- upcoming emails
- top lists

But the 504 error persists.

Even if its an issue with too many widgets why can’t Mautic load the dashboard asynchronous to alleviate these timeout issues?

---

<div class="post-metadata">

**Author:** ![raramuridesign](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raramuridesign/32/13226_2.png) [@raramuridesign](https://forum.mautic.org/u/raramuridesign)\
**Post date:** [February 16, 2022, 3:09pm UTC](https://forum.mautic.org/t/504-gateway-time-out-err/22713/4 "2022-02-16T15:09:56Z")

</div>

@rankinit In the past our issue was a custom field which we then removed or changed which was part of the reporting on the dashboard. This caused an issue when these were removed, ie the fields.

I would suggest you remove all widgets.

With regards to the loading, submit an issue on Github.  
M.
