Prisma: Query Engine does not come back if manually killed

Created on 18 May 2020  Â·  3Comments  Â·  Source: prisma/prisma

I have this:

const express = require('express')
const app = express() 
const port = process.env.PORT || 3000;

// const path = require('path')

const { PrismaClient } = require('@prisma/client')

const prismaPgPlain = new PrismaClient({
  log: ['query', 'info', 'warn'],
  datasources: {
    db: "postgresql://...",
  },
  //forceTransactions: true,
})

app.get('/api/pg-plain', async (req, res) => {
  const products = await prismaPgPlain.product.findMany({ first: 4 })
  res.send(JSON.stringify(products))
})

app.listen(port, () =>
  console.log(`Example app listening at http://localhost:${port}`),
)

When I kill the running query-engine-windows.exe after a few requests, it does not come back and is started again as I expected, but I get this error message:

(node:21416) UnhandledPromiseRejectionWarning: Error:
Invalid `prismaPgPlain.product.findMany()` invocation in
C:\Users\Jan\Documents\throwaway\divyPgBouncer\index.js:18:48

  14   //forceTransactions: true,
  15 })
  16
  17 app.get('/api/pg-plain', async (req,[object Object], res) => {
→ 18   const products = await prismaPgPlain.product.findMany(
Exit code: 1
    at PrismaClientFetcher.request (C:\Users\Jan\Documents\throwaway\divyPgBouncer\node_modules\@prisma\client\runtime\index.js:1:86042)
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
(node:21416) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)

(Beta 5, Windows)

bu2-confirmed kinbug

Most helpful comment

I am marking it as a confirm bug but this can be closed in favor of #2100. But we might also want to separate panic and manually killing the process.

All 3 comments

I am marking it as a confirm bug but this can be closed in favor of #2100. But we might also want to separate panic and manually killing the process.

Since #2100 is this fixed, this is also automatically fixed now. Now if I kill the engine, it restarts and doesn't panic. I am going to close this now

Was this page helpful?
0 / 5 - 0 ratings