Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Can not resolve reCAPTCHA parameter" entries in exception.log for Google reCAPTCHA Admin Panel #34975

Closed
1 of 5 tasks
stevekem opened this issue Jan 14, 2022 · 91 comments
Closed
1 of 5 tasks
Labels
Area: Admin UI Component: Captcha Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@stevekem
Copy link

stevekem commented Jan 14, 2022

Preconditions (*)

  1. Magento 2.4.3-p1

Steps to reproduce (*)

  1. Go to Configuration > Security > Google reCAPTCHA Admin Panel

  2. Add your Google API Website Key & Google API Secret Key to any reCAPTCHA below:

reCAPTCHA v2 ("I am not a robot")
reCAPTCHA v2 Invisible
reCAPTCHA v3 Invisible

  1. Select your reCAPTCHA version (with API keys above) for either below:

Enable for Login
Enable for Forgot Password

  1. Save config

  2. Flush cache

Expected result (*)

  1. No entry in var/log/exception.log file

Actual result (*)

  1. Below entry every few seconds/minutes constantly with no traffic:

main.ERROR: Can not resolve reCAPTCHA parameter. {"exception":"[object] (Magento\Framework\Exception\InputException(code: 0): Can not resolve reCAPTCHA parameter. at /home/xxxxxxx/public_html/vendor/magento/module-re-captcha-ui/Model/CaptchaResponseResolver.php:25)"} []

  • Getting around 12,000 entry lines every 24 hours in exception.log file which is getting huge in a short period of time.
  • Keys have been triple checked to make sure correct, even created new ones with no change in behavior.
  • reCAPTCHA for both Admin and Frontend seems to be working.
  • Only known way to stop entries is disable both "Enable for Login" and "Enable for Forgot Password" for Admin Storefront.
  • reCAPTCHA for Frontend storefront isn't experiencing this issue for us for all enabled areas.

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Jan 18, 2022

Hi @engcom-Hotel. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@0xMatt
Copy link

0xMatt commented Jan 19, 2022

Same issue. Happens all the time.

[2022-01-17 14:31:45] main.ERROR: Can not resolve reCAPTCHA parameter. {"exception":"[object] (Magento\\Framework\\Exception\\InputException(code: 0): Can not resolve reCAPTCHA parameter. at /var/www/html/magento/vendor/magento/module-re-captcha-ui/Model/CaptchaResponseResolver.php:25)"} []

[2022-01-17 16:21:40] main.ERROR: Can not resolve reCAPTCHA parameter. {"exception":"[object] (Magento\\Framework\\Exception\\InputException(code: 0): Can not resolve reCAPTCHA parameter. at /var/www/html/magento/vendor/magento/module-re-captcha-ui/Model/CaptchaResponseResolver.php:25)"} []

Captcha works. The badge is loaded and visible. When I go to log in, I'll get an error message saying something went wrong. I'll have to log in 2-3 times and around the third time it'll let me in. No javascript console errors are present during this issue.

@stevekem
Copy link
Author

Captcha works. The badge is loaded and visible. When I go to log in, I'll get an error message saying something went wrong. I'll have to log in 2-3 times and around the third time it'll let me in. No javascript console errors are present during this issue.

Yes this happens as well, I forgot to mention that. Thank you!

@stevekem
Copy link
Author

Just wanted to note that we are getting the "Something went wrong with reCAPTCHA. Please contact the store owner." error on frontend too, not just on Admin. The 12,000+ daily log entries are happening with Admin module though.

@engcom-Hotel engcom-Hotel removed their assignment Jan 21, 2022
@ihor-sviziev
Copy link
Contributor

We got the same issue, but after analyzing it - it looks like we're getting a lot of such messages because some bot(s) are trying to create a customer, and captcha validation fails for them. We weren't able to reproduce this issue ourselves.

@stevekem
Copy link
Author

We got the same issue, but after analyzing it - it looks like we're getting a lot of such messages because some bot(s) are trying to create a customer, and captcha validation fails for them. We weren't able to reproduce this issue ourselves.

Thanks for the info! How could we verify if that is the case for us as well?

@ihor-sviziev
Copy link
Contributor

