-
-
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
drush sqlc < does not work. #4305
Comments
Pretty sure this is a dupe. @danepowell may recall details. |
I've certainly seen funkiness with sql:cli in the past:
The failure modes in those cases were either hanging on failure or silently failing. I've never seen it drop into the SQL shell, and we now have an automated test to catch those failures, so I suspect this new issue is something else. I'm not able to reproduce this on Ubuntu, maybe it's a CentOS thing? What's the full command you are running and output with |
I am researching this a bit more, and will give you the requested information. |
EDIT: To be sure it is known, we did this to the sql file as mentioned in the first (albiet edited) comment: In our setup, I am logged in via SSH to run drush sqlc there. We have several DBs linked up with galera cluster with MariaDB 10.4.11 . We found that we could import the db with 9.6.2 by replacing all the set autocommit=0 to be set autocommit=1 from a mysql dump from drush. e.g. drush sql-dump > test.sql @danepowell I have edited the first comment above. My --debug output is as follows: drush sqlc < sqlfile.sql [preflight] Config paths: /var/www/html/vendor/drush/drush/drush.yml,/var/www/html/drush/drush.yml [preflight] Alias paths: /var/www/html/web/drush/sites,/var/www/html/drush/sites [preflight] Commandfile search paths: /var/www/html/vendor/drush/drush/src,/var/www/html/drush [debug] Starting bootstrap to max [0.07 sec, 8.41 MB] [debug] Drush bootstrap phase: bootstrapDrupalRoot() [0.07 sec, 8.41 MB] [debug] Change working directory to /var/www/html/web [0.07 sec, 8.41 MB] [debug] Initialized Drupal 8.7.11 root directory at /var/www/html/web [0.07 sec, 8.54 MB] [debug] Drush bootstrap phase: bootstrapDrupalSite() [0.08 sec, 8.84 MB] [debug] Initialized Drupal site default at sites/default [0.08 sec, 9.07 MB] [debug] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.08 sec, 9.07 MB] [debug] Add service modifier [0.09 sec, 9.59 MB] [info] Executing: command -v mysql [0.09 sec, 10.05 MB] [info] Executing: mysql --defaults-file=/tmp/drush_(some random chars here) --database=d8db --host=(ip here) --port=(port here) -A [0.1 sec, 10.11 MB] Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 3864 Server version: 10.4.11-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [d8db]> |
I cant reproduce this on OSX or Alpine Linux (wodby/php docker image). |
Tried all the 10.x versions back to 10.0.0 but couldn't get it to work. I tried to downgrade to 9.x but then drush won't work at all and I get a different error "TypeError: Argument 4 passed to Drush\Drupal\Commands\config\ConfigImportCommands::__construct() must implement interface Drupal\Core\Extension\ModuleHandlerInterface". |
Maybe someone who can reproduce this could do a |
@greg-1-anderson here is the result of the dda3993 is the first bad commit
|
@weitzman We are also running into this issue on drush-8.3.5. We upgraded recently from 8.1.16 where this was not a problem. |
@kindlehl Drush 8.x doesn't use any of this code, so the problem must be unrelated. If you could test with @golddragon007 I am wondering if perhaps dda3993 is just a do-over. It seems that the intention of this commit was to move away from using the posix commands to detect tty capability, and instead use the Symfony libraries, if available. However, it seems to me that the old code did something different than the new code. The old code specifically checked to see if stdin was connected to a tty. Drush used this check to determine whether stdin should be redirected or not. The Symfony functions do not appear to be equivalent; they are not specifically about STDIN. The comment on the Symfony function says:
That's not the same thing. |
It looks like drush 8.3.5 is picking up on a site-local installation of drush 10.3.0 and using that, causing this issue in my case. I was not aware of this functionality, but I can replicate this issue for version 10.3.0 |
@kindlehl: See my comment to |
@greg-1-anderson I don't know how much it is a do-over or not, but definitely it breaks for me and that's the first commit that didn't work for me. Therefore if it was a rework, then it wasn't 100% equal. |
Yes; what I mean by a "do-over" is that it did not do what it was supposed to do, or more specifically, the new code is not making the same check as the old code was, which changes the intention of the code. |
I just tested this by redoing the changes from that commit and it still is broken. Also, this doesn't happen in our production environment on php 7.2.31 with drush 10.3.0. It happens in non-live where we run php 7.2.28 and drush 10.3.0. There are some other differences such as the version of the mysql driver, etc. I tried testing under php 7.2.26 and it still failed. I mentioned above that this came from an upgrade from 8.1.16 to 8.3.5, but that also came along with fundamental changes to php configuration and other things, and I'm leaning towards thinking that is what is caused this to break. I gutted the php configuration on the VM and applied the old configuration, kept my local modified drush 10.3.0 installation, and it now works. 🤷 I'm not sure, very confused. |
@golddragon007 The issue on our end was the lack of the php posix extension. On IUS, install php72u-process was good enough to solve this issue. Can you verify that you have a similar problem? |
@greg-1-anderson would you support adding a warning on POSIX OS's if the POSIX extension is not installed? |
@kindlehl Well, it's not a 100% solution as I see. I've installed the php73-php-process and php73-process packages. Now it doesn't jump into the console if I through some data to it. However, if there is an import error, then it doesn't jump out. After the error, it just hangs and you need to kill it with ctrl + c.
Even if an error happens, it doesn't display it and it hangs till you kill it with ctrl + c. And actually, as I'm testing now, |
@kindlehl: @weitzman just removed a bunch of php configuration validation checks (not POSIX) that were not firing often/ever. Since POSIX is important to Drush, though, perhaps a PR to check for it in preflight or invoke would be welcome. I think the point of dda3993 was to make Drush work better without POSIX, but I think it might have made things worse. Still not sure. |
Hello, I ran into this bug too. I was upgrading from 9.6.2 to 10.3.4. Drush version: 10.3.4 I downgraded Drush to 10.3.0: same problem |
I ran into this problem very recently. @rsanzante replied to this closed issue in #3859 (comment). He identified Source comment on closed issue: #3859 (comment) |
FWIW I noticed this commit for Composer composer/composer@1496277. See the PR linked from there. |
We're running into this as well, specifically when importing into a cluster that puts an upper limit on transaction sizes. Error reported during
The problem is also outlined here. ISTM this is due to |
@meanderix we're running into the same problem, same sort of setup. Have you found a way to fix this yet? |
I can confirm the same issue on Centos, running For debugging purposes, here is some outputs Debugging Output
|
this (drush sqlc does not accept stdin) just happend to me on RHEL with php 8.1 and drush11; apache running php-fpm. |
I ran into this as well with PHP 8.1 and Drush 10.6.2, on a UBI 7 system.
|
Both not work. PS: I'm using alpine based docker, and can't install php-process. drupal 9, drush 11
|
drush sqlc command takes me to the sql command prompt rather than importing the sql file.
In our setup, I am logged in via SSH to run drush sqlc there. We have several DBs linked up with galera cluster with MariaDB 10.4.11 . We found that we could import the db with 9.6.2 by replacing all the set autocommit=0 to be set autocommit=1 from a mysql dump from drush. e.g. drush sql-dump > test.sql
I ran drush sql-dump > test.sql (this ran successfully)
sed replaced all autocommit=0 to be autocommit=1
then I ran drush sqlc < test.sql
I expected this to import the sql file like it did in version 9.6.2
Instead, it sent me to the sql command prompt.
Drush version: 10.2.0
Drupal version: 8.7
PHP version: 7.3.14
OS: CentOS
The text was updated successfully, but these errors were encountered: