Cachet: Timeout error connecting to SES

Created on 10 Mar 2017  路  25Comments  路  Source: CachetHQ/Cachet

I'm trying to setup subscriptions but when I try to subscribe the connection to SES is being timed out.

Looking at the logs I can see this:

production.ERROR: exception 'Swift_TransportException' with message 'Connection to tcp://email-smtp.us-east-1.amazonaws.com:465 Timed Out'

Surely this should be tls:// and not tcp:// as that is what the setting is in .env?

Bug Support

Most helpful comment

I solved the problem using 'ssl' instead 'tls' connection type.

All 25 comments

Are you setting MAIL_DRIVER to ses?

No it is set to smtp.

Setting to ses gives the same error.

@GrahamCampbell or @joecohens might be of more help here. I haven't used SES I'm afraid.

Thanks @jbrooksuk. SES is just like any other smtp server. The problem here seems to be the tcp:// bit when it really ought to be tls://.

https://medium.com/@dsabar/how-i-built-a-status-page-for-our-app-for-5-month-8951a1e65cd2#.d5uzivq73

This guy used SES :)

Well SES doesn't work for this guy so I have removed the subscribe option :-(

@GrahamCampbell do we have SES for StyleCI setup? Can you test this?

You should be able to set:

MAIL_DRIVER=ses
MAIL_USERNAME=SES_USERNAME
MAIL_PASSWORD=SES_PASSWORD

Well that give a different error but not one I understand!

I have double checked the credentials and they are definitely correct and the same as used on other services on the same server.

aws-sdk-invocation-id;aws-sdk-retry;host;x-amz-date
1ef37d3da410eb8dde6e1809c39cf73168db01c41e0002524bfb53d6bacdf1b5'

The String-to-Sign should have been
'AWS4-HMAC-SHA256
20170320T085024Z
20170320/us-east-1/email/aws4_request
5ddb4b4d3d8849cf49867684b44bf15cc21c8a167a6ede365fca905d1a90e2d4'
 - <ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <Error>
    <Type>Sender</Type>
    <Code>SignatureDoesNotMatch</Code>
    <Message>The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.

The Canonical String for this request should have been
'POST
/

aws-sdk-invocation-id:96b90e521b25b5127e67cd35f1da39c3
aws-sdk-retry:0/0
host:email.us-east-1.amazonaws.com
x-amz-date:20170320T085024Z

aws-sdk-invocation-id;aws-sdk-retry;host;x-amz-date
1ef37d3da410eb8dde6e1809c39cf73168db01c41e0002524bfb53d6bacdf1b5'

The String-to-Sign should have been
'AWS4-HMAC-SHA256
20170320T085024Z
20170320/us-east-1/email/aws4_request
5ddb4b4d3d8849cf49867684b44bf15cc21c8a167a6ede365fca905d1a90e2d4'
</Message>
  </Error>
  <RequestId>41f81e3d-0d4a-11e7-9c2d-4741a1bd8c66</RequestId>
