Cannot connect to Strapi, Status code 403
See original GitHub issueNode.js version: node v12.1.0 npm version: npm 6.9.0 Strapi version: strapi 3.0.0-beta 11 Operating system:
mac Which example is causing problem? https://blog.strapi.io/building-a-static-website-using-gatsby-and-strapi/#allowaccess
Do you want to request a feature or report a bug? bug What is the current behavior? Graphql Query doesn’t work.
If the current behavior is a bug, please provide the steps to reproduce the problem
yarn start
..
success copy gatsby files - 0.058 s
success onPreBootstrap - 0.010 s
Authenticate Strapi user
Authenticate Strapi user: 501.412ms
Starting to fetch data from Strapi (articles)
Starting to fetch data from Strapi (users)
(node:33533) Warning: Label 'Fetch Strapi data' already exists for console.time()
ERROR #11321 PLUGIN
"gatsby-source-strapi" threw an error while running the sourceNodes lifecycle:
Request failed with status code 403
**Error: Request failed with status code 403**
- createError.js:16 createError
[karma-client]/[axios]/lib/core/createError.js:16:15
- settle.js:18 settle
[karma-client]/[axios]/lib/core/settle.js:18:12
- http.js:202 IncomingMessage.handleStreamEnd
[karma-client]/[axios]/lib/adapters/http.js:202:11
- task_queues.js:84 processTicksAndRejections
internal/process/task_queues.js:84:17
warn The gatsby-source-strapi plugin has generated no Gatsby nodes. Do you need it?
success source and transform nodes - 0.878 s
success building schema - 0.252 s
success createPages - 0.002 s
success createPagesStatefully - 0.045 s
success onPreExtractQueries - 0.004 s
success update schema - 0.025 s
success extract queries from components - 0.286 s
success write out requires - 0.005 s
What is the expected behavior?
I can fetch articles from strapi playground http://localhost:1337/graphql
Doesn’t work when I try to get from gatsby http://localhost:8000/___graphql
There is no method allStrapiArticle. I think the connection from client to server is not working. Tried authenticated, unauthenticated all possible options
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (1 by maintainers)
Make sure articles & users has public permissions
For me, this was caused by using a Read-only API token. Using a full-access token fixed the issue.