Describe the bug
Upon running sanity graphql deploy, I get the following error:
Dataset: production
Tag: default
â ´ Checking for deployed API
Error: Request returned HTTP 401
at ~/Desktop/site/studio/node_modules/@sanity/core/lib/util/getUrlHeaders.js:30:21
at f (~/Desktop/site/studio/node_modules/once/once.js:25:25)
at ClientRequest.<anonymous> (~/Desktop/site/studio/node_modules/simple-get/index.js:63:5)
My main error was that a new schema was showing up on sanity studio, but not in graphql (using Gatsby). It would working during development, and when I re-ran the development, it would go back to not working, and repeat. Now, it remains as not working. To clarify, it shows up in studio, but not in graphql. I checked status.sanity.io thinking it might be a server error, but it is not.
Appreciate the help
Which versions of Sanity are you using?
@sanity/cli 1.149.13 (latest: 1.149.16)
@sanity/base 1.149.16 (up to date)
@sanity/cli 1.149.16 (up to date)
@sanity/components 1.149.16 (up to date)
@sanity/core 1.149.17 (up to date)
@sanity/dashboard 1.149.16 (up to date)
@sanity/default-layout 1.149.16 (up to date)
@sanity/default-login 1.149.16 (up to date)
@sanity/desk-tool 1.149.16 (up to date)
Run sanity versions in the terminal and copy-paste the result here.
What operating system are you using?
MacOS Mojave
Which versions of Node.js / npm are you running?
Node: v12.16.0
npm: 6.13.4
Sorry about the trouble!
401 is an unauthorized request. Could you try logging out and in again?
sanity logout
sanity login
@kmelve Thanks! This solved the issue for me. It turns out I was logged in to another project's Sanity Studio.
Would it help if CLI could output a more specific error like: "It seems that you are not authorized to deploy this project. Please try to logout and login again." ?
Thanks again!
@kmelve Thanks! This solved the issue for me. It turns out I was logged in to another project's Sanity Studio.
Would it help if CLI could output a more specific error like: "It seems that you are not authorized to deploy this project. Please try to logout and login again." ?
Thanks again!
Thanks for the help, and I agree with this suggestion!
Most helpful comment
Sorry about the trouble!
401 is an unauthorized request. Could you try logging out and in again?