From 3c2474d87c757c6fcb34f37e2be3e138b5e9b5a4 Mon Sep 17 00:00:00 2001 From: Aleksandrs Rivkinds Date: Thu, 15 Aug 2024 13:57:41 +0300 Subject: [PATCH] change how magento-scripts decides when MariaDB is ready for connection - should eliminate connection errors during creating magento database in some cases --- .../magento-scripts/lib/tasks/database/connect-to-database.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build-packages/magento-scripts/lib/tasks/database/connect-to-database.js b/build-packages/magento-scripts/lib/tasks/database/connect-to-database.js index 284c17e8..d240b83e 100644 --- a/build-packages/magento-scripts/lib/tasks/database/connect-to-database.js +++ b/build-packages/magento-scripts/lib/tasks/database/connect-to-database.js @@ -20,7 +20,9 @@ const waitForDatabaseInitialization = () => ({ const databaseOutput = await execAsyncSpawn( `docker logs ${mariadb.name}` ) - if (databaseOutput.includes('ready for connections')) { + // we can't rely on ready for connections message because it's written 1 or 2 times depending if data is already there or not + // changed to rely on server socket created message + if (databaseOutput.includes('Server socket created on IP')) { databaseReadyForConnections = true break } else if (databaseOutput.includes('Initializing database files')) {