How Shlink is set-up
- Shlink Version: 2.7.0
- PHP Version: 8.0.6
- How do you serve Shlink: Self-hosted Docker image
- Database engine used: MySQL 5.7.22
Summary
Recently Shlink started reporting intermitence on our self-hosted service. We are using AWS ECS to deploy using official shlink docker image, mysql on RDS and Redis on ElasticCache.
We are using an API endpoint in order to generate short links, but its not wokring as expected. According to logs the only visible error is:
Shlink.ERROR - Predis\NotSupportedException: Cannot use 'MSET' over clusters of connections. in /etc/shlink/vendor/predis/predis/src/Connection/Aggregate/PredisCluster.php:134
Seems to be a problem with predis implementation.
Stack trace is below. Any help is greatly appreciated
1621877034521,[2021-05-24T17:23:54.520840+00:00] [18ec5525-6c25-4d84-a080-329638785be8] Shlink.ERROR - Predis\NotSupportedException: Cannot use 'MSET' over clusters of connections. in /etc/shlink/vendor/predis/predis/src/Connection/Aggregate/PredisCluster.php:134
1621877034521,Stack trace:
1621877034521,#0 /etc/shlink/vendor/predis/predis/src/Connection/Aggregate/PredisCluster.php(215): Predis\Connection\Aggregate\PredisCluster->getConnection(Object(Predis\Command\StringSetMultiple))
1621877034521,#1 /etc/shlink/vendor/predis/predis/src/Client.php(331): Predis\Connection\Aggregate\PredisCluster->executeCommand(Object(Predis\Command\StringSetMultiple))
1621877034521,#2 /etc/shlink/vendor/predis/predis/src/Client.php(314): Predis\Client->executeCommand(Object(Predis\Command\StringSetMultiple))
1621877034521,"#3 /etc/shlink/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PredisCache.php(78): Predis\Client->__call('mset', Array)"
1621877034521,"#4 /etc/shlink/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php(99): Doctrine\Common\Cache\PredisCache->doSaveMultiple(Array, 0)"
1621877034521,"#5 /etc/shlink/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php(305): Doctrine\Common\Cache\CacheProvider->saveMultiple(Array, 0)"
1621877034521,"#6 /etc/shlink/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php(215): Doctrine\Common\Cache\Psr6\CacheAdapter->doSaveMultiple(Array, 0)"
1621877034521,#7 /etc/shlink/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php(91): Doctrine\Common\Cache\Psr6\CacheAdapter->commit()
1621877034521,#8 /etc/shlink/vendor/doctrine/persistence/lib/Doctrine/Persistence/Mapping/AbstractClassMetadataFactory.php(258): Doctrine\Common\Cache\Psr6\CacheAdapter->getItems(Array)
1621877034521,#9 /etc/shlink/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(300): Doctrine\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor('Shlinkio\Shlink...')
1621877034521,#10 /etc/shlink/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1290): Doctrine\ORM\EntityManager->getClassMetadata('Shlinkio\Shlink...')
1621877034521,#11 /etc/shlink/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(396): Doctrine\ORM\UnitOfWork->getCommitOrder()
1621877034521,#12 /etc/shlink/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(383): Doctrine\ORM\UnitOfWork->commit(NULL)
1621877034521,#13 /etc/shlink/vendor/doctrine/orm/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php(181): Doctrine\ORM\EntityManager->flush(NULL)
1621877034521,#14 /etc/shlink/module/Core/src/Visit/VisitsTracker.php(81): Doctrine\ORM\Decorator\EntityManagerDecorator->flush()
1621877034521,#15 /etc/shlink/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(254): Shlinkio\Shlink\Core\Visit\VisitsTracker->Shlinkio\Shlink\Core\Visit{closure}(Object(Doctrine\ORM\EntityManager))
1621877034521,#16 /etc/shlink/vendor/doctrine/orm/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php(69): Doctrine\ORM\EntityManager->transactional(Object(Closure))
1621877034521,#17 /etc/shlink/module/Core/src/Visit/VisitsTracker.php(84): Doctrine\ORM\Decorator\EntityManagerDecorator->transactional(Object(Closure))
1621877034521,"#18 /etc/shlink/module/Core/src/Visit/VisitsTracker.php(34): Shlinkio\Shlink\Core\Visit\VisitsTracker->trackVisit(Object(Closure), Object(Shlinkio\Shlink\Core\Model\Visitor))"
1621877034521,"#19 /etc/shlink/module/Core/src/Action/AbstractTrackingAction.php(57): Shlinkio\Shlink\Core\Visit\VisitsTracker->track(Object(Shlinkio\Shlink\Core\Entity\ShortUrl), Object(Shlinkio\Shlink\Core\Model\Visitor))"
1621877034521,"#20 /etc/shlink/vendor/mezzio/mezzio/src/Middleware/LazyLoadingMiddleware.php(41): Shlinkio\Shlink\Core\Action\AbstractTrackingAction->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,"#21 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(61): Mezzio\Middleware\LazyLoadingMiddleware->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,#22 /etc/shlink/vendor/akrabat/ip-address-middleware/src/IpAddress.php(132): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,"#23 /etc/shlink/vendor/mezzio/mezzio/src/Middleware/LazyLoadingMiddleware.php(41): RKA\Middleware\IpAddress->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,"#24 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(61): Mezzio\Middleware\LazyLoadingMiddleware->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,#25 /etc/shlink/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,"#26 /etc/shlink/vendor/mezzio/mezzio-router/src/Route.php(85): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,"#27 /etc/shlink/vendor/mezzio/mezzio-router/src/RouteResult.php(97): Mezzio\Router\Route->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,"#28 /etc/shlink/vendor/mezzio/mezzio-router/src/Middleware/DispatchMiddleware.php(30): Mezzio\Router\RouteResult->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,"#29 /etc/shlink/vendor/mezzio/mezzio/src/Middleware/LazyLoadingMiddleware.php(41): Mezzio\Router\Middleware\DispatchMiddleware->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,"#30 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(61): Mezzio\Middleware\LazyLoadingMiddleware->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,#31 /etc/shlink/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,"#32 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,#33 /etc/shlink/vendor/laminas/laminas-stratigility/src/Middleware/PathMiddlewareDecorator.php(48): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,"#34 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Middleware\PathMiddlewareDecorator->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,#35 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(54): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,#36 /etc/shlink/vendor/mezzio/mezzio-router/src/Middleware/ImplicitHeadMiddleware.php(76): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,"#37 /etc/shlink/vendor/mezzio/mezzio/src/Middleware/LazyLoadingMiddleware.php(41): Mezzio\Router\Middleware\ImplicitHeadMiddleware->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,"#38 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(61): Mezzio\Middleware\LazyLoadingMiddleware->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,#39 /etc/shlink/vendor/mezzio/mezzio-router/src/Middleware/RouteMiddleware.php(50): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,"#40 /etc/shlink/vendor/mezzio/mezzio/src/Middleware/LazyLoadingMiddleware.php(41): Mezzio\Router\Middleware\RouteMiddleware->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,"#41 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(61): Mezzio\Middleware\LazyLoadingMiddleware->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,#42 /etc/shlink/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,"#43 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,#44 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(54): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,#45 /etc/shlink/vendor/shlinkio/shlink-common/src/Middleware/CloseDbConnectionMiddleware.php(27): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,"#46 /etc/shlink/vendor/mezzio/mezzio/src/Middleware/LazyLoadingMiddleware.php(41): Shlinkio\Shlink\Common\Middleware\CloseDbConnectionMiddleware->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,"#47 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(61): Mezzio\Middleware\LazyLoadingMiddleware->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,#48 /etc/shlink/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,"#49 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,#50 /etc/shlink/vendor/laminas/laminas-stratigility/src/Middleware/PathMiddlewareDecorator.php(48): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,"#51 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\Middleware\PathMiddlewareDecorator->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,#52 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(54): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,#53 /etc/shlink/vendor/laminas/laminas-stratigility/src/Middleware/ErrorHandler.php(144): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,"#54 /etc/shlink/vendor/mezzio/mezzio/src/Middleware/LazyLoadingMiddleware.php(41): Laminas\Stratigility\Middleware\ErrorHandler->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,"#55 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(61): Mezzio\Middleware\LazyLoadingMiddleware->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,#56 /etc/shlink/vendor/shlinkio/shlink-common/src/Middleware/ContentLengthMiddleware.php(28): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,"#57 /etc/shlink/vendor/mezzio/mezzio/src/Middleware/LazyLoadingMiddleware.php(41): Shlinkio\Shlink\Common\Middleware\ContentLengthMiddleware->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,"#58 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(61): Mezzio\Middleware\LazyLoadingMiddleware->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,#59 /etc/shlink/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,"#60 /etc/shlink/vendor/laminas/laminas-stratigility/src/Next.php(61): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\Next))"
1621877034521,#61 /etc/shlink/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(84): Laminas\Stratigility\Next->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,"#62 /etc/shlink/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(73): Laminas\Stratigility\MiddlewarePipe->process(Object(Laminas\Diactoros\ServerRequest), Object(Laminas\Stratigility\EmptyPipelineHandler))"
1621877034521,#63 /etc/shlink/vendor/mezzio/mezzio-swoole/src/Event/RequestHandlerRequestListener.php(121): Laminas\Stratigility\MiddlewarePipe->handle(Object(Laminas\Diactoros\ServerRequest))
1621877034521,#64 /etc/shlink/vendor/mezzio/mezzio-swoole/src/Event/EventDispatcher.php(41): Mezzio\Swoole\Event\RequestHandlerRequestListener->__invoke(Object(Mezzio\Swoole\Event\RequestEvent))
1621877034521,#65 /etc/shlink/vendor/mezzio/mezzio-swoole/src/SwooleRequestHandlerRunner.php(142): Mezzio\Swoole\Event\EventDispatcher->dispatch(Object(Mezzio\Swoole\Event\RequestEvent))
1621877034521,#66 {main}
bug