Skip to content

InvalidArgumentException: Class "Symfony\Component\Cache\Adapter\AdapterInterface" does not exist #190

Closed
@imironyak

Description

@imironyak

Describe the bug
When running the bin/console cache:clear command, an exception occurs indicating that the class Symfony\Component\Cache\Adapter\AdapterInterface does not exist.

The error suggests that Proxifier is trying to process the cache.system service definition which references Symfony\Component\Cache\Adapter\AdapterInterface interface but the ProxifierAssertions::assertServiceIsNotReadOnly requires a class.

Steps To Reproduce
Run the following command in the Symfony project directory:

bin/console cache:clear -v

Observe the error message in the console output.

Expected behavior
Proxifier should allow abstract service definitions that reference an interface

Environment (please complete the following information):

  • OS: macOS
  • PHP Version: 8.4
  • Swoole Version: 6.0.0
  • Symfony Version: 7.2.4
  • Running in docker: Yes

Additional context
Docker image: phpswoole/swoole:6.0.0-php8.4-dev

Logs

Exception trace

Class "Symfony\Component\Cache\Adapter\AdapterInterface" does not exist at /app/vendor/beberlei/assert/lib/Assert/Assertion.php:2728 Assert\Assertion::createException() at /app/vendor/beberlei/assert/lib/Assert/Assertion.php:1866 Assert\Assertion::classExists() at /app/vendor/swoole-bundle/swoole-bundle/src/Bridge/Symfony/Bundle/DependencyInjection/CompilerPass/StatefulServices/ProxifierAssertions.php:17 SwooleBundle\SwooleBundle\Bridge\Symfony\Bundle\DependencyInjection\CompilerPass\StatefulServices\Proxifier->assertServiceIsNotReadOnly() at /app/vendor/swoole-bundle/swoole-bundle/src/Bridge/Symfony/Bundle/DependencyInjection/CompilerPass/StatefulServices/Proxifier.php:63 SwooleBundle\SwooleBundle\Bridge\Symfony\Bundle\DependencyInjection\CompilerPass\StatefulServices\Proxifier->proxifyService() at /app/vendor/swoole-bundle/swoole-bundle/src/Bridge/Symfony/Bundle/DependencyInjection/CompilerPass/StatefulServicesPass.php:183 SwooleBundle\SwooleBundle\Bridge\Symfony\Bundle\DependencyInjection\CompilerPass\StatefulServicesPass->proxifyKnownStatefulServices() at /app/vendor/swoole-bundle/swoole-bundle/src/Bridge/Symfony/Bundle/DependencyInjection/CompilerPass/StatefulServicesPass.php:72 SwooleBundle\SwooleBundle\Bridge\Symfony\Bundle\DependencyInjection\CompilerPass\StatefulServicesPass->process() at /app/vendor/symfony/dependency-injection/Compiler/Compiler.php:73 Symfony\Component\DependencyInjection\Compiler\Compiler->compile() at /app/vendor/symfony/dependency-injection/ContainerBuilder.php:814 Symfony\Component\DependencyInjection\ContainerBuilder->compile() at /app/vendor/symfony/http-kernel/Kernel.php:498 Symfony\Component\HttpKernel\Kernel->initializeContainer() at /app/vendor/swoole-bundle/swoole-bundle/src/Bridge/Symfony/Kernel/CoroutinesSupportingKernel.php:48 Bidpath\Kernel->initializeContainer() at /app/vendor/symfony/http-kernel/Kernel.php:743 Symfony\Component\HttpKernel\Kernel->preBoot() at /app/vendor/symfony/http-kernel/Kernel.php:120 Symfony\Component\HttpKernel\Kernel->boot() at /app/vendor/symfony/framework-bundle/Console/Application.php:177 Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands() at /app/vendor/symfony/framework-bundle/Console/Application.php:69 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /app/vendor/symfony/console/Application.php:193 Symfony\Component\Console\Application->run() at /app/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:49 Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at /app/vendor/autoload_runtime.php:29 require_once() at /app/bin/console:15

Another similar bug exception trace

Class "Symfony\Contracts\HttpClient\HttpClientInterface" does not exist. at /app/vendor/beberlei/assert/lib/Assert/Assertion.php:2728 Assert\Assertion::createException() at /app/vendor/beberlei/assert/lib/Assert/Assertion.php:1866 Assert\Assertion::classExists() at /app/vendor/swoole-bundle/swoole-bundle/src/Bridge/Symfony/Bundle/DependencyInjection/CompilerPass/StatefulServices/ProxifierAssertions.php:17 SwooleBundle\SwooleBundle\Bridge\Symfony\Bundle\DependencyInjection\CompilerPass\StatefulServices\Proxifier->assertServiceIsNotReadOnly() at /app/vendor/swoole-bundle/swoole-bundle/src/Bridge/Symfony/Bundle/DependencyInjection/CompilerPass/StatefulServices/Proxifier.php:63 SwooleBundle\SwooleBundle\Bridge\Symfony\Bundle\DependencyInjection\CompilerPass\StatefulServices\Proxifier->proxifyService() at /app/vendor/swoole-bundle/swoole-bundle/src/Bridge/Symfony/Bundle/DependencyInjection/CompilerPass/StatefulServicesPass.php:183 SwooleBundle\SwooleBundle\Bridge\Symfony\Bundle\DependencyInjection\CompilerPass\StatefulServicesPass->proxifyKnownStatefulServices() at /app/vendor/swoole-bundle/swoole-bundle/src/Bridge/Symfony/Bundle/DependencyInjection/CompilerPass/StatefulServicesPass.php:72 SwooleBundle\SwooleBundle\Bridge\Symfony\Bundle\DependencyInjection\CompilerPass\StatefulServicesPass->process() at /app/vendor/symfony/dependency-injection/Compiler/Compiler.php:73 Symfony\Component\DependencyInjection\Compiler\Compiler->compile() at /app/vendor/symfony/dependency-injection/ContainerBuilder.php:814 Symfony\Component\DependencyInjection\ContainerBuilder->compile() at /app/vendor/symfony/http-kernel/Kernel.php:498 Symfony\Component\HttpKernel\Kernel->initializeContainer() at /app/vendor/swoole-bundle/swoole-bundle/src/Bridge/Symfony/Kernel/CoroutinesSupportingKernel.php:48 Bidpath\Kernel->initializeContainer() at /app/vendor/symfony/http-kernel/Kernel.php:743 Symfony\Component\HttpKernel\Kernel->preBoot() at /app/vendor/symfony/http-kernel/Kernel.php:120 Symfony\Component\HttpKernel\Kernel->boot() at /app/vendor/symfony/framework-bundle/Console/Application.php:177 Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands() at /app/vendor/symfony/framework-bundle/Console/Application.php:69 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /app/vendor/symfony/console/Application.php:193 Symfony\Component\Console\Application->run() at /app/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:49 Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at /app/vendor/autoload_runtime.php:29 require_once() at /app/bin/console:15

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions