Skip to content
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

Drush is unable to determine the mime type of the .sql file during sql-query #4308

Closed
naveenvalecha opened this issue Jan 29, 2020 · 2 comments

Comments

@naveenvalecha
Copy link

Describe the bug
vagrant@local:/var/www/rtdcw$ /usr/local/bin/drush sql-query --strict=0 --file=/tmp/db-dump.sql --uri=default --root=/var/www/rtdcw/docroot -vvv
[preflight] Config paths: /var/www/rtdcw/vendor/drush/drush/drush.yml,/var/www/rtdcw/drush/drush.yml
[preflight] Alias paths: /var/www/rtdcw/docroot/drush/sites,/var/www/rtdcw/drush/sites
[preflight] Commandfile search paths: /var/www/rtdcw/vendor/drush/drush/src,/var/www/rtdcw/drush
[debug] Starting bootstrap to max [0.48 sec, 8.64 MB]
[debug] Drush bootstrap phase: bootstrapDrupalRoot() [0.48 sec, 8.64 MB]
[debug] Change working directory to /var/www/rtdcw/docroot [0.48 sec, 8.64 MB]
[debug] Initialized Drupal 8.8.1 root directory at /var/www/rtdcw/docroot [0.49 sec, 8.84 MB]
[debug] Drush bootstrap phase: bootstrapDrupalSite() [0.5 sec, 9.13 MB]
[debug] Initialized Drupal site default at sites/default [0.51 sec, 9.37 MB]
[debug] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.51 sec, 9.37 MB]
[debug] Add service modifier [0.58 sec, 9.63 MB]
[info] Executing: command -v mysql [0.6 sec, 10.71 MB]
[debug] Mime type for /tmp/db-dump.sql is application/octet-stream. [0.64 sec, 10.75 MB]
[debug] Examining /tmp/db-dump.sql headers. [0.65 sec, 10.75 MB]
[debug] Unable to determine mime type from header bytes 0x2d2d of /tmp/db-dump.sql. [0.65 sec, 10.75 MB]
[debug] Examining /tmp/db-dump.sql extension. [0.65 sec, 10.75 MB]
[info] Executing: mysql --defaults-file=/tmp/drush_4BDmWJ --database=drupal --host=localhost --port=3306 --silent -A < /tmp/db-dump.sql [0.65 sec, 10.75 MB]

In SqlCommands.php line 201:

[Exception]
Query failed.

Exception trace:
at /var/www/rtdcw/vendor/drush/drush/src/Commands/sql/SqlCommands.php:201
Drush\Commands\sql\SqlCommands->query() at n/a:n/a
call_user_func_array() at /var/www/rtdcw/vendor/consolidation/annotated-command/src/CommandProcessor.php:257
Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() at /var/www/rtdcw/vendor/consolidation/annotated-command/src/CommandProcessor.php:212
Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /var/www/rtdcw/vendor/consolidation/annotated-command/src/CommandProcessor.php:176
Consolidation\AnnotatedCommand\CommandProcessor->process() at /var/www/rtdcw/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:302
Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /var/www/rtdcw/vendor/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at /var/www/rtdcw/vendor/symfony/console/Application.php:1000
Symfony\Component\Console\Application->doRunCommand() at /var/www/rtdcw/vendor/symfony/console/Application.php:255
Symfony\Component\Console\Application->doRun() at /var/www/rtdcw/vendor/symfony/console/Application.php:148
Symfony\Component\Console\Application->run() at /var/www/rtdcw/vendor/drush/drush/src/Runtime/Runtime.php:118
Drush\Runtime\Runtime->doRun() at /var/www/rtdcw/vendor/drush/drush/src/Runtime/Runtime.php:49
Drush\Runtime\Runtime->run() at /var/www/rtdcw/vendor/drush/drush/drush.php:72
require() at /var/www/rtdcw/vendor/drush/drush/includes/preflight.inc:18
drush_main() at phar:///usr/local/bin/drush/bin/drush.php:141
require() at /usr/local/bin/drush:10

To Reproduce
What did you do?

Expected behavior
What did you expect would happen?

