Open laradevitt opened 5 years ago
Similar problem here. Directing output to a text file does not work, the trxtfile is created but nothing is written.
None of the Drush maintainers use Windows. We need help from the community to get site process working correctly cross-platform. PRs welcome in the site process repository.
Thanks and understood. I'm troubleshooting for a new Drupal user on Windows, so I'm unlikely to invest dev time for Windows. We do intend to try WSL next, rather than his current Xammp and git-bash setup.
I'm on Windows and ran across this same issue just the other day. I'm interested in attempting to track this issue down, but I don't have much experience with the Drush codebase outside of writing a few Drush 9+ commands. Should I open an issue in the site process repository and ask for guidance there?
You are welcome to do that, but as stated above it wont be the maintainers of the project that immediately answer.
To clarify: I'm referring to the general structure of the Drush codebase and where to find things/what the execution path is for various things - i.e. the platform-independent PHP, which I assume all the maintainers are familiar with, regardless of platform?
After several hours of digging and inspecting various things, I've only learned a few things, including the hilarious number of workarounds the Symfony Process component has to do on Windows. There are some details to be found in https://github.com/symfony/symfony/issues/14252.
Some findings:
If I run the full command that the Symfony Process component generates (including the cmd
), it runs, displays output, and exits correctly.
If I run a test script that creates a new Symfony\Component\Process\Process
with the generated ssh
command and runs it directly, it runs, displays output, and exits correctly.
It's hard to say if this is entirely a Drush bug, but since the above seem to work correctly, it's looking more that way.
It would be interesting to see the exact code that you used to successfully run a Symfony\Process
command on Windows. Note that there are multiple different modes that you need to worry about; for example, if you run in tty mode you will be able to do things like run vi, but won't be able to capture output in the calling script. Site Process usually runs in non-interactive mode so that it can capture the output. Both modes are important to support, though.
I included the exact script in the Site Process issue I opened and referenced above, and included a bunch more findings. As for TTY: apparently Symfony\Process
doesn't support it at all on Windows.
Ah, missed that. Commented on the other issue.
Describe the bug
I suspect this is Windows-related.
When I try to execute
drush @alias status
on a remote (Linux) server from my local (Windows) machine the output isn't written to terminal. It just hangs. However copying the executedssh
command directly into the CLI works fine.To Reproduce
drush/sites/self.site.yml
drush/drush.yml
Run with drush:
Expected behavior
Actual behavior
log.txt looks good, except for these two lines:
Workaround
Not really a workaround, but if I copy and paste the
ssh
command directly, it works fine:Output:
log.txt is the same except it does not contain the two lines indicated above.
System Configuration
(local)
OpenSSH_7.3p1, OpenSSL 1.0.2k 26 Jan 2017
Additional information
$ drush @prod status > status.txt
prod.ssh.options: '-t'
andprod.ssh.tty: false
in drush config. No difference.DrupalDrush Launcher; however I get the same result when pointing tovendor/bin/drush
directly.Thanks!