-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker/sdk up fails when tideways service is enabled #321
Comments
Hey @zyuzka, |
@zyuzka @alexanderM91 did you have time to look at this? |
@bomensal thank you for the detailed description. I'll check it today/tomorrow and provide a solution |
Hey @bomensal, |
Hey, an issue isn't reproducible after the Tideways extension update. Note: Please use the latest version of the base image + docker/sdk. Thank you. |
Which release, branch or hash of Docker SDK are you using?
Latest master ee7e4aa
Which operating system (platform/version/architecture) are you using?
Linux
What is the issue that you're experiencing?
docker/sdk up
fails with "Aborted install..." when having the tideways service enabledWhat are the steps to reproduce the issue?
What is the expected result of these steps in the absence of the issue?
Environment gets built completely and started.
What is the actual result?
What possible solutions and/or workarounds for the issue do you see?
A workaround to solve the issue is to apply this patch into the docker-sdk repo:
Is there any other information that might be helpful?
Why does the above workaround fix the issue; what is the original problem? The problem is that if we enable the tideways integration and set
tideways.connection
to "tcp://tideways:9135" in the php cli container, then all php processes that gets started on the container will try to reach the tideways container on port 9135.This can be proven by executing above "steps to reproduce", and afterwards (after the error occured) jumping into the cli container and running a simple script:
Output:
What happens here? Apparently an error gets thrown with "Unkown" origin. To understand the issue better, try to run a very simple php script:
Output:
Why didn't we see an error here? Because we have not configured error handling, and the error that is being thrown is coming from the tideways php extension, which will throw the error after the script already has run. Also note the very long script running time of 5-10 seconds.
So, what is the problem? The problem is that we configure the php cli container to talk to a tideways container via "tcp://tideways:9135", but this container is not yet started at this point of the build process. A workaround would be to start the tideways container together with the cli container, see above workaround. But I hope the maintainers of this project will find a better solution.
Why this is an issue for Spryker projects
Spryker overrides the default error handler in all console commands via the
\Spryker\Zed\Console\Communication\Bootstrap\ConsoleBootstrap::__construct
call toEnvironment::initialize
, which will forward toErrorHandlerEnvironment::initialize
, which in::setErrorHandler
will set a custom error handler, that exactly will do what the above proof showed: It will throw an exception when it receives an error. That is also why the steps to reproduce produce the "Aborted install..." error: In the process ofdocker/sdk up
,vendor/bin/console
will be called for the first time, and this is a php script. This script does it's job (in this generating the transfers correctly), and afterwards the tideways extension tries to reach the tideways container, but doesn't find the dns record because the container is not started, hence a php error is thrown, which will be caught by the Spryker error handler, converted into an exception, and the console command will then return a non-zero exitcode (because of an uncaught exception). As this all happens within the shutdown procedure of the php script already, we don't see any real "Uncaught exception" message anymore.Another example to prove the problem is to run the console command manually again, after the above steps to reproduce lead to the problem:
Output:
^ Note: No error visible (exception gets swallowed), but exit-code 255.
The text was updated successfully, but these errors were encountered: