Set up a project in directory A with Symfony 6.3 + Ecotone + Ecotone Symfony Bundle. Set APP_ENV=prod, APP_DEBUG=false in ENV. Assume default Symfony cache configuration.
Have some code in a Symfony controller which invokes Ecotone messaging in some way.
Set up a web server and make an HTTP request which would invoke your controller. All works fine.
Move or copy your project directory somewhere else (alongside with var/cache/, vendor/ etc)
Again, set up a web server and try making an HTTP request, which should now land in the new dir.
Now it won't work as in step 5, and you'll get a following exception:
ProxyManager\Exception\InvalidProxyDirectoryException
Provided directory "OLD-PROJECT-DIR/var/cache/prod/ecotone" does not exist
Possible Solution
I took the dir of a project I'm working on from its CI build (which includes vendor/, cache/ etc) and ran a webserver pointing to it locally on my computer.
I've added the following to Ecotone\Messaging\Handler\Gateway\ProxyFactory::__construct():
It seems Ecotone actually creates the ProxyFactory twice, once for the cached version of MessagingSystemConfiguration, and the second for some other stuff. This cached MessagingSystemConfiguration I presume contains serialized PHP representation of the class, which also happens to contain the absolute path to the cache dir, which makes the project dir non-portable.
UPD: it's part of ModuleReferenceSearchService::$moduleReferences['gatewayProxyConfiguration'] which is a ProxyFactory having cacheDirectoryPath.
Ecotone version(s) affected: 1.106.0
Description
Let's continue discussing cache-related stuff!
How to reproduce
APP_ENV=prod
,APP_DEBUG=false
in ENV. Assume default Symfony cache configuration.var/cache/prod
dir.php bin/console cache:clear
,php bin/console cache:warmup
.Now it won't work as in step 5, and you'll get a following exception:
Possible Solution
I took the dir of a project I'm working on from its CI build (which includes vendor/, cache/ etc) and ran a webserver pointing to it locally on my computer. I've added the following to
Ecotone\Messaging\Handler\Gateway\ProxyFactory::__construct()
:Here's the output: https://gist.github.com/someniatko/bbaccca66eea61c48245a09b913db74b
It seems Ecotone actually creates the ProxyFactory twice, once for the cached version of MessagingSystemConfiguration, and the second for some other stuff. This cached MessagingSystemConfiguration I presume contains serialized PHP representation of the class, which also happens to contain the absolute path to the cache dir, which makes the project dir non-portable. UPD: it's part of
ModuleReferenceSearchService::$moduleReferences['gatewayProxyConfiguration']
which is aProxyFactory
havingcacheDirectoryPath
.Context
Symfony 6.3, APP_ENV=prod, APP_DEBUG=false