craftql icon indicating copy to clipboard operation
craftql copied to clipboard

HTTP 503 – Service Unavailable

Open Jones-S opened this issue 6 years ago • 1 comments

Hi there I experienced a very weird error. While developing suddenly my graphql endpoint would not work anymore.

I get an html returned saying things like:

HTTP 503 – Service Unavailable – craft\web\ServiceUnavailableHttpException craft\web\ServiceUnavailableHttpException in /Users/USERNAME/Documents/github/my-craft/vendor/craftcms/cms/src/web/Controller.php:163 Stack trace: #0 /Users/USERNAME/Documents/github/my-craft/vendor/markhuot/craftql/src/Controllers/ApiController.php(37): craft\web\Controller->beforeAction(Object(yii\base\InlineAction)) #1 /Users/USERNAME/Documents/github/my-craft/vendor/yiisoft/yii2/base/Controller.php(155): markhuot\CraftQL\Controllers\ApiController->beforeAction(Object(yii\base\InlineAction)) #2 /Users/USERNAME/Documents/github/my-craft/vendor/craftcms/cms/src/web/Controller.php(187): yii\base\Controller->runAction('index', Array) #3 /Users/USERNAME/Documents/github/my-craft/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('index', Array) #4 /Users/USERNAME/Documents/github/my-craft/vendor/craftcms/cms/src/web/Application.php(299): yii\base\Module->runAction('craftql/api/ind...', Array) #5 /Users/USERNAME/Documents/github/my-craft/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('craftql/api/ind...', Array) #6 /Users/USERNAME/Documents/github/my-craft/vendor/craftcms/cms/src/web/Application.php(284): yii\web\Application->handleRequest(Object(craft\web\Request)) #7 /Users/USERNAME/Documents/github/my-craft/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request)) #8 /Users/USERNAME/Documents/github/my-craft/web/index.php(21): yii\base\Application->run() #9 {main}

I have a local installation running with MAMP Pro.

  • ✅ I can login to the admin, everything is normal
  • ✅ I can test graphql queries in the graphiql of craftql.
  • ✅ Local mysql is running, php as well

What I can't: Run the curl command $ curl -H "Authorization: bearer TOKEN" -H "Content-type: application/json" -d '{"query":"{ helloWorld }"}' http://localdomain.test/api It stopped working from one to another minute... I even tried to add another token and run the curl command again. Same error as described above.

Does somebody have an idea, where that could result from? Stacktrace seems to show to a craftql thing as well.

I think it is related to these lines here: image From file: in /Users/USERNAME/Documents/github/my-craft/vendor/craftcms/cms/src/web/Controller.php How could I suddenly not be authorized anymore?...

Thanks for any help, I really have no clue.

Jones-S avatar Aug 22 '19 01:08 Jones-S

OK WOW: Disabling this button in the backend: image Found at admin -> Settings > General

Will break graphql?... A mere wonder I found out...

Why would this cause such an error?

Jones-S avatar Aug 22 '19 01:08 Jones-S