Prisma1: Cryptic error message in resolvers

Created on 30 Sep 2017  路  3Comments  路  Source: prisma/prisma1

What is the current behavior?

Invoking a specific resolver results in a cryptic error message.

Please share the relevant part of your project (GraphQL schema, functions, permissions, ...) for easier reproduction

Create a new resolver as follows:

type SignupEmailUserPayload {
  id: ID!
}

extend type Mutation {
  signupEmailUser(email: String!, password: String!): SignupEmailUserPayload
}
const fromEvent = require('graphcool-lib').fromEvent

module.exports = function sum(event) {
  const graphcool = fromEvent(event)
  const api = graphcool.api('somewrongstuff')

return api.request(`
    query {
      User(email: "abc") {
        id
      }
    }`)
      .then((userQueryResult) => {
        if (userQueryResult.error) {
          return Promise.reject(userQueryResult.error)
        } else {
          return userQueryResult.User
        }
      })
}

If applicable, share the query, mutation or subscription for reproduction

mutation {
  signupEmailUser(email: "some", password: "password") {
    id
  }
}

You'll receive this error message:

"message": "A function returned an unhandled error. Please check the logs for executionId 'eu-west-1:simple:cj87ka3p9u2c10179otb211dx'"

This is the function log:

"Function returned invalid status code: 400. Raw body: {\n \"code\": 400,\n \"error\": \"Script returned an error.\",\n \"details\": \"Error: GraphQL Error (Code: 503): {\\"response\\":{\\"0\\":\\"<\\",\\"1\\":\\"h\\",\\"2\\":\\"t\\",\\"3\\":\\"m\\",\\"4\\":\\"l\\",\\"5\\":\\">\\",\\"6\\":\\"\\r\\",\\"7\\":\\"\\n\\",\\"8\\":\\"<\\",\\"9\\":\\"h\\",\\"10\\":\\"e\\",\\"11\\":\\"a\\",\\"12\\":\\"d\\",\\"13\\":\\">\\",\\"14\\":\\"<\\",\\"15\\":\\"t\\",\\"16\\":\\"i\\",\\"17\\":\\"t\\",\\"18\\":\\"l\\",\\"19\\":\\"e\\",\\"20\\":\\">\\",\\"21\\":\\"5\\",\\"22\\":\\"0\\",\\"23\\":\\"3\\",\\"24\\":\\" \\",\\"25\\":\\"S\\",\\"26\\":\\"e\\",\\"27\\":\\"r\\",\\"28\\":\\"v\\",\\"29\\":\\"i\\",\\"30\\":\\"c\\",\\"31\\":\\"e\\",\\"32\\":\\" \\",\\"33\\":\\"T\\",\\"34\\":\\"e\\",\\"35\\":\\"m\\",\\"36\\":\\"p\\",\\"37\\":\\"o\\",\\"38\\":\\"r\\",\\"39\\":\\"a\\",\\"40\\":\\"r\\",\\"41\\":\\"i\\",\\"42\\":\\"l\\",\\"43\\":\\"y\\",\\"44\\":\\" \\",\\"45\\":\\"U\\",\\"46\\":\\"n\\",\\"47\\":\\"a\\",\\"48\\":\\"v\\",\\"49\\":\\"a\\",\\"50\\":\\"i\\",\\"51\\":\\"l\\",\\"52\\":\\"a\\",\\"53\\":\\"b\\",\\"54\\":\\"l\\",\\"55\\":\\"e\\",\\"56\\":\\"<\\",\\"57\\":\\"/\\",\\"58\\":\\"t\\",\\"59\\":\\"i\\",\\"60\\":\\"t\\",\\"61\\":\\"l\\",\\"62\\":\\"e\\",\\"63\\":\\">\\",\\"64\\":\\"<\\",\\"65\\":\\"/\\",\\"66\\":\\"h\\",\\"67\\":\\"e\\",\\"68\\":\\"a\\",\\"69\\":\\"d\\",\\"70\\":\\">\\",\\"71\\":\\"\\r\\",\\"72\\":\\"\\n\\",\\"73\\":\\"<\\",\\"74\\":\\"b\\",\\"75\\":\\"o\\",\\"76\\":\\"d\\",\\"77\\":\\"y\\",\\"78\\":\\" \\",\\"79\\":\\"b\\",\\"80\\":\\"g\\",\\"81\\":\\"c\\",\\"82\\":\\"o\\",\\"83\\":\\"l\\",\\"84\\":\\"o\\",\\"85\\":\\"r\\",\\"86\\":\\"=\\",\\"87\\":\\"\\\\"\\",\\"88\\":\\"w\\",\\"89\\":\\"h\\",\\"90\\":\\"i\\",\\"91\\":\\"t\\",\\"92\\":\\"e\\",\\"93\\":\\"\\\\"\\",\\"94\\":\\">\\",\\"95\\":\\"\\r\\",\\"96\\":\\"\\n\\",\\"97\\":\\"<\\",\\"98\\":\\"c\\",\\"99\\":\\"e\\",\\"100\\":\\"n\\",\\"101\\":\\"t\\",\\"102\\":\\"e\\",\\"103\\":\\"r\\",\\"104\\":\\">\\",\\"105\\":\\"<\\",\\"106\\":\\"h\\",\\"107\\":\\"1\\",\\"108\\":\\">\\",\\"109\\":\\"5\\",\\"110\\":\\"0\\",\\"111\\":\\"3\\",\\"112\\":\\" \\",\\"113\\":\\"S\\",\\"114\\":\\"e\\",\\"115\\":\\"r\\",\\"116\\":\\"v\\",\\"117\\":\\"i\\",\\"118\\":\\"c\\",\\"119\\":\\"e\\",\\"120\\":\\" \\",\\"121\\":\\"T\\",\\"122\\":\\"e\\",\\"123\\":\\"m\\",\\"124\\":\\"p\\",\\"125\\":\\"o\\",\\"126\\":\\"r\\",\\"127\\":\\"a\\",\\"128\\":\\"r\\",\\"129\\":\\"i\\",\\"130\\":\\"l\\",\\"131\\":\\"y\\",\\"132\\":\\" \\",\\"133\\":\\"U\\",\\"134\\":\\"n\\",\\"135\\":\\"a\\",\\"136\\":\\"v\\",\\"137\\":\\"a\\",\\"138\\":\\"i\\",\\"139\\":\\"l\\",\\"140\\":\\"a\\",\\"141\\":\\"b\\",\\"142\\":\\"l\\",\\"143\\":\\"e\\",\\"144\\":\\"<\\",\\"145\\":\\"/\\",\\"146\\":\\"h\\",\\"147\\":\\"1\\",\\"148\\":\\">\\",\\"149\\":\\"<\\",\\"150\\":\\"/\\",\\"151\\":\\"c\\",\\"152\\":\\"e\\",\\"153\\":\\"n\\",\\"154\\":\\"t\\",\\"155\\":\\"e\\",\\"156\\":\\"r\\",\\"157\\":\\">\\",\\"158\\":\\"\\r\\",\\"159\\":\\"\\n\\",\\"160\\":\\"<\\",\\"161\\":\\"/\\",\\"162\\":\\"b\\",\\"163\\":\\"o\\",\\"164\\":\\"d\\",\\"165\\":\\"y\\",\\"166\\":\\">\\",\\"167\\":\\"\\r\\",\\"168\\":\\"\\n\\",\\"169\\":\\"<\\",\\"170\\":\\"/\\",\\"171\\":\\"h\\",\\"172\\":\\"t\\",\\"173\\":\\"m\\",\\"174\\":\\"l\\",\\"175\\":\\">\\",\\"176\\":\\"\\r\\",\\"177\\":\\"\\n\\",\\"status\\":503},\\"request\\":{\\"query\\":\\"\\n query {\\n User(email: \\\\"abc\\\\") {\\n id\\n }\\n }\\"}}\",\n \"name\": \"Error\",\n \"message\": \"GraphQL Error (Code: 503): {\\"response\\":{\\"0\\":\\"<\\",\\"1\\":\\"h\\",\\"2\\":\\"t\\",\\"3\\":\\"m\\",\\"4\\":\\"l\\",\\"5\\":\\">\\",\\"6\\":\\"\\r\\",\\"7\\":\\"\\n\\",\\"8\\":\\"<\\",\\"9\\":\\"h\\",\\"10\\":\\"e\\",\\"11\\":\\"a\\",\\"12\\":\\"d\\",\\"13\\":\\">\\",\\"14\\":\\"<\\",\\"15\\":\\"t\\",\\"16\\":\\"i\\",\\"17\\":\\"t\\",\\"18\\":\\"l\\",\\"19\\":\\"e\\",\\"20\\":\\">\\",\\"21\\":\\"5\\",\\"22\\":\\"0\\",\\"23\\":\\"3\\",\\"24\\":\\" \\",\\"25\\":\\"S\\",\\"26\\":\\"e\\",\\"27\\":\\"r\\",\\"28\\":\\"v\\",\\"29\\":\\"i\\",\\"30\\":\\"c\\",\\"31\\":\\"e\\",\\"32\\":\\" \\",\\"33\\":\\"T\\",\\"34\\":\\"e\\",\\"35\\":\\"m\\",\\"36\\":\\"p\\",\\"37\\":\\"o\\",\\"38\\":\\"r\\",\\"39\\":\\"a\\",\\"40\\":\\"r\\",\\"41\\":\\"i\\",\\"42\\":\\"l\\",\\"43\\":\\"y\\",\\"44\\":\\" \\",\\"45\\":\\"U\\",\\"46\\":\\"n\\",\\"47\\":\\"a\\",\\"48\\":\\"v\\",\\"49\\":\\"a\\",\\"50\\":\\"i\\",\\"51\\":\\"l\\",\\"52\\":\\"a\\",\\"53\\":\\"b\\",\\"54\\":\\"l\\",\\"55\\":\\"e\\",\\"56\\":\\"<\\",\\"57\\":\\"/\\",\\"58\\":\\"t\\",\\"59\\":\\"i\\",\\"60\\":\\"t\\",\\"61\\":\\"l\\",\\"62\\":\\"e\\",\\"63\\":\\">\\",\\"64\\":\\"<\\",\\"65\\":\\"/\\",\\"66\\":\\"h\\",\\"67\\":\\"e\\",\\"68\\":\\"a\\",\\"69\\":\\"d\\",\\"70\\":\\">\\",\\"71\\":\\"\\r\\",\\"72\\":\\"\\n\\",\\"73\\":\\"<\\",\\"74\\":\\"b\\",\\"75\\":\\"o\\",\\"76\\":\\"d\\",\\"77\\":\\"y\\",\\"78\\":\\" \\",\\"79\\":\\"b\\",\\"80\\":\\"g\\",\\"81\\":\\"c\\",\\"82\\":\\"o\\",\\"83\\":\\"l\\",\\"84\\":\\"o\\",\\"85\\":\\"r\\",\\"86\\":\\"=\\",\\"87\\":\\"\\\\"\\",\\"88\\":\\"w\\",\\"89\\":\\"h\\",\\"90\\":\\"i\\",\\"91\\":\\"t\\",\\"92\\":\\"e\\",\\"93\\":\\"\\\\"\\",\\"94\\":\\">\\",\\"95\\":\\"\\r\\",\\"96\\":\\"\\n\\",\\"97\\":\\"<\\",\\"98\\":\\"c\\",\\"99\\":\\"e\\",\\"100\\":\\"n\\",\\"101\\":\\"t\\",\\"102\\":\\"e\\",\\"103\\":\\"r\\",\\"104\\":\\">\\",\\"105\\":\\"<\\",\\"106\\":\\"h\\",\\"107\\":\\"1\\",\\"108\\":\\">\\",\\"109\\":\\"5\\",\\"110\\":\\"0\\",\\"111\\":\\"3\\",\\"112\\":\\" \\",\\"113\\":\\"S\\",\\"114\\":\\"e\\",\\"115\\":\\"r\\",\\"116\\":\\"v\\",\\"117\\":\\"i\\",\\"118\\":\\"c\\",\\"119\\":\\"e\\",\\"120\\":\\" \\",\\"121\\":\\"T\\",\\"122\\":\\"e\\",\\"123\\":\\"m\\",\\"124\\":\\"p\\",\\"125\\":\\"o\\",\\"126\\":\\"r\\",\\"127\\":\\"a\\",\\"128\\":\\"r\\",\\"129\\":\\"i\\",\\"130\\":\\"l\\",\\"131\\":\\"y\\",\\"132\\":\\" \\",\\"133\\":\\"U\\",\\"134\\":\\"n\\",\\"135\\":\\"a\\",\\"136\\":\\"v\\",\\"137\\":\\"a\\",\\"138\\":\\"i\\",\\"139\\":\\"l\\",\\"140\\":\\"a\\",\\"141\\":\\"b\\",\\"142\\":\\"l\\",\\"143\\":\\"e\\",\\"144\\":\\"<\\",\\"145\\":\\"/\\",\\"146\\":\\"h\\",\\"147\\":\\"1\\",\\"148\\":\\">\\",\\"149\\":\\"<\\",\\"150\\":\\"/\\",\\"151\\":\\"c\\",\\"152\\":\\"e\\",\\"153\\":\\"n\\",\\"154\\":\\"t\\",\\"155\\":\\"e\\",\\"156\\":\\"r\\",\\"157\\":\\">\\",\\"158\\":\\"\\r\\",\\"159\\":\\"\\n\\",\\"160\\":\\"<\\",\\"161\\":\\"/\\",\\"162\\":\\"b\\",\\"163\\":\\"o\\",\\"164\\":\\"d\\",\\"165\\":\\"y\\",\\"166\\":\\">\\",\\"167\\":\\"\\r\\",\\"168\\":\\"\\n\\",\\"169\\":\\"<\\",\\"170\\":\\"/\\",\\"171\\":\\"h\\",\\"172\\":\\"t\\",\\"173\\":\\"m\\",\\"174\\":\\"l\\",\\"175\\":\\">\\",\\"176\\":\\"\\r\\",\\"177\\":\\"\\n\\",\\"status\\":503},\\"request\\":{\\"query\\":\\"\\n query {\\n User(email: \\\\"abc\\\\") {\\n id\\n }\\n }\\"}}\",\n \"stack\": \"Error: GraphQL Error (Code: 503): {\\"response\\":{\\"0\\":\\"<\\",\\"1\\":\\"h\\",\\"2\\":\\"t\\",\\"3\\":\\"m\\",\\"4\\":\\"l\\",\\"5\\":\\">\\",\\"6\\":\\"\\r\\",\\"7\\":\\"\\n\\",\\"8\\":\\"<\\",\\"9\\":\\"h\\",\\"10\\":\\"e\\",\\"11\\":\\"a\\",\\"12\\":\\"d\\",\\"13\\":\\">\\",\\"14\\":\\"<\\",\\"15\\":\\"t\\",\\"16\\":\\"i\\",\\"17\\":\\"t\\",\\"18\\":\\"l\\",\\"19\\":\\"e\\",\\"20\\":\\">\\",\\"21\\":\\"5\\",\\"22\\":\\"0\\",\\"23\\":\\"3\\",\\"24\\":\\" \\",\\"25\\":\\"S\\",\\"26\\":\\"e\\",\\"27\\":\\"r\\",\\"28\\":\\"v\\",\\"29\\":\\"i\\",\\"30\\":\\"c\\",\\"31\\":\\"e\\",\\"32\\":\\" \\",\\"33\\":\\"T\\",\\"34\\":\\"e\\",\\"35\\":\\"m\\",\\"36\\":\\"p\\",\\"37\\":\\"o\\",\\"38\\":\\"r\\",\\"39\\":\\"a\\",\\"40\\":\\"r\\",\\"41\\":\\"i\\",\\"42\\":\\"l\\",\\"43\\":\\"y\\",\\"44\\":\\" \\",\\"45\\":\\"U\\",\\"46\\":\\"n\\",\\"47\\":\\"a\\",\\"48\\":\\"v\\",\\"49\\":\\"a\\",\\"50\\":\\"i\\",\\"51\\":\\"l\\",\\"52\\":\\"a\\",\\"53\\":\\"b\\",\\"54\\":\\"l\\",\\"55\\":\\"e\\",\\"56\\":\\"<\\",\\"57\\":\\"/\\",\\"58\\":\\"t\\",\\"59\\":\\"i\\",\\"60\\":\\"t\\",\\"61\\":\\"l\\",\\"62\\":\\"e\\",\\"63\\":\\">\\",\\"64\\":\\"<\\",\\"65\\":\\"/\\",\\"66\\":\\"h\\",\\"67\\":\\"e\\",\\"68\\":\\"a\\",\\"69\\":\\"d\\",\\"70\\":\\">\\",\\"71\\":\\"\\r\\",\\"72\\":\\"\\n\\",\\"73\\":\\"<\\",\\"74\\":\\"b\\",\\"75\\":\\"o\\",\\"76\\":\\"d\\",\\"77\\":\\"y\\",\\"78\\":\\" \\",\\"79\\":\\"b\\",\\"80\\":\\"g\\",\\"81\\":\\"c\\",\\"82\\":\\"o\\",\\"83\\":\\"l\\",\\"84\\":\\"o\\",\\"85\\":\\"r\\",\\"86\\":\\"=\\",\\"87\\":\\"\\\\"\\",\\"88\\":\\"w\\",\\"89\\":\\"h\\",\\"90\\":\\"i\\",\\"91\\":\\"t\\",\\"92\\":\\"e\\",\\"93\\":\\"\\\\"\\",\\"94\\":\\">\\",\\"95\\":\\"\\r\\",\\"96\\":\\"\\n\\",\\"97\\":\\"<\\",\\"98\\":\\"c\\",\\"99\\":\\"e\\",\\"100\\":\\"n\\",\\"101\\":\\"t\\",\\"102\\":\\"e\\",\\"103\\":\\"r\\",\\"104\\":\\">\\",\\"105\\":\\"<\\",\\"106\\":\\"h\\",\\"107\\":\\"1\\",\\"108\\":\\">\\",\\"109\\":\\"5\\",\\"110\\":\\"0\\",\\"111\\":\\"3\\",\\"112\\":\\" \\",\\"113\\":\\"S\\",\\"114\\":\\"e\\",\\"115\\":\\"r\\",\\"116\\":\\"v\\",\\"117\\":\\"i\\",\\"118\\":\\"c\\",\\"119\\":\\"e\\",\\"120\\":\\" \\",\\"121\\":\\"T\\",\\"122\\":\\"e\\",\\"123\\":\\"m\\",\\"124\\":\\"p\\",\\"125\\":\\"o\\",\\"126\\":\\"r\\",\\"127\\":\\"a\\",\\"128\\":\\"r\\",\\"129\\":\\"i\\",\\"130\\":\\"l\\",\\"131\\":\\"y\\",\\"132\\":\\" \\",\\"133\\":\\"U\\",\\"134\\":\\"n\\",\\"135\\":\\"a\\",\\"136\\":\\"v\\",\\"137\\":\\"a\\",\\"138\\":\\"i\\",\\"139\\":\\"

What is the expected behavior?

A useful error message is returned.

All 3 comments

@sorenbs could you have a look at this? it looks like graphcool-lib already returns the unreadable error message (it renders the HTML page seen here: https://api.graph.cool/somewrongstuff/movies).

Is this a bug in graphcool-lib rather than in the logic that prints the logs?

It seems like the error returned here is generated by Auth0 Extend. See documentation at https://auth0.com/extend/docs/developer-guide#handling-errors-from-extensions

We will streamline error handling later.

Closing for now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hoodsy picture hoodsy  路  3Comments

MitkoTschimev picture MitkoTschimev  路  3Comments

sedubois picture sedubois  路  3Comments

dohomi picture dohomi  路  3Comments

sorenbs picture sorenbs  路  3Comments