# random 502 bad gateway errors with Strapi endpoints - app deployed on Fly.io + postgres database on Supabase

**URL:** <https://community.fly.io/t/random-502-bad-gateway-errors-with-strapi-endpoints-app-deployed-on-fly-io-postgres-database-on-supabase/13791>\
**Category:** Build debugging\
**Tags:** postgres, databases\
**Created:** [June 26, 2023, 6:05pm UTC](https://community.fly.io/t/random-502-bad-gateway-errors-with-strapi-endpoints-app-deployed-on-fly-io-postgres-database-on-supabase/13791 "2023-06-26T18:05:14Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![smorimoto](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/smorimoto/32/16097_2.png) [@smorimoto](https://community.fly.io/u/smorimoto)\
**Post date:** [July 8, 2023, 11:40am UTC](https://community.fly.io/t/random-502-bad-gateway-errors-with-strapi-endpoints-app-deployed-on-fly-io-postgres-database-on-supabase/13791/8 "2023-07-08T11:40:13Z")

</div>

@spiff-radio I’m guessing something similar is probably happening. I’m not very familiar with Supabase, but it’s hard to fundamentally fix problems around here from our side, and I’d recommend the option of continuing to have as few idle connections as possible.

> [@Postgres dropping connection after 30s when using LISTEN/NOTIFY](https://community.fly.io/t/postgres-dropping-connection-after-30s-when-using-listen-notify/12188):
>
> I’m trying out [fly.io](http://fly.io) with a Rails 7 app using Turbo with ActionCable and the [good\_job gem](https://github.com/bensheldon/good_job). I’ve configured both ActionCable and good\_job to use the postgres NOTIFY/LISTEN feature for asynchronous notifications. This worked fine running on Heroku, but switching to [fly.io](http://fly.io) I’m seeing the db connect reset every 60 seconds or so. This might be related to [this topic](https://community.fly.io/t/postgresql-connection-issues-have-returned/6424), but the I’m seeing timeouts of 60 seconds vs 30 minutes. For ActionCable errors I’m getting: `wait\_for\_notify': PQconsumeInput() …

We recently implemented a time-based pool cleanup to address this problem. However, for Strapi I believe that simply setting the minimum to zero is good enough. (We’ve actually been using Strapi recently in a similar situation with everything on Fly.)

---

_[View the full topic](https://community.fly.io/t/random-502-bad-gateway-errors-with-strapi-endpoints-app-deployed-on-fly-io-postgres-database-on-supabase/13791)._