Actual behavior
It should import the db dump

Workaround
Not found any yet

System Configuration

Q A
Drush version? Drush Launcher Version: 0.6.0 and Drush Commandline Tool 10.2.0
Drupal version? 8.8.1
PHP version PHP 7.3.13-1+ubuntu16.04.1+deb.sury.org+1
OS? Linux

Additional information
Add any other context about the problem here.

@naveenvalecha
Copy link
Author

I tried to import the gzip file too but it didn't work too
`vagrant@local:/var/www/rtdcw$ /usr/local/bin/drush sql-query --strict=0 --file=/tmp/tawebsite_20200129_070814.sql.gz --uri=default --root=/var/www/rtdcw/docroot -vvv
[preflight] Config paths: /var/www/rtdcw/vendor/drush/drush/drush.yml,/var/www/rtdcw/drush/drush.yml
[preflight] Alias paths: /var/www/rtdcw/docroot/drush/sites,/var/www/rtdcw/drush/sites
[preflight] Commandfile search paths: /var/www/rtdcw/vendor/drush/drush/src,/var/www/rtdcw/drush
[debug] Starting bootstrap to max [0.3 sec, 8.64 MB]
[debug] Drush bootstrap phase: bootstrapDrupalRoot() [0.3 sec, 8.64 MB]
[debug] Change working directory to /var/www/rtdcw/docroot [0.3 sec, 8.64 MB]
[debug] Initialized Drupal 8.8.1 root directory at /var/www/rtdcw/docroot [0.31 sec, 8.84 MB]
[debug] Drush bootstrap phase: bootstrapDrupalSite() [0.32 sec, 9.13 MB]
[debug] Initialized Drupal site default at sites/default [0.33 sec, 9.37 MB]
[debug] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.34 sec, 9.37 MB]
[debug] Add service modifier [0.43 sec, 9.63 MB]
[info] Executing: command -v mysql [0.45 sec, 10.71 MB]
[info] Executing: 'gzip' '-df' '/tmp/tawebsite_20200129_070814.sql.gz' [0.47 sec, 10.75 MB]
[info] Executing: mysql --defaults-file=/tmp/drush_zvpMx8 --database=drupal --host=localhost --port=3306 --silent -A < /tmp/tawebsite_20200129_070814.sql [0.58 sec, 10.76 MB]

In SqlCommands.php line 201:

[Exception]
Query failed.

Exception trace:
at /var/www/rtdcw/vendor/drush/drush/src/Commands/sql/SqlCommands.php:201
Drush\Commands\sql\SqlCommands->query() at n/a:n/a
call_user_func_array() at /var/www/rtdcw/vendor/consolidation/annotated-command/src/CommandProcessor.php:257
Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() at /var/www/rtdcw/vendor/consolidation/annotated-command/src/CommandProcessor.php:212
Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /var/www/rtdcw/vendor/consolidation/annotated-command/src/CommandProcessor.php:176
Consolidation\AnnotatedCommand\CommandProcessor->process() at /var/www/rtdcw/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:302
Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /var/www/rtdcw/vendor/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at /var/www/rtdcw/vendor/symfony/console/Application.php:1000
Symfony\Component\Console\Application->doRunCommand() at /var/www/rtdcw/vendor/symfony/console/Application.php:255
Symfony\Component\Console\Application->doRun() at /var/www/rtdcw/vendor/symfony/console/Application.php:148
Symfony\Component\Console\Application->run() at /var/www/rtdcw/vendor/drush/drush/src/Runtime/Runtime.php:118
Drush\Runtime\Runtime->doRun() at /var/www/rtdcw/vendor/drush/drush/src/Runtime/Runtime.php:49
Drush\Runtime\Runtime->run() at /var/www/rtdcw/vendor/drush/drush/drush.php:72
require() at /var/www/rtdcw/vendor/drush/drush/includes/preflight.inc:18
drush_main() at phar:///usr/local/bin/drush/bin/drush.php:141
require() at /usr/local/bin/drush:10

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] [--druplicon] [--xh-link XH-LINK] [--] []`

@weitzman
Copy link
Member

More info at #4319

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants