504 Gateway Timeout for :8910/.netlify/functions/graphql

I went through the whole tutorial a couple weeks back with no issues and have been working on my own app ever since. Last night I was adding new schema to my schema.prisma file and all seemed to work fine on the db save and up commands.

Today, I’m getting an error across my entire app that says Failed to load resource: the server responded with a status of 504 (Gateway Timeout) This is occurring at :8910/.netlify/functions/graphql:1

There is also a warning for [Network error]: ServerParseError: Unexpected token E in JSON at position 0 at invariant.esm.js:29

Any ideas?

yarn rw info:

System:
  OS: macOS 10.15.3
  Shell: 3.2.57 - /bin/bash
Binaries:
  Node: 14.2.0 - /var/folders/0q/pjz2hj3j7qj1skllnnpgxd4w0000gn/T/yarn--1591281937356-0.4203494857082566/node
  Yarn: 1.22.4 - /var/folders/0q/pjz2hj3j7qj1skllnnpgxd4w0000gn/T/yarn--1591281937356-0.4203494857082566/yarn
Databases:
  SQLite: 3.28.0 - /usr/bin/sqlite3
Browsers:
  Chrome: 83.0.4103.61
  Firefox: 77.0.1
  Safari: 13.0.5
npmPackages:
  @redwoodjs/core: ^0.8.2 => 0.8.2

Hey @morganmspencer, in order to help you debug could you share your code with us?

I’ve got a pull-request that will add debugging information to the console that we should release very shortly: https://github.com/redwoodjs/redwood/pull/599

1 Like

I actually just figured out the cause of this. I had setup my schema, built the scaffolds, and then customized the pages. I then added another field to the one of the models and didn’t want to rebuild the scaffolds that I had customized so I tried to manually add the new field to the graphql files. I removed these changes and rebuilt and this worked.

I feel like I might have seen the question asked before but is there a good way to regenerate the scaffold if I’ve made changes to the schema?

1 Like

Ah, makes sense and glad you’ve found the solution!

There are some very recent improvements to the CLI help text and there’s a new Destroy command (which is both as dangerous and awesome as it sounds :boom:).

I think you’d most likely want to use scaffold with the `–force’ flag to overwrite existing. Here’s more info from the help output, including a new option to add a path to the model being created:

$ yarn rw g scaffold help      
yarn run v1.22.4

rw g scaffold <model>

Generate Pages, SDL, and Services files based on a given DB schema Model. Also
accepts <path/model>.

Positionals:
  model  Model to scaffold. You can also use <path/model> to nest files by type
         at the given path directory (or directories). For example, 'rw g
         scaffold admin/post'.                                        [required]

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]
  --force                                             [boolean] [default: false]

Alternatively, you could destroy and start over:

 $ yarn rw destroy help                  
yarn run v1.22.4

rw destroy <type>

Rollback changes made by the generate command.

Commands:
  rw destroy cell <name>         Destroy a cell component.
  rw destroy component <name>    Destroy a component.
  rw destroy function <name>     Destroy a function
  rw destroy layout <name>       Destroy a layout component.
  rw destroy page <name> [path]  Destroy a page component.
  rw destroy scaffold <model>    Destroy pages, SDL, and a services object.
  rw destroy sdl <model>         Destroy a GraphQL schema and service object.
  rw destroy service <name>      Destroy a service component.

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]
1 Like

Thanks @thedavid, this is great! I really love what y’all are doing with Redwood! It’s great for novices like me who have always wanted to develop web apps but didn’t have the full technical background.

3 Likes