I’ve had a website running using CakePHP 3 for over 6 months now.
All of a sudden, all of the forms on my webpages stopped working, such that whenever you submit one, nothing happens (controller action doesn’t get called) but you are redirected to the home page. I am indeed generating the form using CakePHP’s provided FormHelper.
Is there anything anyone can think of that could be causing this?
I was initially using the CSRF and Security components, and submitting a form would give this error to users in non-debug mode:
The request has been black-holed
Error: The requested address ‘/’ was not found on this server.
The error’s call stack logged is as below:
2016-12-16 22:51:43 Error: [Cake\Controller\Exception\AuthSecurityException] The request has been black-holed
Request URL: /
Referer URL: https://www.website.net/login
Stack Trace:
#0 /home/public/vendor/cakephp/cakephp/src/Controller/Component/SecurityComponent.php(130): Cake\Controller\Component\SecurityComponent->_validatePost(Object(App\Controller\PagesController))
#1 /home/public/vendor/cakephp/cakephp/src/Event/EventManager.php(422): Cake\Controller\Component\SecurityComponent->startup(Object(Cake\Event\Event))
#2 /home/public/vendor/cakephp/cakephp/src/Event/EventManager.php(391): Cake\Event\EventManager->_callListener(Array, Object(Cake\Event\Event))
#3 /home/public/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php(78): Cake\Event\EventManager->dispatch(Object(Cake\Event\Event))
#4 /home/public/vendor/cakephp/cakephp/src/Controller/Controller.php(501): Cake\Controller\Controller->dispatchEvent(‘Controller.star…’)
#5 /home/public/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php(117): Cake\Controller\Controller->startupProcess()
#6 /home/public/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php(96): Cake\Http\ActionDispatcher->_invoke(Object(App\Controller\PagesController))
#7 /home/public/vendor/cakephp/cakephp/src/Http/BaseApplication.php(83): Cake\Http\ActionDispatcher->dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
#8 /home/public/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Http\BaseApplication->__invoke(Object(Zend\Diactoros\ServerRequest), Object(Zend\Diactoros\Response), Object(Cake\Http\Runner))
#9 /home/public/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php(62): Cake\Http\Runner->__invoke(Object(Zend\Diactoros\ServerRequest), Object(Zend\Diactoros\Response))
#10 /home/public/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Routing\Middleware\RoutingMiddleware->__invoke(Object(Zend\Diactoros\ServerRequest), Object(Zend\Diactoros\Response), Object(Cake\Http\Runner))
#11 /home/public/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php(88): Cake\Http\Runner->__invoke(Object(Zend\Diactoros\ServerRequest), Object(Zend\Diactoros\Response))
#12 /home/public/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Routing\Middleware\AssetMiddleware->__invoke(Object(Zend\Diactoros\ServerRequest), Object(Zend\Diactoros\Response), Object(Cake\Http\Runner))
#13 /home/public/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php(81): Cake\Http\Runner->__invoke(Object(Zend\Diactoros\ServerRequest), Object(Zend\Diactoros\Response))
#14 /home/public/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Error\Middleware\ErrorHandlerMiddleware->__invoke(Object(Zend\Diactoros\ServerRequest), Object(Zend\Diactoros\Response), Object(Cake\Http\Runner))
#15 /home/public/vendor/cakephp/cakephp/src/Http/Runner.php(51): Cake\Http\Runner->__invoke(Object(Zend\Diactoros\ServerRequest), Object(Zend\Diactoros\Response))
#16 /home/public/vendor/cakephp/cakephp/src/Http/Server.php(92): Cake\Http\Runner->run(Object(Cake\Http\MiddlewareQueue), Object(Zend\Diactoros\ServerRequest), Object(Zend\Diactoros\Response))
#17 /home/public/webroot/index.php(37): Cake\Http\Server->run()
#18 {main}
I attempted to see if removing the security/csrf component usage out would fix the problem, but then I just got the problem as I described at the beginning of the post (request not even reaching controller action).
All help/pointers are appreciated. Do let me know if certain additional information would be helpful.
Thanks in advance!