another undefined method Guzzle problem

6 years 9 months ago #294899 by cpaschen
another undefined method Guzzle problem was created by cpaschen
We're running into
the 0 Call to undefined method GuzzleHttp\Psr7\Response::json()
error again.

This time it is happening at the end of the registration process.
The specific URL on the error page is:

twincitieshomeschoolsports.org/component/comprofiler/saveregisters?Itemid=829

This site was working without a problem (without this error) a couple weeks ago - prior to upgrading from Joomla 3.7.1 to 3.7.2.

I've made sure that all of our CB plugins are updated and configured properly (as well as CB) as of 2017-06-15.

Any ideas what might be causing this issue?

Please Log in to join the conversation.

6 years 9 months ago #294906 by krileon
Replied by krileon on topic another undefined method Guzzle problem
Only other topic reporting this issue is your own. I'm also unable to confirm locally or on our demo site. Locally have also tested PHP 7.1.5 for past several weeks now with it also working fine. During registration the only Guzzle requests made are the following.

Video Fieldtype: Link Usage (but does not expect JSON or parse for JSON)
Audio Fieldtype: Link Usage (but does not expect JSON or parse for JSON)
CB AntiSpam: reCaptcha Captcha (expects JSON and parses for it)
CBSubs: Quickpay Gateway (expects JSON and parses for it)

Are you using any of the above? Please ensure CB and all of its plugins are completely up to date as well.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

6 years 9 months ago #295051 by cpaschen
Replied by cpaschen on topic another undefined method Guzzle problem
We're actually having the same problem on 2 different sites. One site is using CBSubs (but not Quickpay). Both sites are using CB AntiSpam.

Disabling CB AntiSpam prevents the error.
After doing some additional tests, the problem appears to be with the reCaptcha v2 integration.

This was working earlier and the core Joomla registration seems to work fine with the reCaptcha.

I've tried switching to Honeypot (Internal) and get :

Error
Captcha : Invalid Captcha Code

I also get the guzzle error when trying to use the Google hidden captcha.

The Internal Question seems to work; however, so it appears to be some issue with how the AntiSpam is handling the recaptcha system.

Any further ideas?

Please Log in to join the conversation.

6 years 9 months ago #295053 by krileon
Replied by krileon on topic another undefined method Guzzle problem
reCaptcha is validated with an HTTP request. I've no idea why it doesn't work for you unless cURL is not configured properly. Contact your host to ensure cURL is available and configured for outbound HTTPS requests.

The honeypot only usage shouldn't be erroring though unless the honeypot input was filled out by some sort of autofill. Will add a bug ticket to look into that to ensure that mode is working properly.

forge.joomlapolis.com/issues/6679


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

6 years 8 months ago #295814 by cpaschen
Replied by cpaschen on topic another undefined method Guzzle problem
(picking this back up after a few weeks dealing with other issues)

I got the following response from our hosting company.

I can confirm our versions of curl and libcurl have no problems whatsoever in connecting to Google over https for reCaptcha service.

I took a look at the error message: Call to undefined method GuzzleHttp\Psr7\Response::json() and it me think that you have some legacy code that's meant for an older version of Guzzle. For example, on line 385 of /mnt/data/vhosts/casite-764056.cloudaccess.net/httpdocs/components/com_comprofiler/plugin/libraries/CB/Plugin/AntiSpam/Captcha.php:
$response = $result->json();

"One small side effect of this was the removal of the "::json()" method from the response, as the PSR-7 standard does not define this."
blog.jacobemerick.com/web-development/json-responses-in-guzzle-six/

And there are possible solutions as discussed on this related Stackoverflow post:
stackoverflow.com/questions/30530172/guzzle-6-no-more-json-method-for-responses

Also please note that there could be other calls on the site that are still using the same syntax (calling that undefined method).


All of our CB (and CBSubs) plugins are all up-to-date.

If we disable the AntiSpam, then it works fine, if we switch to any of the other captcha settings (internal) it works fine. Does the CB AntiSpam 'call' any other core systems that might be outdated? (although we are runing on J!3.7.3 so we should have the latest of everything.
We are running Akeeba Admin Tools also (not sure if that could somehow be blocking this connection).

Any additional ideas?

Please Log in to join the conversation.

6 years 8 months ago - 6 years 8 months ago #295826 by krileon
Replied by krileon on topic another undefined method Guzzle problem
We're not using Guzzle 6, but Guzzle 4. We won't be able to update Guzzle until we push our minimum PHP version requirements to at least 5.6, which we won't be doing until CB 2.2 or CB 3.0 (we haven't decided yet).

CB AntiSpam maybe somehow using a 3rd party Guzzle library instead of CBs. Will check the namespace usage to make sure that's not the case.

Edit: We have not modified the namespace path so yes it's possible an autoloader from a 3rd party extension could be causing their Guzzle library to load in favor of ours. Do you have anything else installed using Guzzle?

You can try quickfixing this below, but you may have other issues if Guzzle 6 is blocking our usage of Guzzle 4.

IN: components/com_comprofiler/plugin/libraries/CB/Plugin/AntiSpam/Captcha.php
ON: Line 385
FROM:
$response				=	$result->json();
TO:
$response				=	json_decode( $result->getBody() );


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.236 seconds

Facebook Twitter LinkedIn