Intermittent Prisma Error in Production

Hi there!

I keep getting intermittent prisma errors being sent both on the client and server.

On client: nInvalid prisma.leader.findMany() invocation:\n\n\n write EPIPE"

On server: errorType":“TypeError”,“errorMessage”:"Cannot read property ‘onError’ of undefined

These errors are intermittent and usually only show up on first load, then disappear.

Any thoughts?

Have you checked the deploy log?

Unfortunately this is a known problem with Prisma. More info here RedwoodJS 22.1 and Prisma 12.1 Workaround for Intermittent: write EPIPE error

As @Tobbe notes, this is a known Prisma issue and it has been fixed in 2.15:

But, as of 2.13 Prisma migrate has been completely reworked such that db up and db save are no longer how migrations are managed.

If you cannot take the leap to hot-patch and use 2.15 and handle the new migration flow, downgrading to Prisma 2.11 is an option.

Quick note on how to downgrade to prisma 2.11.0 if you prefer that route:

In your project’s root package.json and in api/package.json add

  "resolutions": {
    "@prisma/client": "2.11.0",
    "@prisma/cli": "2.11.0",
    "@prisma/sdk": "2.11.0"
  }

Then run

yarn

Check your yarn.lock file to make sure @prisma/client is resolved to the correct version. It should look like this:

"@prisma/client@2.11.0", "@prisma/client@2.12.1": // <--- this bit is important
  version "2.11.0"
  resolved "https://registry.yarnpkg.com/@prisma/client/-/client-2.11.0.tgz#574c1aa3b571ea01c0fa8dca348c6ba5db41dcc9"
  integrity sha512-BF7K/yi5fAnrt7MelQqUueJyl06IGmIxf+7f5RxFSvyO6xZMbOYxhW21kV2wt10mOIS0khQbo0xY6w/8jViJuQ==
  dependencies:
    "@prisma/engines-version" "2.11.0-10.58369335532e47bdcec77a2f1e7c1fb83a463918"

I believe the process is the same for upgrading to newer versions, but not something I’ve tested.

Updated: also add cli and sdk to resolutions, just to prevent compatibility issues

1 Like