I have an empty Job file:
<?php
namespace SS\Jobs;
use Exception;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Log;
class SJQJob implements ShouldQueue
{
protected $payload;
public function __construct($payload)
{
$this->payload = $payload;
}
public function handle()
{
Log::info('!!!! Handle');
}
public function failed(Exception $exception)
{
Log::info('!!!! Failed');
}
}
I am dispatching this, then using php artisan queue:work ssqjobrequest
I can see it being processed (2020-07-29 16:43:07][06978486-4c62-3948-5b4a-f8c648038c34] Processing: SS\Jobs\SJQJob
)
The problem is that I am seeing this message in the log:
2020-07-29 16:43:07] local.ERROR: Error executing "DeleteMessage" on "http://localstack.test:4576/000000000000/ssqjobrequest"; AWS HTTP error: Client error: `POST http://localstack.test:4576/000000000000/ssqjobrequest` resulted in a `400 Bad Request` response:
<?xml version="1.0" encoding="UTF-8"?>
<ErrorResponse>
<Errors>
<Error>
<Code>ReceiptHandleIsInvalid (truncated...)
ReceiptHandleIsInvalid (client): The input receipt handle is invalid. - <?xml version="1.0" encoding="UTF-8"?>
<ErrorResponse>
<Errors>
<Error>
<Code>ReceiptHandleIsInvalid</Code>
<Message>The input receipt handle is invalid.</Message>
</Error>
</Errors>
<RequestID>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</RequestID>
</ErrorResponse> {"exception":"[object] (Aws\\Sqs\\Exception\\SqsException(code: 0): Error executing \"DeleteMessage\" on \"http://localstack.test:4576/000000000000/ssqjobrequest\"; AWS HTTP error: Client error: `POST http://localstack.test:4576/000000000000/ssqjobrequest` resulted in a `400 Bad Request` response:
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<ErrorResponse>
<Errors>
<Error>
<Code>ReceiptHandleIsInvalid (truncated...)
ReceiptHandleIsInvalid (client): The input receipt handle is invalid. - <?xml version=\"1.0\" encoding=\"UTF-8\"?>
<ErrorResponse>
<Errors>
<Error>
<Code>ReceiptHandleIsInvalid</Code>
<Message>The input receipt handle is invalid.</Message>
</Error>
</Errors>
<RequestID>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</RequestID>
</ErrorResponse> at /var/www/sst/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:195)
[stacktrace]
#0 /var/www/sst/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php(97): Aws\\WrappedHttpHandler->parseError()
#1 /var/www/sst/vendor/guzzlehttp/promises/src/Promise.php(198): Aws\\WrappedHttpHandler->Aws\\{closure}()
#2 /var/www/sst/vendor/guzzlehttp/promises/src/Promise.php(169): GuzzleHttp\\Promise\\Promise::callHandler()
#3 /var/www/sst/vendor/guzzlehttp/promises/src/RejectedPromise.php(40): GuzzleHttp\\Promise\\Promise::GuzzleHttp\\Promise\\{closure}()
#4 /var/www/sst/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\\Promise\\RejectedPromise::GuzzleHttp\\Promise\\{closure}()
#5 /var/www/sst/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(118): GuzzleHttp\\Promise\\TaskQueue->run()
#6 /var/www/sst/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(145): GuzzleHttp\\Handler\\CurlMultiHandler->tick()
#7 /var/www/sst/vendor/guzzlehttp/promises/src/Promise.php(241): GuzzleHttp\\Handler\\CurlMultiHandler->execute()
#8 /var/www/sst/vendor/guzzlehttp/promises/src/Promise.php(218): GuzzleHttp\\Promise\\Promise->invokeWaitFn()
#9 /var/www/sst/vendor/guzzlehttp/promises/src/Promise.php(262): GuzzleHttp\\Promise\\Promise->waitIfPending()
#10 /var/www/sst/vendor/guzzlehttp/promises/src/Promise.php(220): GuzzleHttp\\Promise\\Promise->invokeWaitList()
#11 /var/www/sst/vendor/guzzlehttp/promises/src/Promise.php(262): GuzzleHttp\\Promise\\Promise->waitIfPending()
#12 /var/www/sst/vendor/guzzlehttp/promises/src/Promise.php(220): GuzzleHttp\\Promise\\Promise->invokeWaitList()
#13 /var/www/sst/vendor/guzzlehttp/promises/src/Promise.php(61): GuzzleHttp\\Promise\\Promise->waitIfPending()
#14 /var/www/sst/vendor/aws/aws-sdk-php/src/AwsClientTrait.php(58): GuzzleHttp\\Promise\\Promise->wait()
#15 /var/www/sst/vendor/aws/aws-sdk-php/src/AwsClientTrait.php(86): Aws\\AwsClient->execute()
#16 /var/www/sst/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SqsJob.php(71): Aws\\AwsClient->__call()
#17 /var/www/sst/vendor/dusterio/laravel-plain-sqs/src/Integrations/LaravelServiceProvider.php(28): Illuminate\\Queue\\Jobs\\SqsJob->delete()
#18 /var/www/sst/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(369): Dusterio\\PlainSqs\\Integrations\\LaravelServiceProvider->Dusterio\\PlainSqs\\Integrations\\{closure}()
#19 /var/www/sst/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(218): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}()
#20 /var/www/sst/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(509): Illuminate\\Events\\Dispatcher->dispatch()
#21 /var/www/sst/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(370): Illuminate\\Queue\\Worker->raiseAfterJobEvent()
#22 /var/www/sst/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(314): Illuminate\\Queue\\Worker->process()
#23 /var/www/sst/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(134): Illuminate\\Queue\\Worker->runJob()
#24 /var/www/sst/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(112): Illuminate\\Queue\\Worker->daemon()
#25 /var/www/sst/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(96): Illuminate\\Queue\\Console\\WorkCommand->runWorker()
#26 [internal function]: Illuminate\\Queue\\Console\\WorkCommand->handle()
#27 /var/www/sst/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array()
#28 /var/www/sst/vendor/laravel/framework/src/Illuminate/Container/Util.php(36): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#29 /var/www/sst/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\\Container\\Util::unwrapIfClosure()
#30 /var/www/sst/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\\Container\\BoundMethod::callBoundMethod()
#31 /var/www/sst/vendor/laravel/framework/src/Illuminate/Container/Container.php(590): Illuminate\\Container\\BoundMethod::call()
#32 /var/www/sst/vendor/laravel/framework/src/Illuminate/Console/Command.php(134): Illuminate\\Container\\Container->call()
#33 /var/www/sst/vendor/symfony/console/Command/Command.php(255): Illuminate\\Console\\Command->execute()
#34 /var/www/sst/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\\Component\\Console\\Command\\Command->run()
#35 /var/www/sst/vendor/symfony/console/Application.php(1001): Illuminate\\Console\\Command->run()
#36 /var/www/sst/vendor/symfony/console/Application.php(271): Symfony\\Component\\Console\\Application->doRunCommand()
#37 /var/www/sst/vendor/symfony/console/Application.php(147): Symfony\\Component\\Console\\Application->doRun()
#38 /var/www/sst/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\\Component\\Console\\Application->run()
#39 /var/www/sst/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(131): Illuminate\\Console\\Application->run()
#40 /var/www/sst/artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle()
I am not trying to delete anything (so I guess that laravel tries to delete the message from Amazon SQS) .. but why does it fail? I have checked and the message gets there .. so why would it fail when trying to delete it ?
Thanks!
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire