-
-
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
Remote drush commands not exporting to file using > #4004
Comments
Just tried it on HEAD of master, and it worked fine for me. What's in your alias file? Are both the local and remote OS Ubuntu 17.10? Try running Also try |
I tried from master HEAD and it didn't work neither. I added drush alias and remote environment OS at description. Drush status also works. Furthermore, the |
Try:
|
drush -d @Remote.stg sql:dump: [info] Executing: ssh -o PasswordAuthentication=no remote-stg@remote-stg.remote.pro 'drush -vvv --quiet sql:dump --uri=remote-stg.remote.pro --root=/path/to/codebase' [0.06 sec, 10.26 MB]
> [preflight] Config paths: /path/to/codebase/vendor/drush/drush/drush.yml,/path/to/codebase/drush/drush.yml
> [preflight] Alias paths: /path/to/codebase/web/drush/sites,/path/to/codebase/drush/sites
> [preflight] Commandfile search paths: /path/to/codebase/vendor/drush/drush/src,/path/to/codebase/drush
> [bootstrap] Starting bootstrap to max [0.12 sec, 8.87 MB]
> [bootstrap] Drush bootstrap phase: bootstrapDrupalRoot() [0.13 sec, 8.87 MB]
> [bootstrap] Change working directory to /path/to/codebase/web [0.13 sec, 8.87 MB]
> [bootstrap] Initialized Drupal 8.6.13 root directory at /path/to/codebase/web [0.13 sec, 9.03 MB]
> [bootstrap] Drush bootstrap phase: bootstrapDrupalSite() [0.13 sec, 9.44 MB]
> [bootstrap] Initialized Drupal site remote-stg.remote.pro at sites/default [0.13 sec, 9.66 MB]
> [bootstrap] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.13 sec, 9.66 MB]
> [debug] Add service modifier [0.14 sec, 9.92 MB]
> [info] Executing: command -v mysql [0.14 sec, 10.48 MB]
> [info] sql:query: SHOW TABLES; [0.18 sec, 10.54 MB]
> [info] Executing: mysql --defaults-file=/tmp/drush_aktXcP --database=remote_stg --host=localhost --silent -A < /tmp/drush_gRhgv9 [0.18 sec, 10.55 MB]
> [info] Executing: mysqldump --defaults-file=/tmp/drush_iecmWu remote_stg --host=localhost --no-autocommit --single-transaction --opt -Q [0.19 sec, 10.57 MB] drush -s @Remote.stg sql:dump: ./vendor/drush/drush -s @remote.stg sql:dump
[notice] Simulating: ssh -t -o PasswordAuthentication=no remoteweb-stg@remote-stg.remote.pro 'drush sql:dump --uri=remote-stg.remote.pro --root=/path/to/codebases/remoteweb-stg/codebase' [26 20:41] omar@helm:~/docker/web (dev) $ drush @remote.stg version > tmp/version.txt
Drush version : 9.6.0
Connection to remote-stg.remote.pro closed. The last command doesn't dumps the output to the file. [26 20:43] omar@helm:~/docker/web (dev) $ cat tmp/version.txt
[26 20:43] omar@helm:~/docker/web (dev) $ |
OK, pretty strange results. Copy the whole ssh line ( Run |
I get similar as OP. Stdout is dumped to screen, not redirected to tmp.txt. I test with
I also tried |
The problem is that Drush is setting tty mode even though output is redirected. This is wrong. Workaround:
Should have a fix shortly. |
For anyone coming across this issue. I had a similar problem with Drush 9.7.0 where sql:dump output was sent to standard output instead of a file. Based on the above workaround, I fixed it with the 'ssh' option in the drush alias of the remote site:
|
Probably related to #4092 |
#4004 (comment) solved the same issue I encountered with drush 9.7.1 |
I'm also facing this issue and use the workaround from said comment. |
# Conflicts: # scripts/pull
# Conflicts: # scripts/pull # Conflicts: # scripts/pull
# Conflicts: # scripts/pull # Conflicts: # scripts/pull
# Conflicts: # scripts/pull # Conflicts: # scripts/pull
I had the same problem and the comment above (#4004 (comment)) helped me. But it was not immediately obvious that
|
This still happens on Drush 9.7.2 and Drush 10.2.2, even with simple commands like Command output without workaround:
... and shell redirection doesn't work. Command output with workaround:
... and shell redirection works. |
Still seeing this in Drush 10.3.2, FWIW. Setting ssh: tty: 0 for the remote alias works. |
Thanks for your comment. I try to add the tty in the remote configuration but still i am facing this issue. I am using drush 9.7.2. This my remote config: |
We are using the alias workaround above but realizing that
|
This seems to still be an active issue. We can't just blanket use |
It seems to be resolved in |
Describe the bug
After upgrading from drush 9.5.2 to drush 9.6.0 the drush sql-dump command does not dump the output to a file, running the command from the
To Reproduce
What did you do?
drush @remote.stg sql:dump > tmp/db.sql
Expected behavior
The file tmp/db.sql should have all the database dumped.
Actual behavior
The file tmp/db.sql is empty.
Workaround
Is there another way to do the desired action?
Make the action in two steps:
System Configuration
Remote environment os:
Linux **** 3.16.0-5-amd64 #1 SMP Debian 3.16.51-3+deb8u1 (2018-01-08) x86_64 GNU/Linux
Drush alias
The text was updated successfully, but these errors were encountered: