[2023-08-07T02:38:55.058044+00:00] main.DEBUG: URI ‘/checkout/cart/add/uenc/aHR0cHM6Ly93d3cuYmVzdWlnZW5lcmlzLmNvbS92MjQ2djEvYi1jLWluc3BpcmUtZTE1MC5odG1s/product/1/” cannot be accessed with GET method (MagentoCheckoutControllerCartAdd) [] []
[2023-08-07T02:38:55.060439+00:00] main.DEBUG: Request validation failed for action "MagentoCheckoutControllerCartAddInterceptor" {"exception":"[object] (MagentoFrameworkAppRequestInvalidRequestException(code: 0): Invalid request received at /home/public_html/vendor/magento/framework/App/Request/HttpMethodValidator.php:69)"} []
Have looked for an answer on google but just cant find anything relating to this issue with Magento 2.4.6-p1 or anything similar.
2
Answers
Clear cache
bin/magento c:f
Clear folders generated/code, generated/metadata
rm -rf generated/code generated/metadata
Run
bin/magento setup:di:compile
Check after this
If it wasn’t help, Write in Magento 2 gidhub ticket or create new.
https://github.com/magento/magento2/issues/36545
Check HttpPostActionInterface action in your vendor/magento/module-checkout/Controller/Cart/Add.php
Action doesn’t accept GET requests so change it to Post there.