October: Object of class GuzzleHttp\Psr7\Response could not be converted to string

Created on 25 Jul 2016  路  11Comments  路  Source: octobercms/october

Expected behavior

After sending an email with Mailgun I get successfull flash message.

Actual behavior

After sending an email with Mailgun I get exception:

Object of class GuzzleHttp\Psr7\Response could not be converted to string

Reproduce steps
  1. Install October.Drivers Plugin.
  2. Configure Mail Settings to use Mailgun driver.
  3. Send test email.
    October build

350, PHP 7

High Available Bug

Most helpful comment

Hello

Thank You for letting me know about this issue! It has now been fixed on my end. Here's the exact commit if You're interested.

Cheers!

All 11 comments

Unable to replicate, getting error:

Client error: POST https://api.mailgun.net/v3/sdfasdf/messages.mime resulted in a 401 UNAUTHORIZED response: Forbidden

Can you confirm, with invalid details entered do you get the same error?

When I change domain to rubbish I got the same response as you do.

When I return to correct credentials I got:

Object of class GuzzleHttp\Psr7\Response could not be converted to string

The mail is delivered even with this error.

Maybe what I should mention earlier, I use composer base project and I received following warning on composer update:

Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead.

Both libraries are downloaded by composer.

Interesting, we don't seem to include that package anywhere. Can you please email some valid credentials to sam [at] daftspunk.com for testing.

After further investigation I noticed that guzzle/guzzle is downloaded from this package:

"league/flysystem-rackspace": "~1.0",

When I remove this line and run composer update guzzle/guzzle is removed. I done this in plugin directory and for the main directory but this still does not solve the issue.

I sent you credentials for testing.

Thanks, will take a look soon!

I have been getting this for a very long time now. Has made so many contact plugins unusable and I am very frustrated. @daftspunk thank you SO MUCH for looking into this, this is literally the ONLY frustration I have been having with October. Luckily the contact form still sends but the error pops up. My clients haven't called me out on it yet thankfully.

You're the best! (:

Here is the exact error:

IMG

I'm still not getting this error, even with the Mailgun credentials provided by @mplodowski. Can you please specify what plugins you have installed? It could be creating a conflict. Also make sure you have the latest October.Drivers plugin installed (try reinstalling it).

Replication steps

  1. Open backend area
  2. Using Mailgun mail driver
  3. Navigate to Mail templates
  4. Open a template
  5. Click send test message
  6. Message has been sent successfully

@daftspunk unbelievable! It was the Mail States & Logger plugin - Just disabled that and the error message went away!

What a shame, really enjoyed being able to view additional stats with the plugin. I guess this is what happens when plugins get abandoned though.

Sorry to be an inconvenience Samuel! This is the second time I have encountered a 3rd party plugin causing major errors to October where it wasn't at all apparent. Damn 馃槩 is there any way to make error messages like that also echo back what plugin author it is coming from? That would prevent things like this in the future?

Maybe you can ask the author to update their plugin, because it uses an old version of Guzzle. It should be simple as rebuilding it, I think.

I just left an issue on their repo referencing this issue. Appreciate the quick response!

Hello

Thank You for letting me know about this issue! It has now been fixed on my end. Here's the exact commit if You're interested.

Cheers!

Was this page helpful?
0 / 5 - 0 ratings