0

I am getting 502 bad gateway error showing in the browser for all pages, including admin. There is nothing in the logs of phpfpm (system/debug/exception).

In the nginx logs I am seeing the request as getting response 302, but with no additional error.

Background: I am trying to switch theme. I think I made a mistake by deleting the old theme from code before switching in the dashboard. I have done UPDATE theme SET type=0 in mysql.

I have made sure that all permissions are ok:

rm -rf var/cache
find var generated pub/static pub/media app/etc -type f -exec chmod g+w {} + &&
find var generated pub/static pub/media app/etc -type d -exec chmod g+ws {} + &&
chown -R :www-data * &&
chmod 777 -R var generated pub 

Health check is 200 ok. phpfpm access log also register the request as 302, but with no reason added to it:

10.1.2.3 -  24/Sep/2021:10:22:23 +0000 "GET /health_check.php" 200
10.1.2.3 -  24/Sep/2021:10:22:33 +0000 "GET /health_check.php" 200
10.1.2.3 -  24/Sep/2021:10:22:39 +0000 "GET /index.php" 302
10.1.2.3 -  24/Sep/2021:10:22:43 +0000 "GET /health_check.php" 200
10.1.2.3 -  24/Sep/2021:10:22:53 +0000 "GET /health_check.php" 200

How can I debug this further?

UPDATE

I tried changing the nginx parameters, but it doesn't help. I am currently trying to debug with adding outputs within magento code (based on this article)

This is what I see when I go to /admin page:

#1 Magento\Backend\Model\View\Result\Redirect\Interceptor[Magento\Framework\Controller\Result\Redirect]#0000000042b6bde00000000057bd9cbd#->setPath() called at [vendor/magento/module-backend/Controller/Adminhtml/Auth/Login.php:70]
#2 Magento\Backend\Controller\Adminhtml\Auth\Login\Interceptor[Magento\Backend\Controller\Adminhtml\Auth\Login]#0000000042b6bc3f0000000057bd9cbd#->getRedirect() called at [vendor/magento/module-backend/Controller/Adminhtml/Auth/Login.php:55]
#3 Magento\Backend\Controller\Adminhtml\Auth\Login\Interceptor[Magento\Backend\Controller\Adminhtml\Auth\Login]#0000000042b6bc3f0000000057bd9cbd#->execute() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#4 Magento\Backend\Controller\Adminhtml\Auth\Login\Interceptor#0000000042b6bc3f0000000057bd9cbd#->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#5 Magento\Backend\Controller\Adminhtml\Auth\Login\Interceptor#0000000042b6bc3f0000000057bd9cbd#->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/App/Action/Plugin/ActionFlagNoDispatchPlugin.php:51]
#6 Magento\Framework\App\Action\Plugin\ActionFlagNoDispatchPlugin#0000000042b6bc0e0000000057bd9cbd#->aroundExecute() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#7 Magento\Backend\Controller\Adminhtml\Auth\Login\Interceptor#0000000042b6bc3f0000000057bd9cbd#->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#8 Magento\Backend\Controller\Adminhtml\Auth\Login\Interceptor#0000000042b6bc3f0000000057bd9cbd#->___callPlugins() called at [generated/code/Magento/Backend/Controller/Adminhtml/Auth/Login/Interceptor.php:23]
#9 Magento\Backend\Controller\Adminhtml\Auth\Login\Interceptor#0000000042b6bc3f0000000057bd9cbd#->execute() called at [vendor/magento/framework/App/Action/Action.php:111]
#10 Magento\Backend\Controller\Adminhtml\Auth\Login\Interceptor[Magento\Framework\App\Action\Action]#0000000042b6bc3f0000000057bd9cbd#->dispatch() called at [vendor/magento/module-backend/App/AbstractAction.php:151]
#11 Magento\Backend\Controller\Adminhtml\Auth\Login\Interceptor[Magento\Backend\App\AbstractAction]#0000000042b6bc3f0000000057bd9cbd#->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#12 Magento\Backend\Controller\Adminhtml\Auth\Login\Interceptor#0000000042b6bc3f0000000057bd9cbd#->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#13 Magento\Backend\Controller\Adminhtml\Auth\Login\Interceptor#0000000042b6bc3f0000000057bd9cbd#->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:143]
#14 Magento\Backend\App\Action\Plugin\Authentication#0000000042b6bcd40000000057bd9cbd#->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#15 Magento\Backend\Controller\Adminhtml\Auth\Login\Interceptor#0000000042b6bc3f0000000057bd9cbd#->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#16 Magento\Backend\Controller\Adminhtml\Auth\Login\Interceptor#0000000042b6bc3f0000000057bd9cbd#->___callPlugins() called at [generated/code/Magento/Backend/Controller/Adminhtml/Auth/Login/Interceptor.php:32]
#17 Magento\Backend\Controller\Adminhtml\Auth\Login\Interceptor#0000000042b6bc3f0000000057bd9cbd#->dispatch() called at [vendor/magento/framework/App/FrontController.php:186]
#18 Magento\Framework\App\FrontController\Interceptor[Magento\Framework\App\FrontController]#0000000042b6bf830000000057bd9cbd#->processRequest() called at [vendor/magento/framework/App/FrontController.php:118]
#19 Magento\Framework\App\FrontController\Interceptor[Magento\Framework\App\FrontController]#0000000042b6bf830000000057bd9cbd#->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#20 Magento\Framework\App\FrontController\Interceptor#0000000042b6bf830000000057bd9cbd#->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#21 Magento\Framework\App\FrontController\Interceptor#0000000042b6bf830000000057bd9cbd#->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#22 Magento\Framework\App\FrontController\Interceptor#0000000042b6bf830000000057bd9cbd#->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]
#23 Magento\Framework\App\FrontController\Interceptor#0000000042b6bf830000000057bd9cbd#->dispatch() called at [vendor/magento/framework/App/Http.php:116]
#24 Magento\Framework\App\Http\Interceptor[Magento\Framework\App\Http]#0000000042b6be250000000057bd9cbd#->launch() called at [vendor/magento/framework/App/Bootstrap.php:263]
#25 Magento\Framework\App\Bootstrap#0000000042b6bea40000000057bd9cbd#->run() called at [pub/index.php:29]

