0

prisma db push hangs and then returns

Error: P1017

Server has closed the connection.

and when I look at what it's doing, I see:

SELECT query FROM pg_stat_activity WHERE usename='...';
                                       query
------------------------------------------------------------------------------------
             SELECT t.typname as name, e.enumlabel as value, n.nspname as namespace
             FROM pg_type t
             JOIN pg_enum e ON t.oid = e.enumtypid
             JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace
             WHERE n.nspname = ANY ( $1 )
             ORDER BY e.enumsortorder

The wait_event_type, wait_event, and state columns were Client, ClientRead, and idle, respectively

Why would this query hang, and how can I get it to stop? This is a fly.io Postgres 14.4 database.

Jeffrey Yasskin
  • 5,171
  • 2
  • 27
  • 39
  • How do you know it's hanging? What is the status of that session as shown in `pg_stat_activity`? –  Nov 07 '22 at 06:32
  • It eventually returned `Error: P1017 Server has closed the connection.` instead of completing. The `wait_event_type`, `wait_event`, and `state` columns were 'Client', 'ClientRead', and 'idle', respectively. – Jeffrey Yasskin Nov 08 '22 at 05:16

0 Answers0