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

INTERNAL_SERVER_ERROR "while fetching data from contentful using graphql plugin 'gatsby-source-graphql'. #22590

Closed
Himanshu-bramh opened this issue Mar 26, 2020 · 2 comments
Assignees
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@Himanshu-bramh
Copy link

Description

INTERNAL_SERVER_ERROR message while fetching data from contentful using graphql plugin 'gatsby-source-graphql':

Run the Gatsby app threw an error. 

ERROR #11321  PLUGIN

FetchError: request to https://graphql.contentful.com/content/v1/spaces/xxxxxx/environments/master?access_token=xxxxxxxxxxx failed,   reason: self signed certificate in certificate chain

Run this command : export NODE_TLS_REJECT_UNAUTHORIZED=0 
 
After running  above command and restart the app threw an error.

" ServerError: Response not successful: Received status code 500"

 ERROR #85923  GRAPHQL

Steps to reproduce

  • create a new gatsby project
  • add gatsby-source-graphql
  • add this 👇 bit of configuration with a mockfetch implementation

{
      resolve:"gatsby-source-graphql",
      options:{
        typeName:"contentful",
        fieldName:"contentful",
        url: "https://graphql.contentful.com/content/v1/spaces/,
        headers: {
          Authorization: "xxxxxxxxxxx",
          accept: "application/json",
          contentType: "application/json"
        },
      }
    }

  • run gatsby develop
  • observe the console message

Expected result

Application should be running . Query data from contentful should be fetch and store to local graphql node (http://localhost:8000/___graphql)

Actual result

Query data is not fetching from contentful and showing following error message .

ERROR #11321 PLUGIN

FetchError: request to https://graphql.contentful.com/content/v1/spaces/xxxxxx/environments/master?access_token=xxxxxxxxxxxxxx . failed, reason: self signed certificate in certificate chain

To resolve this issue run this command export NODE_TLS_REJECT_UNAUTHORIZED=0 , now threw an error

" ServerError: Response not successful: Received status code 500"

ERROR #85923 GRAPHQL

Environment

Run gatsby info --clipboard in your project directory and paste the output here.

System:
    OS: macOS Mojave 10.14.6
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.16.3 - /usr/local/bin/node
    npm: 6.14.3 - /usr/local/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 79.0.3945.130
    Firefox: 73.0.1
    Safari: 13.0.5
  npmPackages:
    gatsby: ^2.19.7 => 2.20.7
    gatsby-image: ^2.2.39 => 2.3.1
    gatsby-plugin-apollo: ^3.0.1 => 3.0.1
    gatsby-plugin-manifest: ^2.2.39 => 2.3.3
    gatsby-plugin-offline: ^3.0.32 => 3.1.2
    gatsby-plugin-react-helmet: ^3.1.21 => 3.2.1
    gatsby-plugin-sharp: ^2.4.3 => 2.5.3
    gatsby-source-filesystem: ^2.1.46 => 2.2.2
    gatsby-source-graphql: ^2.1.33 => 2.3.0
    gatsby-transformer-sharp: ^2.3.13 => 2.4.2
  npmGlobalPackages:
    gatsby-cli: 2.11.2

@Himanshu-bramh Himanshu-bramh added the type: bug An issue or pull request relating to a bug in Gatsby label Mar 26, 2020
@vladar
Copy link
Contributor

vladar commented Mar 26, 2020

Error 500 (INTERNAL_SERVER_ERROR) means it is a server error. Did you try running the same query against contentful server manually?

Also this error:

reason: self signed certificate in certificate chain

Run this command : export NODE_TLS_REJECT_UNAUTHORIZED=0 

hints that you may have some kind of self-signed root SSL certificate on the machine where you try to build the site?

@wardpeet
Copy link
Contributor

Seems like our robot didn't work

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community! 💪💜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

3 participants