Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query fetches data forever #1835

Closed
keita-makino opened this issue Mar 14, 2020 · 5 comments
Closed

Query fetches data forever #1835

keita-makino opened this issue Mar 14, 2020 · 5 comments
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. topic: binary

Comments

@keita-makino
Copy link

After upgrading to preview024, my server started not working.
When I have the following models and schema, fetching the data with the query listed correctly returns the response, but after upgrading to the latest version it started fetching data forever (the red square in the playground remains there). I use PostgreSQL 12.

schema.prisma

model Record {
  address String     @default("")
  id      Int        @default(autoincrement()) @id
  lat     Float      @default(0)
  lng     Float      @default(0)
  name    String     @default("")
  type    RecordType
}

schema.ts (with nexus-prisma 0.11.1)

const Record = objectType({
  name: "Record",
  definition(t) {
    t.model.id();
    t.model.lat();
    t.model.lng();
    t.model.address();
    t.model.name();
    t.model.type();
  }
});

server.ts (with apollo-server 2.11.0)

import { ApolloServer } from "apollo-server";
import { schema } from "./schema";
import { createContext } from "./context";

new ApolloServer({ schema, context: createContext }).listen();

query

query {
  users {
    id
  }
}

return with prisma2@preview023

{
  "data": {
    "users": [
      {
        "id": 1
      }
    ]
  }
}
@taneliang
Copy link

taneliang commented Mar 15, 2020

I have the same issue. When run with cross-env DEBUG=*, I get this output:

  engine {
  engine   PRISMA_DML_PATH: 'C:\\Users\\tanel\\Documents\\Dev\\mods4\\api_js_prisma2\\node_modules\\@prisma\\client\\schema.prisma',
  engine   PORT: '56517',
  engine   RUST_BACKTRACE: '1',
  engine   RUST_LOG: 'info',
  engine   LOG_QUERIES: 'true',
  engine   OVERWRITE_DATASOURCES: '[]',
  engine   CLICOLOR_FORCE: '1'
  engine } +0ms
  engine {
  engine   cwd: 'C:\\Users\\tanel\\Documents\\Dev\\mods4\\api_js_prisma2\\prisma'
  engine } +55ms
  plusX Have to call plusX on C:\Users\tanel\Documents\Dev\mods4\api_js_prisma2\node_modules\@prisma\client\runtime\query-engine-windows.exe +0ms
  engine { flags: [ '--enable_raw_queries' ] } +6ms
  engine stderr error: Found argument '--enable_raw_queries' which wasn't expected, or isn't valid in this context +63ms
  engine stderr         Did you mean --enable-raw-queries? +17ms
  engine stderr USAGE: +1ms
  engine stderr     query-engine-windows.exe --enable-raw-queries +1ms
  engine stderr For more information try --help +0ms

This is likely not a Windows-specific issue, as I got a similar output when run on Heroku:

2020-03-15T06:29:59.034591+00:00 app[web.1]: 2020-03-15T06:29:59.034Z engine {
2020-03-15T06:29:59.034592+00:00 app[web.1]:   PRISMA_DML_PATH: '/app/node_modules/@prisma/client/schema.prisma',
2020-03-15T06:29:59.034593+00:00 app[web.1]:   PORT: '33087',
2020-03-15T06:29:59.034594+00:00 app[web.1]:   RUST_BACKTRACE: '1',
2020-03-15T06:29:59.034595+00:00 app[web.1]:   RUST_LOG: 'info',
2020-03-15T06:29:59.034595+00:00 app[web.1]:   OVERWRITE_DATASOURCES: '[]'
2020-03-15T06:29:59.034596+00:00 app[web.1]: }
2020-03-15T06:29:59.034743+00:00 app[web.1]: 2020-03-15T06:29:59.034Z engine { cwd: '/app/prisma' }
2020-03-15T06:29:59.035631+00:00 app[web.1]: 2020-03-15T06:29:59.035Z plusX Execution permissions of /app/node_modules/@prisma/client/runtime/query-engine-debian-openssl-1.1.x are fine
2020-03-15T06:29:59.035917+00:00 app[web.1]: 2020-03-15T06:29:59.035Z engine { flags: [ '--enable_raw_queries' ] }
2020-03-15T06:29:59.050157+00:00 app[web.1]: 2020-03-15T06:29:59.049Z engine stderr error: Found argument '--enable_raw_queries' which wasn't expected, or isn't valid in this context
2020-03-15T06:29:59.050519+00:00 app[web.1]: 2020-03-15T06:29:59.050Z engine stderr 	Did you mean �[32m--�[0m�[32menable-raw-queries�[0m?
2020-03-15T06:29:59.050625+00:00 app[web.1]: 2020-03-15T06:29:59.050Z engine stderr USAGE:
2020-03-15T06:29:59.050727+00:00 app[web.1]: 2020-03-15T06:29:59.050Z engine stderr     query-engine-debian-openssl-1.1.x --enable-raw-queries
2020-03-15T06:29:59.050829+00:00 app[web.1]: 2020-03-15T06:29:59.050Z engine stderr For more information try --help

I suspect it's caused by #1759 missing some occurrences of --enable_raw_queries.

Same output observed with prisma2@alpha (resolves to prisma2@2.0.0-alpha.910).

@taneliang
Copy link

@keita-makino Actually I just managed to fix it by changing the version of @prisma/client in my package.json from ^2.0.0-preview023 to ^2.0.0-preview024. Do you want to try that too?

@pantharshit00
Copy link
Contributor

Hi all,

We indeed renamed an internal binary flag. Can you all please make sure your @prisma/client and prisma2 version are the same and if possible try to use the latest version.

If you are still facing any issues, let me know here.

@pantharshit00 pantharshit00 added bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. topic: binary labels Mar 17, 2020
@janpio
Copy link
Member

janpio commented Mar 17, 2020

Also make sure you are also updating an possibly globally installed prisma2 or use the local one to call generate to avoid any confusion there.

@keita-makino
Copy link
Author

@pantharshit00 It worked with the same versions, thank you!

P.S. I once posted from my personal account... sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. topic: binary
Projects
None yet
Development

No branches or pull requests

4 participants