@stevekem, we analyzed logs, the interval between requests from the same IP address was ~0-3 sec (usually people don't do requests so quickly), the requests were to /customer/account/create/, /customer/account/createpost/ and to /customer/account/create/<product_url_path>/.
The last case links are not available on the website, so that's some bot for sure.

@stevekem
Copy link
Author

@ihor-sviziev Ok gotcha! If it is the bots, just block them in robots? Did that resolve the issue for you?

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Jan 26, 2022

@stevekem that looks like bots that are trying to hack or do something similar by creating a new customer

@stevekem
Copy link
Author

@ihor-sviziev In your case, did you block the bots in robots.txt to resolve the issue?

@ihor-sviziev
Copy link
Contributor

@stevekem yes, the requests starting with /customer/ are blocked by default and we're not removed that.

@stevekem
Copy link
Author

@ihor-sviziev Thank you, appreciate it! Will check our logs and see if that's the case for us as well.

@engcom-Delta engcom-Delta self-assigned this Mar 1, 2022
@m2-assistant
Copy link

m2-assistant bot commented Mar 1, 2022

Hi @engcom-Delta. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Delta
Copy link
Contributor

Hi @stevekem ,
Thank you for reporting the issue,We are unable to reproduce the issue on Magento 2.4 develop branch.Please review provided steps.
Steps Followed:

1.Login to admin Panel
2.Go to Stores-->Configuration-->Security-->Google Recaptcha Admin Panel-->reCAPTCHA v2("I am not a robot)
3.Added Google API Website Key and Google API Secret Key to reCAPTCHA v2("I am not a robot)
4.Enabled for Login
Enabled for Forgot Password
5.Saved the configuration
6.Flush Cache

Actual Results
1.No entry in var/log/exception.log file
Screenshot from 2022-02-23 20-11-06

Hence Adding the label "Needs Update"

@engcom-Delta engcom-Delta added Issue: needs update Additional information is require, waiting for response and removed Issue: ready for confirmation labels Mar 3, 2022
@engcom-Delta
Copy link
Contributor

We have noticed that this issue has not been updated for a period of more than 14 Days.
Hence we assume that this issue is fixed now, so we are closing it. Please raise a fresh ticket or reopen this ticket if you need more assistance on this.

@knoorani-ijona
Copy link

We are still facing this issue. In my case, a captcha is needed for the newsletter subscription form. Same error.
[2022-04-13 13:13:03] main.ERROR: Can not resolve reCAPTCHA parameter. {"exception":"[object] (Magento\\Framework\\Exception\\InputException(code: 0): Can not resolve reCAPTCHA parameter. at /home/xxxxxx/public_html/vendor/magento/module-re-captcha-ui/Model/CaptchaResponseResolver.php:25)"} []

@Hanhan1989
Copy link

Hanhan1989 commented Apr 17, 2022

@engcom-Delta @knoorani-ijona Same problem in Magento 2.4.4 in admin loggin page. it seems that the error is reproduced only in production mode
main.ERROR: Magento\Framework\Exception\InputException: Can not resolve reCAPTCHA parameter. in vendor/magento/module-re-captcha-ui/Model/CaptchaResponseResolver.php:25

@Hanhan1989
Copy link

Hanhan1989 commented Apr 17, 2022

In my case, there were two javascript errors that caused me to not be able to log in. These errors are due to the minification of the collapse.js and tab.js files in the lib/web/jquery/bootstrap/ path.

So the solution to this problem has been to exclude those files from the minification.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <dev>
            <js>
                <minify_exclude>
                    <collapse>/jquery/bootstrap/collapse</collapse>
                    <tab>/jquery/bootstrap/tab</tab>
                </minify_exclude>
            </js>
        </dev>
    </default>
</config>

@Themageguru
Copy link

Themageguru commented Apr 28, 2022

Hello, We got the same issue in magento version 2.4.3. lot of exception errors in log file. Also, I did try above all solution but didn't work any one. Any update on this issue.

@0xMatt
Copy link

0xMatt commented Jun 1, 2023

Still having this issue in 2.4.6

@perryholden
Copy link

The patch supplied above works for me on version 2.4.4-p5. Thanks to @tschirmer and @C4rter.

@frostitution
Copy link

frostitution commented Sep 29, 2023

Discovered this issue not too long after enabling official Magento reCAPTCHA Checkbox (Customer Registration Form only) on Magento 2.4.6, still an issue

@AlexandreBulete
Copy link

Each form "Recaptchable" has an additional script block added. You have to watch the corresponding recaptcha module.
For example : module-re-captcha-newsletter add this block :

<referenceContainer name="footer">
            <block class="Magento\ReCaptchaUi\Block\ReCaptcha"
                   name="recaptcha-newsletter"
                   after="-"
                   template="Magento_ReCaptchaNewsletter::recaptcha_newsletter.phtml"
                   ifconfig="recaptcha_frontend/type_for/newsletter">
                <arguments>
                    <argument name="recaptcha_for" xsi:type="string">newsletter</argument>
                    <argument name="jsLayout" xsi:type="array">
                        <item name="components" xsi:type="array">
                            <item name="recaptcha" xsi:type="array">
                                <item name="component" xsi:type="string">Magento_ReCaptchaFrontendUi/js/reCaptcha</item>
                            </item>
                        </item>
                    </argument>
                </arguments>
            </block>
        </referenceContainer>

Are you sure your layout is including this additional script block ?

I noticed it after dd() the $request->getParams() in this CaptchaResponseResolvermodel.
If you haven't the requested recaptcha params then it seems you didn't include this script block.

@rossparachute
Copy link

Each form "Recaptchable" has an additional script block added. You have to watch the corresponding recaptcha module. For example : module-re-captcha-newsletter add this block :

<referenceContainer name="footer">
            <block class="Magento\ReCaptchaUi\Block\ReCaptcha"
                   name="recaptcha-newsletter"
                   after="-"
                   template="Magento_ReCaptchaNewsletter::recaptcha_newsletter.phtml"
                   ifconfig="recaptcha_frontend/type_for/newsletter">
                <arguments>
                    <argument name="recaptcha_for" xsi:type="string">newsletter</argument>
                    <argument name="jsLayout" xsi:type="array">
                        <item name="components" xsi:type="array">
                            <item name="recaptcha" xsi:type="array">
                                <item name="component" xsi:type="string">Magento_ReCaptchaFrontendUi/js/reCaptcha</item>
                            </item>
                        </item>
                    </argument>
                </arguments>
            </block>
        </referenceContainer>

Are you sure your layout is including this additional script block ?

I noticed it after dd() the $request->getParams() in this CaptchaResponseResolvermodel. If you haven't the requested recaptcha params then it seems you didn't include this script block.

Ditto.

As @AlexandreBulete says, just add it in yourself. You should see a hidden (or similar) in each form you want to use recaptcha in. Less convenient, but it sorts it.

@frostitution
Copy link

Each form "Recaptchable" has an additional script block added. You have to watch the corresponding recaptcha module. For example : module-re-captcha-newsletter add this block :

<referenceContainer name="footer">
            <block class="Magento\ReCaptchaUi\Block\ReCaptcha"
                   name="recaptcha-newsletter"
                   after="-"
                   template="Magento_ReCaptchaNewsletter::recaptcha_newsletter.phtml"
                   ifconfig="recaptcha_frontend/type_for/newsletter">
                <arguments>
                    <argument name="recaptcha_for" xsi:type="string">newsletter</argument>
                    <argument name="jsLayout" xsi:type="array">
                        <item name="components" xsi:type="array">
                            <item name="recaptcha" xsi:type="array">
                                <item name="component" xsi:type="string">Magento_ReCaptchaFrontendUi/js/reCaptcha</item>
                            </item>
                        </item>
                    </argument>
                </arguments>
            </block>
        </referenceContainer>

Are you sure your layout is including this additional script block ?

I noticed it after dd() the $request->getParams() in this CaptchaResponseResolvermodel. If you haven't the requested recaptcha params then it seems you didn't include this script block.

I see this template on my site and I am still receiving the error for frontend Customer Registration

@rejith7
Copy link

rejith7 commented Jan 4, 2024

@frostitution I'm getting the same error on the customer registration form(2.4.5-p4 EE). Were you able to resolve this?

@buderus199
Copy link

Same error for me on 2.4.5-p5 OS. Error occurs when bots try to register new customer account.

@krnshah
Copy link
Contributor

krnshah commented Feb 23, 2024

I am having the same issue. We are using magento2.4.6-p2 + hyva. but when create the captcha key and apply it to frontend it show same error and not allowed us to login/sign up successfully.
Can anyone please help?

@frostitution
Copy link

@rejith7 No, sorry. I left it enabled because recaptcha works, but the log errors are still there. recaptcha works for us when we test it and cannot seem to replicate this consistently. I have been monitoring for any sort of solution from anyone but no luck.

@jorgb90
Copy link

jorgb90 commented Apr 10, 2024

Issue also still here! For me it has something to do with bots (I think) cause its always happening in the night. The form itself and during the day it's working perfectly fine with Recaptcha.

@indrisepos
Copy link

I have the same problem. We are using Magento2.4.7-p2

@arvind-curotec
Copy link

Having same issue, no resolution.

@devvolunteeruk
Copy link

Having the same issue on Magento 2.4.7-p2, been seeing it since 2.4.6 on our installation

@engcom-Hotel
Copy link
Contributor

Hello @devvolunteeruk @arvind-curotec,

We have tried to reproduce the issue in the latest development branch i.e. 2.4-develop but the issue is not reproducible for us. We have used Recaptcha v2 (I am not a robot).

There are no log entries with the specified error in the main description. Please let us know if we missed anything.

Thanks

@jmonrove
Copy link

jmonrove commented Nov 8, 2024

Same issue with V3 on 2.4.6-p8

@engcom-Hotel
Copy link
Contributor

Hello @jmonrove,

Please try to reproduce the issue either in the latest development branch i.e. 2.4-develop or the latest stable version.

We have tried to reproduce the issue in the development branch and it is not reproducible for us.

Thanks

@mcspronko
Copy link
Contributor

The issue exists on Magento 2.4.6-p8 Open Source.

@engcom-Hotel
Copy link
Contributor

Hello @mcspronko,

We recommend you please upgrade your instance to the latest stable version and let us know if you are still able to reproduce the issue.

Thanks

@mcspronko
Copy link
Contributor

Hello @engcom-Hotel

We are on the latest stable version of Magento. The 2.4.7-p3 has a bug with Cart Price Rules that we can't move to this version as of now.

@engcom-Hotel
Copy link
Contributor

Thanks @mcspronko for the reply!

Are you facing the issue mentioned in the main description in 2.4.7-p3? If yes, can you please let us know the steps to reproduce it? Also, please try to reproduce the issue in the latest development branch, 2.4-develop and let us know if the issue is reproducible for you or not because for us the issue is not reproducible.

Thanks

@mcspronko
Copy link
Contributor

@engcom-Hotel

The 2.4.7-p3 has a bug with Cart Price Rules, not related to Captcha.

@engcom-Hotel
Copy link
Contributor

Hello @mcspronko,

This issue has been created for the recaptcha bug and is no longer reproducible. Please create a new issue and explain the bug with the Cart price rules there.

Thanks

@mcspronko
Copy link
Contributor

@engcom-Hotel you asked me to update to the latest stable version where i replied that 2.4.7-p3 is not stable due to a bug with price cart rules. I am fully aware that the current issue is about captcha.

@mostafa-elkholy
Copy link

mostafa-elkholy commented Nov 15, 2024

I have the same issue with Magento 2.4.6-p3 updated to 2.4.6-p8 & 2.4.7-p3 and have the same issue of the reCAPTCHA

[2024-11-14T22:29:28.584459+00:00] main.ERROR: Magento\Framework\Exception\InputException: Can not resolve reCAPTCHA parameter. in /home/1218041.cloudwaysapps.com/rrkkmbpnmd/public_html/vendor/magento/module-re-captcha-ui/Model/CaptchaResponseResolver.php:25
Stack trace:
#0 vendor/magento/module-re-captcha-ui/Model/RequestHandler.php(112): Magento\ReCaptchaUi\Model\CaptchaResponseResolver->resolve()
#1 vendor/magento/module-re-captcha-customer/Observer/CreateCustomerObserver.php(67): Magento\ReCaptchaUi\Model\RequestHandler->execute()
#2 vendor/magento/framework/Event/Invoker/InvokerDefault.php(88): Magento\ReCaptchaCustomer\Observer\CreateCustomerObserver->execute()
#3 vendor/magento/framework/Event/Invoker/InvokerDefault.php(74): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod()
#4 vendor/magento/framework/Event/Manager.php(65): Magento\Framework\Event\Invoker\InvokerDefault->dispatch()
#5 generated/code/Magento/Framework/Event/Manager/Proxy.php(95): Magento\Framework\Event\Manager->dispatch()
#6 vendor/magento/framework/App/FrontController.php(279): Magento\Framework\Event\Manager\Proxy->dispatch()
#7 vendor/magento/framework/App/FrontController.php(211): Magento\Framework\App\FrontController->dispatchPreDispatchEvents()
#8 vendor/magento/framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest()
#9 vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()
#10 vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()
#11 vendor/nitropack/magento2-extension/Plugin/CacheDelivery/LocalCachePlugin.php(183): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}()
#12 vendor/magento/framework/Interception/Interceptor.php(135): NitroPack\NitroPack\Plugin\CacheDelivery\LocalCachePlugin->aroundDispatch()
#13 vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(99): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}()
#14 vendor/magento/framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch()
#15 vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(71): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}()
#16 vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch()
#17 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}()
#18 generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins()
#19 vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()
#20 generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
#21 vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#22 pub/index.php(30): Magento\Framework\App\Bootstrap->run()

@bjolysharp
Copy link

Why is this issue closed? We're still seeing the issue on Magento 2.4.7-p3:

[2025-01-03T13:21:50.059509+00:00] main.ERROR: Magento\Framework\Exception\InputException: Can not resolve reCAPTCHA parameter. in /chroot/home/.../html/vendor/magento/module-re-captcha-ui/Model/CaptchaResponseResolver.php:25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Admin UI Component: Captcha Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Archived in project
Development

No branches or pull requests