google-cloud-php: google/cloud-pubsub cURL error 35 gnutls_handshake
The package google/cloud-core, which is used by google/cloud-pubsub, is throwing the exception referenced below from time to time.
I’m using a PHP flex environment:
- PHP 7.2.18
- curl 7.52.1
exception: "Google\Cloud\Core\Exception\ServiceException: cURL error 35: gnutls_handshake() failed: The TLS connection was non-properly terminated. (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in /app/symfony/vendor/google/cloud-core/src/RequestWrapper.php:263
Stack trace:
#0 /app/symfony/vendor/google/cloud-core/src/RequestWrapper.php(168): Google\Cloud\Core\RequestWrapper->convertToGoogleException(Object(GuzzleHttp\Exception\ConnectException))
#1 /app/symfony/vendor/google/cloud-core/src/RestTrait.php(95): Google\Cloud\Core\RequestWrapper->send(Object(GuzzleHttp\Psr7\Request), Array)
#2 /app/symfony/vendor/google/cloud-logging/src/Connection/Rest.php(60): Google\Cloud\Logging\Connection\Rest->send('entries', 'write', Array)
#3 /app/symfony/vendor/google/cloud-logging/src/Logger.php(389): Google\Cloud\Logging\Connection\Rest->writeEntries(Array)
#4 /app/symfony/vendor/google/cloud-logging/src/Logger.php(358): Google\Cloud\Logging\Logger->writeBatch(Array, Array)
#5 /app/symfony/vendor/google/cloud-logging/src/PsrLogger.php(528): Google\Cloud\Logging\Logger->write(Object(Google\Cloud\Logging\Entry))
#6 /app/symfony/vendor/google/cloud-logging/src/PsrLogger.php(413): Google\Cloud\Logging\PsrLogger->sendEntry(Object(Google\Cloud\Logging\Entry))
#7 /app/symfony/src/Services/StackDriverHandler.php(58): Google\Cloud\Logging\PsrLogger->log('critical', 'Uncaught PHP Ex...', Array)
#8 /app/symfony/vendor/monolog/monolog/src/Monolog/Logger.php(337): App\Services\StackDriverHandler->handle(Array)
#9 /app/symfony/vendor/monolog/monolog/src/Monolog/Logger.php(644): Monolog\Logger->addRecord(500, 'Uncaught PHP Ex...', Array)
#10 /app/symfony/vendor/symfony/http-kernel/EventListener/ExceptionListener.php(108): Monolog\Logger->critical('Uncaught PHP Ex...', Array)
#11 /app/symfony/vendor/symfony/http-kernel/EventListener/ExceptionListener.php(48): Symfony\Component\HttpKernel\EventListener\ExceptionListener->logException(Object(Google\Cloud\Core\Exception\ServiceException), 'Uncaught PHP Ex...')
#12 /app/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php(212): Symfony\Component\HttpKernel\EventListener\ExceptionListener->logKernelException(Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent), 'kernel.exceptio...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#13 /app/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.exceptio...', Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent))
#14 /app/symfony/vendor/symfony/http-kernel/HttpKernel.php(219): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.exceptio...', Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent))
#15 /app/symfony/vendor/symfony/http-kernel/HttpKernel.php(77): Symfony\Component\HttpKernel\HttpKernel->handleException(Object(Google\Cloud\Core\Exception\ServiceException), Object(Symfony\Component\HttpFoundation\Request), 1)
#16 /app/symfony/vendor/symfony/http-kernel/Kernel.php(188): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /app/symfony/public/index.php(34): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#18 {main}"
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 15 (3 by maintainers)
Having this issue myself, for quite some time, but it’s starting to get extremely annoying.
I’m on App Engine Flex PHP 7.3 (pretty much the official Google App Engine PHP Docker image…)
We have a Laravel Artisan command that runs once a day (at around 3am) and stores several files on Google Storage, therefore it performs several uploads, around 500, more or less.
The uploaded files are not that big, are gzipped and are on average around 5kb.
Noticed that while this still happens during the week, is not every single day and can go the entire week without problems sometimes, but during the weekends, it usually fails, a lot.
Here’s the stack (similar as above)
Anything i can help to identify the culprit of this? It seems to be caused only (as far as i can tell) for the PHP libraries, the Java one for example, seems to works as expected without major disruptions.
@meredithslota I personally do not have this issue anymore 😃
Should be OpenSSL, but i’ve not manually compiled it though, just installed both curl and then the php extension and that’s it.