Drush output not shown anymore in deploy hook scripts

Out setup contains a deploy hook script, which is called from “.platform.app.yaml” as “bash scripts/deploy.sh”. This script contains some shell magic, but in the end calls a list of drush commands, e.g. “drush locale-update”. Until roughly four weeks ago, the output of the deploy process (which is visible in the platform.sh GUI when clicking on “View log” next to the deploy action) contained everything the drush command outputs. In the example of “drush locale-update” that is which translation files have been loaded. This output is now missing.

I can still see everything that the shell script outputs directly (via echo or printf) and some very limited output from drush, e.g. “drush cim” outputs roughly half of what I expect to see. But most drush commands simply don’t output anything anymore.

When I connect to the environment with “platform environment:ssh” and run the script manually with “./scripts/deploy.sh” or with “bash ./scripts/deploy.sh”, the output is shown as expected.

This leads me to suspect that something changed in the platform setup, something to do with capturing these commands’ output. Does anyone have an idea how to get the old state back? I worry a bit that I might miss crucial information. I don’t mind tweaking our deploy.sh script to call the drush command differently, if that is necessary.

In the end, I asked the support and got the answer that this is indeed a platform.sh bug. They are working to correct it. To be more precise, the stderr output is missing from activity logs. You can still see it by requesting the deploy log from the platform.sh CLI.

For now, I added a rerouting of stderr to stdout to our script calls (e.g. “drush cim -y 2>&1”) and everything works again.