I crafted my drush/sites/self.site.yml like below* and verified that drush rsync @prod:%files @self:%files
worked. However, drush sql-sync @prod @self
results in the following error:
The command "/usr/local/bin/drush sql-query --strict=0 --file=/tmp/termitral_db_20211011_110905.sql.gz --file-delete --uri=drupal --root=/var/www/drupalvm/drupal/web" failed.
Exit Code: 1(General error)
Working directory:
Output:
================
Error Output:
================
In SqlCommands.php line 199:
Query failed.
sql:query [--result-file [RESULT-FILE]] [--file FILE] [--file-delete] [--extra EXTRA] [--db-prefix] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--database [DATABASE]] [--target [TARGET]] [--db-url DB-URL] [--notify [NOTIFY]] [--druplicon] [--xh-link XH-LINK] [--] <command> [<query>]
On closer look (aka verbose), I noticed this** and I was told on Drupal Slack that --file
only takes an uncompressed SQL file (I later verified this). So my question is, how can I fix this dreadful error?
*
prod:
host: example.com
user: user
root: /data/web/public_html/web
uri: default
paths:
- files: sites/default/files
**
// Copy new and override existing files at
// /tmp/termitral_db_20211011_103342.sql.gz. The source is
// [email protected]:/data/web/drush-backups/termitral_db/20211011103342/
// termitral_db_20211011_103342.sql.gz?: yes.
and
The command "/usr/local/bin/drush sql-query --strict=0 --file=/tmp/termitral_db_20211011_103342.sql.gz --file-delete --uri=drupal --root=/var/www/drupalvm/drupal/web" failed.