Skip to content

[Error] AWS HTTP error: Client error: POST resulted in a 410 Gone response #9

@mikebronner

Description

@mikebronner
Contributor

Thank you for this package! I'm using it in conjunction with Laravel Vapor.
I'm receiving the following error intermittently, multiple times per day:

Aws\ApiGatewayManagementApi\Exception\ApiGatewayManagementApiException Error executing "PostToConnection" on "https://xxxxx.execute-api.us-east-1.amazonaws.com/yyyyy/@connections/DOvZ1cdTIAMCLtA%3D"; AWS HTTP error: Client error: `POST https://xxxxx.execute-api.us-east-1.amazonaws.com/yyyyy/@connections/DOvZ1cdTIAMCLtA%3D` resulted in a `410 Gone` response Unable to parse error information from response - Error parsing JSON: Syntax error
     vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:195 Aws\WrappedHttpHandler::parseError
     vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:97 Aws\WrappedHttpHandler::Aws\{closure}
     vendor/guzzlehttp/promises/src/Promise.php:204 GuzzleHttp\Promise\Promise::callHandler
     vendor/guzzlehttp/promises/src/Promise.php:169 GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}
     vendor/guzzlehttp/promises/src/RejectedPromise.php:42 GuzzleHttp\Promise\RejectedPromise::GuzzleHttp\Promise\{closure}
     vendor/guzzlehttp/promises/src/TaskQueue.php:48 GuzzleHttp\Promise\TaskQueue::run
     vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:158 GuzzleHttp\Handler\CurlMultiHandler::tick
     vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:183 GuzzleHttp\Handler\CurlMultiHandler::execute
     vendor/guzzlehttp/promises/src/Promise.php:248 GuzzleHttp\Promise\Promise::invokeWaitFn
     vendor/guzzlehttp/promises/src/Promise.php:224 GuzzleHttp\Promise\Promise::waitIfPending
     vendor/guzzlehttp/promises/src/Promise.php:269 GuzzleHttp\Promise\Promise::invokeWaitList
     vendor/guzzlehttp/promises/src/Promise.php:226 GuzzleHttp\Promise\Promise::waitIfPending
     vendor/guzzlehttp/promises/src/Promise.php:269 GuzzleHttp\Promise\Promise::invokeWaitList
     vendor/guzzlehttp/promises/src/Promise.php:226 GuzzleHttp\Promise\Promise::waitIfPending
     vendor/guzzlehttp/promises/src/Promise.php:62 GuzzleHttp\Promise\Promise::wait
     vendor/aws/aws-sdk-php/src/AwsClientTrait.php:58 Aws\AwsClient::execute
     vendor/aws/aws-sdk-php/src/AwsClientTrait.php:86 Aws\AwsClient::__call
     vendor/georgeboot/laravel-echo-api-gateway/src/ConnectionRepository.php:23 Georgeboot\LaravelEchoApiGateway\ConnectionRepository::sendMessage
     vendor/georgeboot/laravel-echo-api-gateway/src/Handler.php:140 Georgeboot\LaravelEchoApiGateway\Handler::sendMessage
     vendor/georgeboot/laravel-echo-api-gateway/src/Handler.php:66 Georgeboot\LaravelEchoApiGateway\Handler::handleMessage
     vendor/georgeboot/laravel-echo-api-gateway/src/Handler.php:32 Georgeboot\LaravelEchoApiGateway\Handler::handleWebsocket
     vendor/bref/bref/src/Event/ApiGateway/WebsocketHandler.php:19 Bref\Event\ApiGateway\WebsocketHandler::handle
     vendor/georgeboot/laravel-echo-api-gateway/src/Commands/VaporHandle.php:60 Georgeboot\LaravelEchoApiGateway\Commands\VaporHandle::handleWebsocketEvent
     vendor/georgeboot/laravel-echo-api-gateway/src/Commands/VaporHandle.php:52 Georgeboot\LaravelEchoApiGateway\Commands\VaporHandle::handle
     vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}
     vendor/laravel/framework/src/Illuminate/Container/Util.php:40 Illuminate\Container\Util::unwrapIfClosure
     vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93 Illuminate\Container\BoundMethod::callBoundMethod
     vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37 Illuminate\Container\BoundMethod::call
     vendor/laravel/framework/src/Illuminate/Container/Container.php:651 Illuminate\Container\Container::call
     vendor/laravel/framework/src/Illuminate/Console/Command.php:136 Illuminate\Console\Command::execute
     vendor/symfony/console/Command/Command.php:299 Symfony\Component\Console\Command\Command::run
     vendor/laravel/framework/src/Illuminate/Console/Command.php:121 Illuminate\Console\Command::run
     vendor/symfony/console/Application.php:978 Symfony\Component\Console\Application::doRunCommand
     vendor/symfony/console/Application.php:295 Symfony\Component\Console\Application::doRun
     vendor/symfony/console/Application.php:167 Symfony\Component\Console\Application::run
     vendor/laravel/framework/src/Illuminate/Console/Application.php:92 Illuminate\Console\Application::run
     vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:129 Illuminate\Foundation\Console\Kernel::handle
     artisan:43 [main]

Caused by: GuzzleHttp\Exception\ClientException Client error: `POST https://xxxxx.execute-api.us-east-1.amazonaws.com/yyyyy/@connections/DOvZ1cdTIAMCLtA%3D` resulted in a `410 Gone` response
     vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113 GuzzleHttp\Exception\RequestException::create
     vendor/guzzlehttp/guzzle/src/Middleware.php:69 GuzzleHttp\Middleware::GuzzleHttp\{closure}
     vendor/guzzlehttp/promises/src/Promise.php:204 GuzzleHttp\Promise\Promise::callHandler
     vendor/guzzlehttp/promises/src/Promise.php:153 GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}
     vendor/guzzlehttp/promises/src/TaskQueue.php:48 GuzzleHttp\Promise\TaskQueue::run
     vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:158 GuzzleHttp\Handler\CurlMultiHandler::tick
     vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:183 GuzzleHttp\Handler\CurlMultiHandler::execute
     vendor/guzzlehttp/promises/src/Promise.php:248 GuzzleHttp\Promise\Promise::invokeWaitFn
     vendor/guzzlehttp/promises/src/Promise.php:224 GuzzleHttp\Promise\Promise::waitIfPending
     vendor/guzzlehttp/promises/src/Promise.php:269 GuzzleHttp\Promise\Promise::invokeWaitList
     vendor/guzzlehttp/promises/src/Promise.php:226 GuzzleHttp\Promise\Promise::waitIfPending
     vendor/guzzlehttp/promises/src/Promise.php:269 GuzzleHttp\Promise\Promise::invokeWaitList
     vendor/guzzlehttp/promises/src/Promise.php:226 GuzzleHttp\Promise\Promise::waitIfPending
     vendor/guzzlehttp/promises/src/Promise.php:62 GuzzleHttp\Promise\Promise::wait
     vendor/aws/aws-sdk-php/src/AwsClientTrait.php:58 Aws\AwsClient::execute
     vendor/aws/aws-sdk-php/src/AwsClientTrait.php:86 Aws\AwsClient::__call
     vendor/georgeboot/laravel-echo-api-gateway/src/ConnectionRepository.php:23 Georgeboot\LaravelEchoApiGateway\ConnectionRepository::sendMessage
     vendor/georgeboot/laravel-echo-api-gateway/src/Handler.php:140 Georgeboot\LaravelEchoApiGateway\Handler::sendMessage
     vendor/georgeboot/laravel-echo-api-gateway/src/Handler.php:66 Georgeboot\LaravelEchoApiGateway\Handler::handleMessage
     vendor/georgeboot/laravel-echo-api-gateway/src/Handler.php:32 Georgeboot\LaravelEchoApiGateway\Handler::handleWebsocket
     vendor/bref/bref/src/Event/ApiGateway/WebsocketHandler.php:19 Bref\Event\ApiGateway\WebsocketHandler::handle
     vendor/georgeboot/laravel-echo-api-gateway/src/Commands/VaporHandle.php:60 Georgeboot\LaravelEchoApiGateway\Commands\VaporHandle::handleWebsocketEvent
     vendor/georgeboot/laravel-echo-api-gateway/src/Commands/VaporHandle.php:52 Georgeboot\LaravelEchoApiGateway\Commands\VaporHandle::handle
     vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}
     vendor/laravel/framework/src/Illuminate/Container/Util.php:40 Illuminate\Container\Util::unwrapIfClosure
     vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93 Illuminate\Container\BoundMethod::callBoundMethod
     vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37 Illuminate\Container\BoundMethod::call
     vendor/laravel/framework/src/Illuminate/Container/Container.php:651 Illuminate\Container\Container::call
     vendor/laravel/framework/src/Illuminate/Console/Command.php:136 Illuminate\Console\Command::execute
     vendor/symfony/console/Command/Command.php:299 Symfony\Component\Console\Command\Command::run
     vendor/laravel/framework/src/Illuminate/Console/Command.php:121 Illuminate\Console\Command::run
     vendor/symfony/console/Application.php:978 Symfony\Component\Console\Application::doRunCommand
     vendor/symfony/console/Application.php:295 Symfony\Component\Console\Application::doRun
     vendor/symfony/console/Application.php:167 Symfony\Component\Console\Application::run
     vendor/laravel/framework/src/Illuminate/Console/Application.php:92 Illuminate\Console\Application::run
     vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:129 Illuminate\Foundation\Console\Kernel::handle
     artisan:43 [main]

I believe this has the side effect that the Laravel Echo event will not update the site when this error happens. I'm unclear as to what the cause might be.

Activity

changed the title [-][Error] AWS HTTP error: Client error: `POST https://xxxxxxx.execute-api.us-east-1.amazonaws.com/yyyyyyy/@connections/DOvZ1cdTIAMCLtA%3D` resulted in a `410 Gone` response Unable to parse error information from response[/-] [+][Error] AWS HTTP error: Client error: POST resulted in a `410 Gone` response[/+] on Jul 29, 2021
georgeboot

georgeboot commented on Jul 29, 2021

@georgeboot
Owner

Hi Mike, thanks for reporting!

I believe this is due to the connection being (unexpectedly) closed by the client. This is currently not handled by Echo.

I will investigate and see if I can fix this for you.

added a commit that references this issue on Jul 29, 2021
georgeboot

georgeboot commented on Jul 29, 2021

@georgeboot
Owner

@mikebronner can you please test the dev-master to verify this issue has been fixed now (e41a068)? Once I can confirm, I will tag a new version.

mikebronner

mikebronner commented on Jul 29, 2021

@mikebronner
ContributorAuthor

Hi @georgeboot, thank you so much for the ultra-quick response! :) I will update and monitor over the next few days and report back. Thank you!

mikebronner

mikebronner commented on Jul 29, 2021

@mikebronner
ContributorAuthor

Hi @georgeboot It appears we are still getting them. These might only be occurring when we are deploying, and not on every deployment. I wonder if this happens when vapor deploys midstream of an Echo event?

Update: may not be related to deployments after all. The latest error happened 5 minutes after the deployment completed.

georgeboot

georgeboot commented on Jul 29, 2021

@georgeboot
Owner

Yeah I think I am catching the exception incorrectly. But it's hard to catch because AWS doesn't document that topic very good (to my knowledge).

I will look further tomorrow.

mikebronner

mikebronner commented on Jul 29, 2021

@mikebronner
ContributorAuthor

NP, thank you for all your help with this!

Further Update:

This may be related to queued events on vapor. I have several failed queue jobs that triggered this error. I will keep monitoring this.

georgeboot

georgeboot commented on Jul 30, 2021

@georgeboot
Owner

Mind trying the latest master? AWS SDK has a funny way of handling exceptions but I believe it should be correct this time.

mikebronner

mikebronner commented on Jul 30, 2021

@mikebronner
ContributorAuthor

Absolutely, we'll get it in our next deployment today and keep monitoring. :)

georgeboot

georgeboot commented on Aug 3, 2021

@georgeboot
Owner

@mikebronner is the issue fixed now?

semsphy

semsphy commented on Aug 3, 2021

@semsphy

@mikebronner is the issue fixed now?

Nope. I just switched to dev-master and redeployed, I still got the error message in my log.

ERROR: Error executing "PostToConnection" on "https://xxxxx-api.ap-southeast-1.amazonaws.com/dev/@connections/DfbxWdFeyQ0CGKg%3D"; AWS HTTP error: Client error: `xxxxxx` resulted in a `403 Forbidden` response:
{"message":"Forbidden"}
georgeboot

georgeboot commented on Aug 3, 2021

@georgeboot
Owner

That is a different error. You previously got a 410 Gone, the one you are getting now is a 403 Forbidden.

semsphy

semsphy commented on Aug 3, 2021

@semsphy

That is a different error. You previously got a 410 Gone, the one you are getting now is a 403 Forbidden.

Whoop, let's me re-test and let's you know.

30 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jdavidbakr@semsphy@georgeboot@leob@mikebronner

        Issue actions

          [Error] AWS HTTP error: Client error: POST resulted in a `410 Gone` response · Issue #9 · georgeboot/laravel-echo-api-gateway