Prisma1: Prisma server is crashing when querying more than one pgRelation at once

Created on 15 Aug 2018  路  5Comments  路  Source: prisma/prisma1

Describe the bug
As mentioned in the slack channel my Prisma server throws Java exceptions when querying multiple relations with a data model derived through introspect. 馃槃

To Reproduce
I've extracted a self-contained test case with instructions here:
https://github.com/berstend/prisma-relations-bug

image

query {
  titles {
    id
    rating {
      isPopular
    }
    meta {
      releaseYear
    }
  }
}
# querying meta and rating at once will break things

Expected behavior

  • Ideally everything would just work as expected (both rating and meta return data with no exceptions thrown).
  • Neither prisma introspect or prisma deploy did complain about the schema

Versions (please complete the following information):

  • I tried with prisma cli / server versions: 1.13, 1.14-beta, 1.15-alpha
  • 1.12.3 would not use my public schema but always the management one.

Additional context
I don't think this problem is related to an existing issue on GH, but I'm not entirely sure.

Thanks!

bu2-confirmed areconnectopostgres

Most helpful comment

Thanks for reporting and providing thorough descriptions! 馃檹 We fixed this issue and it is available in version 1.15.2 馃帀 . The build will be available in a few minutes.

All 5 comments

Thanks a lot for the amazing bug report @berstend!

I just confirmed it on 1.14.0. We'll look into this next sprint 馃憣

I have an issue that sounds similar:

This works:

query templates(where:
  task: {
    taskGroup: {
      id: "abc"
    }
  }
){
  id
}

But this doesn't:

query templates(where:
  task: {
    taskGroup: {
      session: {
        id: "xyz"
      }
    }
  }
){
  id
}

Error message:

prisma_1 | org.postgresql.util.PSQLException: ERROR: missing FROM-clause entry for table "Session_TaskGroup_Alias"

Things broke when i tried to update to 1.14.0.
Edit: Things are still alright in 1.12.0.

I don't know if this is the same issue, I will try to reproduce it with a minimal example.
Edit: Separate issue here: #2954

Thanks @Jaszkowic, it does look like a separate issue to me! 馃檪

I experience similar error (I even think that it's the same).

@berstend can you confirm that if you check the logs, do you see something like the below?

java.util.concurrent.ExecutionException: Boxed Error
...
Caused by: java.lang.Error: Passed deferreds should not belong to different relations and should not have different arguments.

@marktani I was trying something and then I discovered that it works when I try to execute query similar to the following one (note the extra (where: { id_not: 0 }) in relations):

query {
  titles {
    id
    rating(where: { id_not: 0 }) {
      isPopular
    }
    meta(where: { id_not: 0 }) {
      releaseYear
    }
  }
}

Thanks for reporting and providing thorough descriptions! 馃檹 We fixed this issue and it is available in version 1.15.2 馃帀 . The build will be available in a few minutes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sorenbs picture sorenbs  路  3Comments

tbrannam picture tbrannam  路  3Comments

akoenig picture akoenig  路  3Comments

ragnorc picture ragnorc  路  3Comments

marktani picture marktani  路  3Comments