- Status changed to Needs work
over 1 year ago 4:24pm 2 June 2023 - π¬π§United Kingdom pstewart
I've taken a quick look at this in my D10 test environment and am not seeing the problem, but I'm guessing this maybe that with drush + D9.3
tableExists
is getting hit before something else that calls intogetDefaultSchema
which causes the error, while with drush + D10 it seems thatgetDefaultSchema
is getting hit beforetableExists
so the bug doesn't manifest (@ncac I'm guessing it's a similar reason why you're seeing the problem in drush but not on the site itself). The problem has almost certainly materialised due to the change in #3259155 π Schema::tableExists doesn't check schema Fixed which now does check the schema explicitly intableExists
(although I realise now that the solution there is incomplete as we should be doing the same check infieldExists
, that's a separate problem).Implementing
getPrefixInfo
is definitely the way to go here, however I think we can simplify a bit by just callinggetDefaultSchema
to ensure thedefaultSchema
variable is set, then delegating back to the parent.I'll take a closer look next week when I have some more time to look at Drupal stuff.
- πΈπͺSweden arne_hortell
About 15 hours ago my development site failed to connect to database, i had dev-4.3-x 4288276 which have been working flawlessly a few weeks. After upgrading to dev-4.4-x 3362d7f it works perfectly again.
Thanks pstewart for your efforts. - πΊπΈUnited States Beakerboy Kentucky
My memory could be wrong, but I think at one point drush had its own implementation of each database driver instead of using the Drupal classes. If this is the case, drush would need to be patched to support sqlsrv.
- πΊπΈUnited States Beakerboy Kentucky
It looks like I already have a project for this:
https://www.drupal.org/project/drush_sqlsrv β @Beakerboy: In the context of this issue, it seems to be the database driver defined in my settings.php
[ 'driver' => 'sqlsrv', 'namespace' => 'Drupal\\sqlsrv\\Driver\\Database\\sqlsrv', 'autoload' => 'modules/contrib/sqlsrv/src/Driver/Database/sqlsrv' ]
which is used in
Drush\Boot\DrupalBoot8::bootstrapDrupalDatabaseValidate()
invokingDrupal\Core\Database\Database::getConnection()
- πΈπͺSweden arne_hortell
It turned out that website works great but drush is totally handicapped and cant connect to database.
Everything worked on friday...
Any ideas? - πΈπͺSweden arne_hortell
https://www.drupal.org/files/issues/2023-06-02/diff.txt β
The above fix from ncac solved my problem, now all works again
- π¬π§United Kingdom pstewart
@arne_hortell can you confirm which Drupal and Drush versions you were running when you experienced the Drush errors?
- @pstewart opened merge request.
- Status changed to Needs review
over 1 year ago 1:37pm 9 June 2023 - π¬π§United Kingdom pstewart
I've pushed a change to the issue fork to simplify the fix, which seemsto be working ok in a D9 test environment. Please can those affected try the issue fork patch to test?
- πΈπͺSweden arne_hortell
@pstewart Drupal 9.5.8 on Apache, drush 11.5.1
- πΈπͺSweden arne_hortell
@pstewart patch 84.diff (your file) seems to work great
- πΈπͺSweden arne_hortell
For whatever reason, patch 3364384 doesnt work with my composer so i made a new patch according to
https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa... β - π¬π§United Kingdom pstewart
@arne_hortell your patch from #15 appears to be the same as @ncac's original patch apart from some trailing newlines, did the revised patch from the merge request actual work for you in the end?
I have now managed to recreate this error on my D10 development environment by explicitly removing the
schema
key from the database settings insettings.php
, then clearing all caches from the web interface. Drush then failed as described above. I then applied the diff from MR84 and confirmed that it resolved the problem.@ncac if you're able to confirm the current diff from MR84 is working then that would be great, however I'm pretty satisfied this fix is the way to go so if I don't hear back I'll go ahead and commit this and make a new release.
- πΈπͺSweden arne_hortell
It turned out there was another issue, totally unrelated that made the #15.
Now all is fine and im looking forward to you r new release @pstewart I can confirm that, on my side, every Drush command work with the issue fork patch. Thank you @pstewart
- Status changed to RTBC
over 1 year ago 10:22am 19 June 2023 - π¬π§United Kingdom pstewart
OK, let's get this committed and tag a new release
-
pstewart β
committed ede86907 on 4.3.x
Issue #3364384 by ncac, arne_hortell, pstewart: Error with Drush :...
-
pstewart β
committed ede86907 on 4.3.x
- Status changed to Fixed
over 1 year ago 10:26am 19 June 2023 Per π Error with Drush : Bootstrap phase bootstrapDrupalDatabase() failed to validate (4.4.x branch) Fixed , shouldn't this also get committed on the 4.x branch?
Automatically closed - issue fixed for 2 weeks with no activity.