question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pgbouncer=true flag not working as expected with a relation and enums on both sides of the relations

See original GitHub issue

Bug description

Related thread https://github.com/prisma/prisma-client-js/issues/651#issuecomment-652439460

Using DigitalOcean Connection Pools Screenshot 2020-07-01 at 15 09 17

Connection String

postgresql://xxxxxxx:xxxxxxx@xxxxxxx:25061/Pool?sslmode=require&pgbouncer=true&schema=xxxxx

How to reproduce

  • Create new DO managed postgres db
  • Deploy Prisma schema (without pgbouncer)
  • Add connection pool
  • Connect using the connection pool string above (with pgbouncer)
  • Run app/prisma studio - execute 3 or 4 actions

Results in this error:

Error: Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Error { kind: Db, cause: Some(DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState("26000"), message: "prepared statement \"s162\" does not exist", detail: None, hint: None, position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("prepare.c"), line: Some(512), routine: Some("FetchPreparedStatement") }) }) })
   at PrismaClientFetcher.request (/Users/aaron/.cache/prisma/studio/Users-aaron-Desktop-Ember/runtime/index.js:1:185866)
   at processTicksAndRejections (internal/process/task_queues.js:97:5)

Prisma information

Fairly large schema (can’t share specifics) Using nexus/schema (although reproducible in prisma studio also)

Environment & setup

  • OS: Mac OS
  • Database: PostgreSQL
  • Prisma version: 2.1.3
  • Node.js version: 12.16.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
divyenduzcommented, Jul 2, 2020

Thank you @aarshaw for sharing the schema based on the information we were able to create an isolated minimal reproduction: https://github.com/divyendu-test/prisma-2907

This has something to do with a relation and enums on both sides of the relations used in conjunction with pgbouncer.

Related issue: https://github.com/prisma/prisma/issues/2921

1reaction
divyenduzcommented, Jul 2, 2020

Thank you, is it possible for you to share your schema and some seed data at schemas@prisma.io. We are happy to sign an NDA if you want. With that, a minimal reproduction would be much easier for us.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flags Enum.HasFlag not Working as Expected for Multiple bit ...
I suggest that you eschew HasFlag and just do it directly using bit operations: var myFilteredListMultiple = MyMainList.Where(w => (w.
Read more >
How To Use Enums in TypeScript - DigitalOcean
Using Bit Flags with TypeScript Enums​​ Bit flags are a way to represent different boolean-like options into a single variable, by using bitwise ......
Read more >
Enum Mappings with Hibernate - The Complete Guide
Let me show you how to use Hibernate's standard enum mappings, create a flexible, custom mapping and map db-specific enum types.
Read more >
Build Enumerations of Constants With Python's Enum
In this tutorial, you'll learn how to: Create enumerations of constants using Python's Enum class; Work with enumerations and their members in ...
Read more >
Enum, Flags and bitwise operators - Alan Zucconi
What if we are using a melee weapon with a fire attack (a fire sword?!)? To solve this problem, enums can be decorated...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found