# Connection terminated unexpectedly error

**URL:** <https://community.nocodb.com/t/connection-terminated-unexpectedly-error/747>\
**Category:** Uncategorized\
**Created:** [February 9, 2023, 6:33am UTC](https://community.nocodb.com/t/connection-terminated-unexpectedly-error/747 "2023-02-09T06:33:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![damienrts](https://avatars.discourse-cdn.com/v4/letter/d/8baadc/32.png) [@damienrts](https://community.nocodb.com/u/damienrts)\
**Post date:** [February 9, 2023, 6:33am UTC](https://community.nocodb.com/t/connection-terminated-unexpectedly-error/747/1 "2023-02-09T06:33:25Z")

</div>

Hello,

I installed the latest version of NocoDB via Caprover. It uses a Postgres database on the same host.  
If I leave a page opened for a few minutes, then any operation results in the connection error:

 ![2023-02-08 19_37_26-NocoDB - Sidekick](https://canada1.discourse-cdn.com/flex011/uploads/nocodb/original/1X/7e01ff517d62da5c386b1e222cd65e441951e4fd.png)

If I reload the page everything works fine.

Docker for NocoDB:

```auto
docker run 
--name=srv-captain--xxxxxxxxxx.1.74sxxxxxxxxxxxxxxxxb0u8ms 
--hostname=xxxxxxxxxxxx 
--env='NC_DB=pg://server:5432?u=postgres&p=xxxxxxxxxxxxxxxx&d=postgres' 
--env=DATABASE_URL= 
--env=NC_PUBLIC_URL=https://xxxxxxxx.com
--env=NC_AUTH_JWT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
--env=NC_SENTRY_DSN= 
--env=NC_CONNECT_TO_EXTERNAL_DB_DISABLED= 
--env=NC_DISABLE_TELE=1 
--env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 
--env=NC_DOCKER=0.6 
--env=NODE_ENV=production 
--env=PORT=8080 
--env=NC_TOOL_DIR=/usr/app/data/ --workdir=/usr/src/app 
--expose=8080

```

Docker for PG:

```auto
docker run 
--name=srv-captain--xxxxxxxxxxxxx.1.xxxxxxxxxxecwd8erjww8bi4q 
--hostname=xxxxxxxxxxxx 
--env=POSTGRES_USER=postgres 
--env=POSTGRES_PASSWORD=xxxxxxxxxxxxxxxx 
--env=POSTGRES_DB=postgres 
--env=POSTGRES_INITDB_ARGS= 
--env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/postgresql/15/bin 
--env=GOSU_VERSION=1.16 
--env=LANG=en_US.utf8 
--env=PG_MAJOR=15 
--env=PG_VERSION=15.1-1.pgdg110+1 
--env=PGDATA=/var/lib/postgresql/data --volume=/var/lib/postgresql/data 
--expose=5432

```

---

<div class="post-metadata">

**Author:** ![kylee\_nocodb](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@kylee\_nocodb](https://community.nocodb.com/u/kylee_nocodb)\
**Post date:** [February 10, 2023, 10:24pm UTC](https://community.nocodb.com/t/connection-terminated-unexpectedly-error/747/2 "2023-02-10T22:24:01Z")

</div>

Are you able to do any operations within the first few minutes the page is opened?

---

<div class="post-metadata">

**Author:** ![damienrts](https://avatars.discourse-cdn.com/v4/letter/d/8baadc/32.png) [@damienrts](https://community.nocodb.com/u/damienrts)\
**Post date:** [February 10, 2023, 10:26pm UTC](https://community.nocodb.com/t/connection-terminated-unexpectedly-error/747/3 "2023-02-10T22:26:18Z")

</div>

Yes and it looks like if I do something with no pause, everything works fine.

I assume a ‘keep-alive’ value should be set somehow for the PG connection, but I couldn’t find anything about it in the docs.