</ErrorResponse>
' in /var/www/Cachet/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:192
Stack trace:
#0 /var/www/Cachet/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php(102): Aws\WrappedHttpHandler->parseError(Array, Object(GuzzleHttp\Psr7\Request), Object(Aws\Command), Array)
#1 /var/www/Cachet/vendor/guzzlehttp/promises/src/Promise.php(203): Aws\WrappedHttpHandler->Aws\{closure}(Array)
#2 /var/www/Cachet/vendor/guzzlehttp/promises/src/Promise.php(174): GuzzleHttp\Promise\Promise::callHandler(2, Array, Array)
#3 /var/www/Cachet/vendor/guzzlehttp/promises/src/RejectedPromise.php(40): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}(Array)
#4 /var/www/Cachet/vendor/guzzlehttp/promises/src/TaskQueue.php(61): GuzzleHttp\Promise\RejectedPromise::GuzzleHttp\Promise\{closure}()
#5 /var/www/Cachet/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(96): GuzzleHttp\Promise\TaskQueue->run()
#6 /var/www/Cachet/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(123): GuzzleHttp\Handler\CurlMultiHandler->tick()
#7 /var/www/Cachet/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\Handler\CurlMultiHandler->execute(true)
#8 /var/www/Cachet/vendor/guzzlehttp/promises/src/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn()
#9 /var/www/Cachet/vendor/guzzlehttp/promises/src/Promise.php(266): GuzzleHttp\Promise\Promise->waitIfPending()
#10 /var/www/Cachet/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#11 /var/www/Cachet/vendor/guzzlehttp/promises/src/Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending()
#12 /var/www/Cachet/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#13 /var/www/Cachet/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#14 /var/www/Cachet/vendor/aws/aws-sdk-php/src/AwsClientTrait.php(59): GuzzleHttp\Promise\Promise->wait()
#15 /var/www/Cachet/vendor/aws/aws-sdk-php/src/AwsClientTrait.php(78): Aws\AwsClient->execute(Object(Aws\Command))
#16 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Mail/Transport/SesTransport.php(40): Aws\AwsClient->__call('sendRawEmail', Array)
#17 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Mail/Transport/SesTransport.php(40): Aws\Ses\SesClient->sendRawEmail(Array)
#18 /var/www/Cachet/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(85): Illuminate\Mail\Transport\SesTransport->send(Object(Swift_Message), Array)
#19 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(385): Swift_Mailer->send(Object(Swift_Message), Array)
#20 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(171): Illuminate\Mail\Mailer->sendSwiftMessage(Object(Swift_Message))
#21 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(276): Illuminate\Mail\Mailer->send(Array, Array, Object(Closure))
#22 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(130): Illuminate\Mail\Mailer->handleQueuedMessage(Object(Illuminate\Queue\Jobs\SyncJob), Array)
#23 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SyncJob.php(44): Illuminate\Queue\Jobs\Job->resolveAndFire(Array)
#24 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php(30): Illuminate\Queue\Jobs\SyncJob->fire()
#25 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(187): Illuminate\Queue\SyncQueue->push('mailer@handleQu...', Array, NULL)
#26 /var/www/Cachet/app/Bus/Handlers/Events/Subscriber/SendSubscriberVerificationEmailHandler.php(59): Illuminate\Mail\Mailer->queue(Array, Array, Object(Closure))
#27 [internal function]: CachetHQ\Cachet\Bus\Handlers\Events\Subscriber\SendSubscriberVerificationEmailHandler->handle(Object(CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasSubscribedEvent))
#28 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(348): call_user_func_array(Array, Array)
#29 [internal function]: Illuminate\Events\Dispatcher->Illuminate\Events\{closure}(Object(CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasSubscribedEvent))
#30 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(221): call_user_func_array(Object(Closure), Array)
#31 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(419): Illuminate\Events\Dispatcher->fire(Object(CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasSubscribedEvent), Array, false)
#32 /var/www/Cachet/app/Bus/Handlers/Commands/Subscriber/SubscribeSubscriberCommandHandler.php(62): event(Object(CachetHQ\Cachet\Bus\Events\Subscriber\SubscriberHasSubscribedEvent))
#33 [internal function]: CachetHQ\Cachet\Bus\Handlers\Commands\Subscriber\SubscribeSubscriberCommandHandler->handle(Object(CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand))
#34 /var/www/Cachet/vendor/alt-three/bus/src/Dispatcher.php(225): call_user_func(Array, Object(CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand))
#35 [internal function]: AltThree\Bus\Dispatcher->AltThree\Bus\{closure}(Object(CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand))
#36 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(150): call_user_func(Object(Closure), Object(CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand))
#37 /var/www/Cachet/app/Bus/Middleware/UseDatabaseTransactions.php(35): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand))
#38 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Database/Connection.php(527): CachetHQ\Cachet\Bus\Middleware\UseDatabaseTransactions->CachetHQ\Cachet\Bus\Middleware\{closure}(Object(Illuminate\Database\MySqlConnection))
#39 [internal function]: Illuminate\Database\Connection->transaction(Object(Closure))
#40 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(317): call_user_func_array(Array, Array)
#41 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(217): Illuminate\Database\DatabaseManager->__call('transaction', Array)
#42 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(217): Illuminate\Database\DatabaseManager->transaction(Object(Closure))
#43 /var/www/Cachet/app/Bus/Middleware/UseDatabaseTransactions.php(36): Illuminate\Support\Facades\Facade::__callStatic('transaction', Array)
#44 /var/www/Cachet/app/Bus/Middleware/UseDatabaseTransactions.php(36): Illuminate\Support\Facades\DB::transaction(Object(Closure))
#45 [internal function]: CachetHQ\Cachet\Bus\Middleware\UseDatabaseTransactions->handle(Object(CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand), Object(Closure))
#46 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#47 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand))
#48 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand))
#49 /var/www/Cachet/vendor/alt-three/bus/src/Dispatcher.php(226): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#50 /var/www/Cachet/vendor/alt-three/bus/src/Dispatcher.php(201): AltThree\Bus\Dispatcher->dispatchNow(Object(CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand), NULL)
#51 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(323): AltThree\Bus\Dispatcher->dispatch(Object(CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand))
#52 /var/www/Cachet/app/Http/Controllers/SubscribeController.php(63): dispatch(Object(CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand))
#53 [internal function]: CachetHQ\Cachet\Http\Controllers\SubscribeController->postSubscribe()
#54 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(80): call_user_func_array(Array, Array)
#55 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(146): Illuminate\Routing\Controller->callAction('postSubscribe', Array)
#56 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(94): Illuminate\Routing\ControllerDispatcher->call(Object(CachetHQ\Cachet\Http\Controllers\SubscribeController), Object(Illuminate\Routing\Route), 'postSubscribe')
#57 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#58 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#59 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#60 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#61 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(96): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#62 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(54): Illuminate\Routing\ControllerDispatcher->callWithinStack(Object(CachetHQ\Cachet\Http\Controllers\SubscribeController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'postSubscribe')
#63 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Route.php(174): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'CachetHQ\\Cachet...', 'postSubscribe')
#64 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Route.php(140): Illuminate\Routing\Route->runController(Object(Illuminate\Http\Request))
#65 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Router.php(724): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#66 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#67 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#68 /var/www/Cachet/app/Http/Middleware/SubscribersConfigured.php(34): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#69 [internal function]: CachetHQ\Cachet\Http\Middleware\SubscribersConfigured->handle(Object(Illuminate\Http\Request), Object(Closure))
#70 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#71 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#72 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#73 /var/www/Cachet/app/Http/Middleware/Localize.php(59): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#74 [internal function]: CachetHQ\Cachet\Http\Middleware\Localize->handle(Object(Illuminate\Http\Request), Object(Closure))
#75 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#76 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#77 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#78 /var/www/Cachet/app/Http/Middleware/ReadyForUse.php(40): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#79 [internal function]: CachetHQ\Cachet\Http\Middleware\ReadyForUse->handle(Object(Illuminate\Http\Request), Object(Closure))
#80 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#81 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#82 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#83 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(64): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#84 [internal function]: Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#85 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#86 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#87 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#88 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#89 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#90 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#91 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#92 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#93 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(62): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#94 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#95 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#96 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#97 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#98 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#99 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#100 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#101 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#102 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#103 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#104 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#105 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#106 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#107 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#108 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#109 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#110 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Router.php(726): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#111 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Router.php(699): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#112 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Router.php(675): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#113 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(246): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#114 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#115 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#116 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(44): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#117 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#118 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#119 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#120 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#121 /var/www/Cachet/vendor/fideloper/proxy/src/TrustProxies.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#122 [internal function]: Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#123 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#124 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#125 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#126 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#127 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#128 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(132): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#129 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(99): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#130 /var/www/Cachet/public/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#131 {main} {"identification":{"id":"94ae4e8b-99cf-499f-9446-ee991c5b2b43"}} 