string(122) "http://example.com/index.php/admin/admin/index/index/key/d4e355fa9340a85b70a3074a25985590af30eb5e5829e53436cd1ffae5b8102c/"

#1 Magento\Framework\App\Response\Http\Interceptor[Magento\Framework\HTTP\PhpEnvironment\Response]#0000000042b6be230000000057bd9cbd#->setRedirect() called at [vendor/magento/framework/Controller/Result/Redirect.php:114]
#2 Magento\Backend\Model\View\Result\Redirect\Interceptor[Magento\Framework\Controller\Result\Redirect]#0000000042b6bde00000000057bd9cbd#->render() called at [vendor/magento/module-backend/Model/View/Result/Redirect.php:67]
#3 Magento\Backend\Model\View\Result\Redirect\Interceptor[Magento\Backend\Model\View\Result\Redirect]#0000000042b6bde00000000057bd9cbd#->render() called at [vendor/magento/framework/Controller/AbstractResult.php:125]
#4 Magento\Backend\Model\View\Result\Redirect\Interceptor[Magento\Framework\Controller\AbstractResult]#0000000042b6bde00000000057bd9cbd#->renderResult() called at [generated/code/Magento/Backend/Model/View/Result/Redirect/Interceptor.php:23]
#5 Magento\Backend\Model\View\Result\Redirect\Interceptor#0000000042b6bde00000000057bd9cbd#->renderResult() called at [vendor/magento/framework/App/Http.php:120]
#6 Magento\Framework\App\Http\Interceptor[Magento\Framework\App\Http]#0000000042b6be250000000057bd9cbd#->launch() called at [vendor/magento/framework/App/Bootstrap.php:263]
#7 Magento\Framework\App\Bootstrap#0000000042b6bea40000000057bd9cbd#->run() called at [pub/index.php:29]
3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.