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.

Query fetches data forever

See original GitHub issue

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
      }
    ]
  }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
taneliangcommented, 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 --enable-raw-queries?
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).

0reactions
keita-makinocommented, Mar 22, 2020

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

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dealing with mysql fetching forever - Stack Overflow
I have a mysql table with a million records. When i execute a particular query with a limit of 1000 ;. I get...
Read more >
Forever fetching zero-row data frame when query is killed at ...
If the query is killed at server side (e.g. done in MySQL Workbench), the while loop runs forever getting zero-row data frame in...
Read more >
Fetch a query only once until page refresh using React Query
Based on their docs stale queries are re-fetched automatically in the background when:
Read more >
query taking long time to fetch data - Oracle Communities
Among such sql queries there is a sql query which takes around 20 minutes to fetch data from oracle database through the custom...
Read more >
Slow fetch time for MySQL query with large result set
In MySQL Workbench's Duration / Fetch Time columns, the duration stays consistently under 1ms, regardless of the number of rows selected.
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