The error says:

Check your AWS Secret Access Key and signing method

I know you say you're using them already, but can you check it's all configured correctly 100% on your side and AWS?

So to prove that the credentials are correct I installed PHPMailer into the Cachet folder and the put the following script into /public. I copied the credentials from the /.env file. Because I don't want my SES credentials in Github I have removed them from here and you will have to trust that I am capable of cutting and pasting!

When I ran the script originally I got a time out just like I do with Cachet. However when I added "tls://" to the host name it worked.

Therefore, I can be certain that the credentials in the .env file are correct.

I still believe that the underlying issue is that the hostname is being prefixed by tcp:// rather than tls://.

<?php

        require_once('../PHPmailer/class.phpmailer.php');

        $mail = new PHPMailer();
        $mail->IsSMTP(true); // SMTP
        $mail->SMTPAuth   = true;  // SMTP authentication
        $mail->Mailer = "smtp";
        $mail->isHTML(true);
        $mail->Host = "tls://email-smtp.us-east-1.amazonaws.com"; // Amazon SES
        $mail->Port = "465";  // SMTP Port
        $mail->Username = "username from .env";  // SMTP  Username
        $mail->Password = "password from .env";  // SMTP Password
        $mail->From = "email address from .env";
        $mail->AddReplyTo = "email address from .env";
        $mail->Subject = "Test";
        $mail->MsgHTML("Test");
        $mail->AddAddress("my email address");

        // send the email
        if($mail->Send()) {
           echo "Success";
        } else {
           echo "Failure: ".$mail->ErrorInfo;
        }
