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

Invalid response data: the query result was required, but an empty Object((Weak)) was returned instead (drupal) #1779

Closed
janpio opened this issue Mar 6, 2020 · 5 comments
Assignees
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: test-utils

Comments

@janpio
Copy link
Member

janpio commented Mar 6, 2020

Schema drupal.

Error:

2020-03-05T16:57:18.899Z prisma-client [
  'mutation {\n' +
    '  createOnelAfOL_block_content_field_data(data: {\n' +
    '    changed: -1623333434\n' +
    '    default_langcode: 472432043\n' +
    '    id: -20715012\n' +
    '    info: "fuhazek"\n' +
    '    langcode: "ribu"\n' +
    '    reusable: 1470101905\n' +
    '    revision_id: 1181686489\n' +
    '    revision_translation_affected: -215804373\n' +
    '    status: 1887633569\n' +
    '    type: "onokan"\n' +
    '  }) {\n' +
    '    changed\n' +
    '    default_langcode\n' +
    '    id\n' +
    '    info\n' +
    '    langcode\n' +
    '    reusable\n' +
    '    revision_id\n' +
    '    revision_translation_affected\n' +
    '    status\n' +
    '    type\n' +
    '  }\n' +
    '}'
]
2020-03-05T16:57:19.463Z engine stdout {
  timestamp: 'Mar 05 16:57:19.463',
  level: 'ERROR',
  target: 'prisma',
  fields: {
    message: 'PANIC',
    reason: 'internal error: entered unreachable code',
    file: 'query-engine/core/src/response_ir/mod.rs',
    line: 281,
    column: 38
  }
}

Model:

model lAfOL_block_content_field_data {
  changed                       Int?
  default_langcode              Int
  id                            Int
  info                          String?
  langcode                      String
  reusable                      Int?
  revision_id                   Int
  revision_translation_affected Int?
  status                        Int
  type                          String

  @@id([id, langcode])
  @@index([id, default_langcode, langcode], name: "block_content__id__default_langcode__langcode")
  @@index([revision_id], name: "block_content__revision_id")
  @@index([status, type, id], name: "block_content__status_type")
  @@index([type], name: "block_content_field__type__target_id")
}

SQL:

