symfony-build script causes build errors on Platform.sh due to missing REDIS_URL during build phase #50449
Unanswered
MichaelBrauner
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Symfony ;),
I'm working on a Symfony project that is hosted on Platform.sh and uses Redis as a service.
During local development, I am able to use the REDIS_URL environment variable in my Symfony configuration as follows:
However, when I deploy this setup on Platform.sh, I encounter an error stating that the REDIS_URL environment variable cannot be found. As I understand it, this environment variable isn't provided directly by Platform.sh but needs to be extracted from the PLATFORM_RELATIONSHIPS base64-encoded JSON variable.
The interesting part is that when the application is running, everything works fine and the REDIS_URL is correctly set. The issue appears during the build phase when the symfony-build script is run as part of the build hook in my .platform.app.yaml file:
The symfony-build script seems to clear the cache during the build phase, which requires access to Redis. However, at this stage, the REDIS_URL variable isn't available yet, causing the build to fail.
I'm wondering if there's a way to prevent the symfony-build script from attempting to clear the cache during the build phase, or if there's a recommended way to handle such a scenario. Alternatively, if this behavior is considered a bug, I wanted to bring it to your attention.
Any advice or guidance on this matter would be greatly appreciated.
Thank you in advance for your help and time.
Best regards,
Michael
Beta Was this translation helpful? Give feedback.
All reactions