- 🇺🇸United States benjifisher Boston area
I wonder whether fixing this issue will affect the annoying (but harmless) error message
Failed to connect to your database server. The server reports the following message: No database connection configured for source plugin variable.
discussed in 📌 Improve error reporting from migrate_drupal_migration_plugins_alter() Needs work and #3221087: fallback on 'migrate' as the database key causes error messages if migrations use a different source → . I am adding those as related issues.
- 🇺🇸United States benjifisher Boston area
Fixing this issue does not affect the error message I mentioned in #16. For more details on my testing, see #3198339-15: Improve error reporting from migrate_drupal_migration_plugins_alter() → .
- Status changed to Needs work
almost 2 years ago 9:47pm 18 February 2023 - 🇺🇸United States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request → as a guide.
Can the new functions in MigrateMissingDatabaseSource be typehinted.
Also was previously tagged for a change record.
- Status changed to Needs review
almost 2 years ago 3:00pm 23 February 2023 - 🇺🇸United States benjifisher Boston area
@smustgrave:
Thanks for the review!
I am uploading a new patch (also a new test-only patch and an interdiff). I added return-type declarations to all the new functions: those in the new test module and also new test methods. I will add a change record next.
The last submitted patch, 19: 3312733-19-test-only.patch, failed testing. View results →
The last submitted patch, 19: 3312733-19.patch, failed testing. View results →
- 🇺🇸United States benjifisher Boston area
The test-only patch fails as expected. The full patch fails on
CKEditor5AllowedTagsTest
, which is a FJS test. That test does not enable themigrate
module, so it should not be affected by this patch.Back t o NR.
- Status changed to RTBC
almost 2 years ago 6:37pm 24 February 2023 - 🇺🇸United States smustgrave
This looks good to me. Reran the tests for the full patch in #19 but seemed to be random ckeditor before.
The last submitted patch, 19: 3312733-19.patch, failed testing. View results →
The last submitted patch, 19: 3312733-19.patch, failed testing. View results →
- 🇺🇸United States benjifisher Boston area
This is another FJS test failure. It is the same test mentioned in 🐛 Occasional locks on SQLite Active . Back to RTBC.
-
longwave →
committed 3cad0ee9 on 10.1.x
Issue #3312733 by benjifisher, quietone, mikelutz, smustgrave: SQL...
-
longwave →
committed 3cad0ee9 on 10.1.x
- Status changed to Fixed
almost 2 years ago 7:25pm 12 March 2023 - 🇬🇧United Kingdom longwave UK
Committed and pushed to 10.1.x and published the change record, thanks. Not eligible for backport as there is a change to exception handling.
- 🇺🇸United States benjifisher Boston area
Thank you, @longwave! Now that this issue is fixed, I un-postponed 📌 Add ability to view migrate_message table data Fixed .
-
longwave →
committed 312e5891 on 10.1.x
Revert "Issue #3312733 by benjifisher, quietone, mikelutz, smustgrave:...
-
longwave →
committed 312e5891 on 10.1.x
- Status changed to Needs work
almost 2 years ago 9:47am 13 March 2023 - 🇬🇧United Kingdom longwave UK
Rolled this back; the tests here don't work on SQLite: https://www.drupal.org/pift-ci-job/2616192 →
1) Drupal\Tests\migrate\Kernel\MigrateMissingDatabaseTest::testMissingDatabase Failed asserting that exception message 'Destination plugin 'null' did not meet the requirements' contains 'No database connection available for source plugin migrate_missing_database_test'. 1) Drupal\Tests\migrate\Kernel\SqlBaseTest::testBrokenConnection Failed asserting that exception of type "Drupal\migrate\Exception\RequirementsException" is thrown.
- Status changed to Needs review
almost 2 years ago 5:27pm 13 March 2023 - 🇺🇸United States benjifisher Boston area
Maybe the test fails with SQLite because it starts with the default database and then changes the
host
key. If so, then always usingmysql
for the test database connection should fix the test. - Status changed to Needs work
almost 2 years ago 7:00pm 13 March 2023 - 🇺🇸United States benjifisher Boston area
I was in a rush and uploaded the wrong patch. Try again ...
- Status changed to Needs review
almost 2 years ago 10:30pm 13 March 2023 - 🇺🇸United States benjifisher Boston area
One test fixed, one to go.
I am uploading a new patch, an interdiff comparing it to the patch in #19 (not #35), and a test-only patch.
If this does not work, then I should re-postpone #3063856.
The last submitted patch, 36: 3312733-36-test-only.patch, failed testing. View results →
- 🇳🇿New Zealand quietone
SQLite failed on Drupal\Tests\ckeditor5\FunctionalJavascript\CKEditor5AllowedTagsTest. I am retesting
- 🇬🇧United Kingdom longwave UK
Would it be better to set
database
, instead ofhost
, to some invalid value? That should work on SQLite as well as MySQL and makes the test slightly more valid as it is testing the exception across all drivers. - Status changed to Needs work
almost 2 years ago 2:24pm 14 March 2023 - 🇺🇸United States benjifisher Boston area
I am setting the status to NW for #39. I will update the patch, but maybe not today.
- Status changed to Needs review
almost 2 years ago 11:38pm 21 March 2023 - 🇺🇸United States benjifisher Boston area
Is this what you had in mind in #39?
I considered using
'deadbeat_dad'
as the missing database, but decided on the more literary'godot'
(as in Waiting for ...).I am attaching an interdiff comparing to the patch in #19, since this patch un-does most of the change between #19 and #36. If this patch passed on MySQL and SQLite, then I will upload a test-only patch.
- 🇺🇸United States benjifisher Boston area
Both of the SQLite failures are the same:
Failed asserting that exception of type "Drupal\Core\Database\DatabaseNotFoundException" matches expected exception "Drupal\migrate\Exception\RequirementsException". Message was: "SQLSTATE[HY000] [14] unable to open database file" at /var/www/html/core/modules/sqlite/src/Driver/Database/sqlite/Connection.php:112
I am keeping the status at NR to reconsider the patch in #36.
Alternatively, we could catch additional exceptions (and re-throw them as
RequirementsException
s) or maybe there is another interpretation of the suggestion in #39. The last submitted patch, 41: 3312733-41.patch, failed testing. View results →
- Status changed to Needs work
almost 2 years ago 4:12am 22 March 2023 - 🇺🇸United States benjifisher Boston area
OK, the testbot shows that the patch in #41 is really a bad idea. (I wrote #42 while still waiting for the results of the MySQL test.)
Again: NR to reconsider the patch in #36.
While I am at it, I will update the list of remaining tasks in the issue summary.
- Status changed to Needs review
over 1 year ago 2:16pm 23 March 2023 - 🇳🇿New Zealand quietone
I applied the patch in #36 and tested with
phpunit --filter testBrokenConnection core/modules/migrate/tests/src/Kernel/SqlBaseTest.php
That failed with
1) Drupal\Tests\migrate\Kernel\SqlBaseTest::testBrokenConnection Failed asserting that exception of type "Drupal\Core\Database\DatabaseConnectionRefusedException" matches expected exception "Drupal\migrate\Exception\RequirementsException". Message was: "SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for no_such_host failed: No address associated with hostname [Tip: This message normally means that there is no MySQL server running on the system or that you are using an incorrect host name or port number when trying to connect to the server. You should also check that the TCP/IP port you are using has not been blocked by a firewall or port blocking service.] " at /var/www/html/core/modules/mysql/src/Driver/Database/mysql/Connection.php:174 /var/www/html/core/lib/Drupal/Core/Database/Database.php:451 /var/www/html/core/lib/Drupal/Core/Database/Database.php:194 /var/www/html/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php:193 /var/www/html/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php:148 /var/www/html/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php:238 /var/www/html/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php:214 /var/www/html/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php:154 /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
I then applied the patch in #41 and tested again with
phpunit --filter testBrokenConnection core/modules/migrate/tests/src/Kernel/SqlBaseTest.php
and the test passed.
So, for this one test I am getting opposite results from what testbot reports.
It is too late to investigate further.
- last update
over 1 year ago Build Successful - 🇳🇿New Zealand quietone
In Slack @benjifisher said that #36 passes on a checkout from March 10.
I used bisect to determine when the failures started. It was 🐛 Add informative error message for 'Connection refused' errors in MySQL Fixed in commit 442c0e41.
I've restarted tests on #36.
- 🇳🇿New Zealand quietone
The patch in #41, passes when run on a checkkout before 🐛 Add informative error message for 'Connection refused' errors in MySQL Fixed .
So, the other issue has changed \Drupal\mysql\Driver\Database\mysql\Connection to catch the \PDOException, which we expect here, and rethrows a new DatabaseConnectionRefusedException. A similar change was not made for pgsql or sqllite.
- 🇳🇿New Zealand quietone
Maybe just add a catch for a DatabaseException in \Drupal\migrate\Plugin\migrate\source\SqlBase::checkRequirements?
- last update
over 1 year ago Custom Commands Failed - 🇺🇸United States benjifisher Boston area
Using
git bisect
is fun, isn't it? I identified the same commit before I reloaded this page and saw the last few comments. I did not get as far as examining what that commit changed.We understand why the patch in #36 no longer works. But when I uploaded the patch in #41, there were 4 failures and now there is only one. I am still a little confused by that, but I am not going to track it down.
I think #49 is the right idea, if you mean
DatabaseConnectionRefusedException
. Here is a patch that does that, based on the patch in #41. (Reminder: the only difference between #36 and #41 is the tests.) - last update
over 1 year ago Custom Commands Failed - 🇺🇸United States benjifisher Boston area
On second thought, maybe #49 did mean
DatabaseException
, the interface implemented byDatabaseConnectionRefusedException
. Here is a patch that implements that, with an interdiff comparing to #41. - last update
over 1 year ago 29,207 pass - 🇺🇸United States benjifisher Boston area
Try again, this time keeping CodeSniffer happy.
- Status changed to RTBC
over 1 year ago 9:24am 17 April 2023 - 🇳🇿New Zealand quietone
I agree that `git bisect` can be fun to use. :-)
Yes, that is the change I was suggesting. I am pleased we agree. And I think that will cover future changes to the exceptions. Back to RTBC.
- last update
over 1 year ago 29,288 pass - last update
over 1 year ago 29,288 pass - last update
over 1 year ago 29,288 pass - last update
over 1 year ago 29,307 pass - last update
over 1 year ago 29,307 pass 29:50 26:19 Running- last update
over 1 year ago 29,367 pass - last update
over 1 year ago 29,371 pass - last update
over 1 year ago 29,372 pass - last update
over 1 year ago 29,379 pass - last update
over 1 year ago 29,384 pass - last update
over 1 year ago 29,384 pass, 1 fail - last update
over 1 year ago 29,362 pass, 2 fail - last update
over 1 year ago 29,388 pass - last update
over 1 year ago 29,393 pass - last update
over 1 year ago 29,392 pass, 1 fail - last update
over 1 year ago 29,393 pass - last update
over 1 year ago 29,393 pass - last update
over 1 year ago 29,393 pass - last update
over 1 year ago 29,399 pass, 1 fail - last update
over 1 year ago 29,403 pass, 1 fail - last update
over 1 year ago 29,404 pass - last update
over 1 year ago 29,404 pass - last update
over 1 year ago 29,405 pass - last update
over 1 year ago Build Successful - last update
over 1 year ago 29,420 pass - 🇺🇸United States Amber Himes Matz Portland, OR USA
Hiding old patches, as it looks like the patch from #52 is the one!
- last update
over 1 year ago 29,423 pass - last update
over 1 year ago 29,425 pass - last update
over 1 year ago 29,425 pass - Status changed to Fixed
over 1 year ago 9:20am 12 June 2023 - 🇬🇧United Kingdom catch
Looks good, simplifies the code and lots more test coverage.
Committed/pushed to 11.x and cherry-picked to 10.2.x, thanks!
Automatically closed - issue fixed for 2 weeks with no activity.