?>

@GrahamCampbell any idea what's going on here?

@williamsdb Can you try to send an email using the same credentials on a fresh Laravel installation please? Just so we can detect if this is a Cachet bug, Laravel bug or a credential permission error? Thanks!

@joecohens if you can tell me how to do that then yes.

@williamsdb I'm having the same issue and did the same verification with PHPMailer, did you have any further developments?

@mekantor no for now I have switched off that functionality. Happy to try with a fresh Laravel installation as @joecohens suggested but I don't know how to do that.

If you pull down the latest 2.4 branch does it fix it? I've seen the aws/aws-sdk-php package has updated a few times.

Let us know if this is still an issue!

No this still gives an error (latest tag seems to be 2.3.9), although it times out immediately now. My test script still works so I know credentials are correct.

Next exception 'Aws\Ses\Exception\SesException' with message 'Error executing "SendRawEmail" on "https://email.us-east-1
.amazonaws.com"; AWS HTTP error: Client error: `POST https://email.us-east-1.amazonaws.com` resulted in a `403 Forbidden
` response:
<ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <Error>
    <Type>Sender</Type>
    <Code>SignatureDo (truncated...)
 SignatureDoesNotMatch (client): The request signature we calculated does not match the signature you provided. Check yo
ur AWS Secret Access Key and signing method. Consult the service documentation for details.

The Canonical String for this request should have been
'POST
/

aws-sdk-invocation-id:9686fba4c6eeeeb6d679100cd959c658
aws-sdk-retry:0/0
host:email.us-east-1.amazonaws.com
x-amz-date:20170718T072528Z

aws-sdk-invocation-id;aws-sdk-retry;host;x-amz-date
08a1047a7af030eb055bac3c75740cf4de8497597108b2cedfdc7f4cf16afa0c'

The String-to-Sign should have been
'AWS4-HMAC-SHA256

Unfortunately not as this is just where the credentials are incorrect and I know these are right as sending through PHPMailer with them from the same server works. No big deal. I'll just leave the functionality off.

Seems strange though!

Same problem :(

I solved the problem using 'ssl' instead 'tls' connection type.

@alvarocduquia can you tell which .env variable has to set for this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

saamo picture saamo  路  5Comments

brianjking picture brianjking  路  4Comments

GentillePlume picture GentillePlume  路  3Comments

jbrooksuk picture jbrooksuk  路  7Comments

marpme picture marpme  路  7Comments