CREATE TABLE `lAfOL_block_content_field_data` (
  `id` int(10) unsigned NOT NULL,
  `revision_id` int(10) unsigned NOT NULL,
  `type` varchar(32) CHARACTER SET ascii NOT NULL COMMENT 'The ID of the target entity.',
  `langcode` varchar(12) CHARACTER SET ascii NOT NULL,
  `status` tinyint(4) NOT NULL,
  `info` varchar(255) DEFAULT NULL,
  `changed` int(11) DEFAULT NULL,
  `reusable` tinyint(4) DEFAULT NULL,
  `default_langcode` tinyint(4) NOT NULL,
  `revision_translation_affected` tinyint(4) DEFAULT NULL,
  PRIMARY KEY (`id`,`langcode`),
  KEY `block_content__id__default_langcode__langcode` (`id`,`default_langcode`,`langcode`),
  KEY `block_content__revision_id` (`revision_id`),
  KEY `block_content_field__type__target_id` (`type`),
  KEY `block_content__status_type` (`status`,`type`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='The data table for block_content entities.';
@pantharshit00
Copy link
Contributor

Can you also paste the client call? It is hard to infer that from the error 🙏

@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. labels Mar 6, 2020
@janpio janpio added this to the Preview 24 New milestone Mar 6, 2020
@janpio
Copy link
Member Author

janpio commented Mar 6, 2020

Per @divyenduz it is not, the mutation pretty much matches 1 to 1.

But no, I can not without rewriting it myself as it was not logged when we created this. The current alpha should log the calls now, so when @divyenduz is back he can recreate the run and the output and update the above.

@pantharshit00
Copy link
Contributor

pantharshit00 commented Mar 6, 2020

Ok, I was just asking because that would have saved me from manual work.

I tried to reproduce this with prisma2@2.0.0-preview023, binary version: d3b0ceed5d87544b9d2decb70e08664f9047bb73 and it threw:

prisma:query BEGIN
  engine stdout {
  timestamp: 'Mar 06 23:13:41.369',
  level: 'INFO',
  target: 'quaint::connector::metrics',
  fields: {
    query: 'INSERT INTO `issue_17790`.`lAfOL_block_content_field_data` (`changed`,`default_langcode`,`id`,`info`,`langcode`,`reusable`,`revision_id`,`revision_translation_affected`,`status`,`type`) VALUES (?,?,?,?,?,?,?,?,?,?)',
    item_type: 'query',
    params: '[-1623333434,472432043,-20715012,"fuhazek","ribu",1470101905,1181686489,-215804373,1887633569,"onokan"]',
    duration_ms: 2
  }
} +3ms
prisma:query INSERT INTO `issue_17790`.`lAfOL_block_content_field_data` (`changed`,`default_langcode`,`id`,`info`,`langcode`,`reusable`,`revision_id`,`revision_translation_affected`,`status`,`type`) VALUES (?,?,?,?,?,?,?,?,?,?)
  engine stdout {
  timestamp: 'Mar 06 23:13:41.369',
  level: 'INFO',
  target: 'quaint::connector::metrics',
  fields: {
    query: 'ROLLBACK',
    item_type: 'query',
    params: '[]',
    duration_ms: 0
  }
} +0ms
prisma:query ROLLBACK
  prisma-client Results: +20ms
  prisma-client [
  prisma-client   PrismaClientUnknownRequestError: Error occurred during query execution:
  prisma-client   ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Server(ServerError { code: 1264, message: "Out of range value for column \'default_langcode\' at row 1", state: "22003" })) })
  prisma-client       at NodeEngine.graphQLToJSError (/Users/harshit/code/reproductions/issue-1779/node_modules/@prisma/client/runtime/index.js:1:17737)
  prisma-client       at /Users/harshit/code/reproductions/issue-1779/node_modules/@prisma/client/runtime/index.js:1:16671
  prisma-client       at Array.map (<anonymous>)
  prisma-client       at /Users/harshit/code/reproductions/issue-1779/node_modules/@prisma/client/runtime/index.js:1:16638
  prisma-client       at processTicksAndRejections (internal/process/task_queues.js:94:5)
  prisma-client       at Dataloader.loader (/Users/harshit/code/reproductions/issue-1779/node_modules/@prisma/client/index.js:56:23)
  prisma-client ] +1ms
  prisma-client Error: Error occurred during query execution:
  prisma-client ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Server(ServerError { code: 1264, message: "Out of range value for column \'default_langcode\' at row 1", state: "22003" })) })
  prisma-client     at NodeEngine.graphQLToJSError (/Users/harshit/code/reproductions/issue-1779/node_modules/@prisma/client/runtime/index.js:1:17737)
  prisma-client     at /Users/harshit/code/reproductions/issue-1779/node_modules/@prisma/client/runtime/index.js:1:16671
  prisma-client     at Array.map (<anonymous>)
  prisma-client     at /Users/harshit/code/reproductions/issue-1779/node_modules/@prisma/client/runtime/index.js:1:16638
  prisma-client     at processTicksAndRejections (internal/process/task_queues.js:94:5)
  prisma-client     at Dataloader.loader (/Users/harshit/code/reproductions/issue-1779/node_modules/@prisma/client/index.js:56:23) +2ms
  printStack callsite Error
    at new lAfOL_block_content_field_dataClient (/Users/harshit/code/reproductions/issue-1779/node_modules/@prisma/client/index.js:593:21)
    at Object.lAfOL_block_content_field_data.create (/Users/harshit/code/reproductions/issue-1779/node_modules/@prisma/client/index.js:475:7)
    at /Users/harshit/code/reproductions/issue-1779/index.ts:48:84
    at step (/Users/harshit/code/reproductions/issue-1779/index.ts:33:23)
    at Object.next (/Users/harshit/code/reproductions/issue-1779/index.ts:14:53)
    at /Users/harshit/code/reproductions/issue-1779/index.ts:8:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/harshit/code/reproductions/issue-1779/index.ts:4:12)
    at main (/Users/harshit/code/reproductions/issue-1779/index.ts:44:12)
    at Object.<anonymous> (/Users/harshit/code/reproductions/issue-1779/index.ts:70:1) +0ms
(node:29013) UnhandledPromiseRejectionWarning: Error:
Invalid `prisma.lAfOL_block_content_field_data.create()` invocation:

Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Server(ServerError { code: 1264, message: "Out of range value for column \'default_langcode\' at row 1", state: "22003" })) })
    at PrismaClientFetcher.request (/Users/harshit/code/reproductions/issue-1779/node_modules/@prisma/client/index.js:90:17)
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
(node:29013) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:29013) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
^C

Client call:

import { PrismaClient } from "@prisma/client";

const prisma = new PrismaClient({
  log: ["info", "query"]
});

async function main() {
  const data = await prisma.lAfOL_block_content_field_data.create({
    data: {
      changed: -1623333434,
      default_langcode: 472432043,
      id: -20715012,
      info: "fuhazek",
      langcode: "ribu",
      reusable: 1470101905,
      revision_id: 1181686489,
      revision_translation_affected: -215804373,
      status: 1887633569,
      type: "onokan"
    }
  });
  console.log(data);
}

main();

I wasn't able to test with current alpha 880 as it is broken because of flag renaming:

image

I am marking this as confirmed as it threw a different error

@janpio
Copy link
Member Author

janpio commented Mar 6, 2020

Ok, I was just asking because that would have saved me from manual work.

I would have provided it if it existed - but this a dynamically generated script.

The different error is interesting - lets see if @tom can reproduce the original error next week (or @divyenduz on the next run via test-utils automation, with the current alpha).

@janpio janpio changed the title PANIC: internal error: entered unreachable code (drupal) Invalid response data: the query result was required, but an empty Object((Weak)) was returned instead (drupal) Mar 11, 2020
@janpio
Copy link
Member Author

janpio commented Mar 11, 2020

Recreated issue clean here: #1823

@janpio janpio closed this as completed Mar 11, 2020
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: test-utils
Projects
None yet
Development

No branches or pull requests

3 participants