-
Notifications
You must be signed in to change notification settings - Fork 181
Closed
Description
Environment
How do you use Sentry?
Sentry SaaS (sentry.io)
Which SDK and version?
sentry.php.symfony
at 4.1.3
Steps to Reproduce
- Have
sentry/sentry-symfony
installed at4.1.3
and make sure to enable cache tracing.
config/packages/sentry.yaml
:
sentry:
dsn: '%env(SENTRY_DSN)%'
tracing:
cache:
enabled: true
- Inject a cache pool
TagAwareCacheInterface $integrationsCache
into a service and use theRedisTagAwareAdapter
:
public function __construct(
private int $cacheTtl,
private TagAwareCacheInterface $integrationsCache,
private NavisionCustomerService $navisionCustomerService,
) {}
config/packages/cache.yaml
:
framework:
cache:
prefix_seed: my_app
app: cache.adapter.redis_tag_aware
default_redis_provider: '%env(resolve:REDIS_DSN)%'
pools:
application.cache:
adapter: cache.adapter.redis_tag_aware
tags: true
integrations.cache:
adapter: cache.adapter.redis_tag_aware
tags: true
- Use the service in an HTTP request.
Expected Result
Symfony should inject an instance RedisTagAwareAdapter
into the service.
Actual Result
An exception is thrown:
MyApp\Integrations\Navision\Customer\CachedNavisionCustomerService::__construct(): Argument #2 ($integrationsCache) must be of type Symfony\Contracts\Cache\TagAwareCacheInterface, Symfony\Component\Cache\Adapter\TraceableAdapter given, called in /vagrant/var/cache/dev/ContainerYqNNU93/getCachedNavisionCustomerServiceService.php on line 24
This exclusively happens when Sentry is installed and cache tracing is enabled. I feel this might be an issue in Sentry\SentryBundle\DependencyInjection\Compiler\CacheTracingPass
.