-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Non-interactive commands on remote host fail #3127
Comments
Are the parameters used in the |
working:
not working:
|
I can confirm the bug. Need some input from @greg-1-anderson in order to fix it. In the failing case (the non-interactive one), it looks to me like the original request is expecting the remote to send its output with backend delimiters and that whole ceremony. But it never tells the remote to do that as it does not send the --backend option. Thats evident in the failing command thats above. I'm curious about this line - drush/src/Runtime/RedispatchHook.php Line 96 in fac6079
|
Posted a possible fix to #3136. The test fails there might be hard to fix without breaking other stuff |
So, the fact that Drush is not sending I'll have to compare execution on Drush 8 to be sure. |
I think the problem here is that Drush's nomenclature is confusing around the issue of "interactive" vs. "incremental output" vs "backend output". Backend mode:
Interactive mode:
Incremental output:
It seems like the problem here is that the remote end is correctly in incremental output mode, but the client gets confused and thinks this is a backend call. I need to isolate further, though. |
This also happens when you invoke a remote command from a non-tty environment (eg: Invoking a drush command during NodeJS's |
I should also note that I can't seem to find any workaround for this for making the output of remote commands machine-readable in a non-TTY environment. Even if I were to somehow convince the application to set interactive = TRUE, SSH adds some garbage to stdout when it believes it's speaking to a TTY: drush @prod sql:conf --format=json
# Output will include "Connection to XXX closed" at the end
drush @prod sql:conf --format=json --ssh-options="-o LogLevel=QUIET"
# Output starts with ^@^@ (characters are added by SSH due to believing it's speaking to a TTY)
drush @prod sql:conf --format=json --ssh-options="-o LogLevel=QUIET" --no-interaction
# Fails with "The command could not be executed successfully", as described above. The extra stuff added by SSH is definitely outside the scope of this issue, but I'm just pointing out that there's currently no way to get machine readable output back from a remote command. |
I compared the data being passed to |
This problem is being bypassed with new site-process API in #3758. |
Non-interactive Drush commands run against a remote site alias will fail with a fairly obscure error.
In my example,
@blted91.local
is a site inside of a DrupalVM:Running
drush @blted91.local status --no-interaction
produces this:In my debugging, I think I narrowed this down to a problem with drush_backend_parse_output()... at least that's where the process falls apart. It's also possible that it's working fine and something else is not injecting the correct separator tokens for it to parse.
The text was updated successfully, but these errors were encountered: