Heute einen Test gemacht. Und zwar ein Update-Versuch von 6.7.6.2 auf 6.7.8.2 welches allerdings mit Fehlern und zum Absturz vom Shop führte. Und ja, Plugins waren aktuell, deaktiviert und Cache wurde zuvor auch (manuell) gelöscht.
Run Post Update
Get collection for identifier: "core"
migrate Migrations
0/19 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% < 1 ms/< 1 ms 40.5 MiB16:37:49 ERROR [app] Migration: "Shopware\Core\Migration\V6_7\Migration1763125891AddProductTypeColumn" failed: "An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1553 Cannot drop index '': needed in a foreign key constraint"
---------- ----------------------
Action Number of migrations
---------- ----------------------
Migrated 2 out of 19
---------- ----------------------
16:37:49 CRITICAL [console] Error thrown while running command "database:migrate core --all=1". Message: "
Migration error: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1553 Cannot drop index '': needed in a foreign key constraint\n
#message: "An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1553 Cannot drop index '': needed in a foreign key constraint"
#code: 1553
#file: "/var/.../httpdocs/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php"
Alle Updates scheitern an dieser Anpassung:
class Migration1763125891AddProductTypeColumn extends MigrationStep
{
public function getCreationTimestamp(): int
{
return 1763125891;
}
public function update(Connection $connection): void
{
if (!TableHelper::columnExists($connection, 'product', 'type')) {
$this->addColumn(
$connection,
'product',
'type',
'VARCHAR(32)',
false,
'\'physical\''
);
$connection->executeStatement('CREATE INDEX `idx.product.type` ON `product` (`type`)');
}
$batchSize = 5000;
do {
$affected = $connection->executeStatement(
"UPDATE `product`
SET `product`.`type` = 'digital'
WHERE JSON_CONTAINS(states, '\"is-download\"')
LIMIT {$batchSize};"
);
} while ($affected > 0);
}
}
Nachtrag:
Der Shop ist im Frontend und Backend dann nicht mehr erreichbar. Als Fehler wird im Log dies angezeigt:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sales_channel_analytics.track_offcanvas_cart' in 'field list'" at ExceptionConverter.php line 63 {"exception":"[object] (Doctrine\\DBAL\\Exception\\InvalidFieldNameException(code: 1054): An exception occurred while executing a query:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sales_channel_analytics.track_offcanvas_cart' in 'field list' at /var/.../vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:63)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 1054):
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sales_channel_analytics.track_offcanvas_cart' in 'field list' at /var/.../vendor/doctrine/dbal/src/Driver/PDO/Exception.php:24)\n[previous exception] [object] (PDOException(code: 42S22):
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sales_channel_analytics.track_offcanvas_cart' in 'field list' at /var/.../vendor/doctrine/dbal/src/Driver/PDO/Statement.php:55)"} []
Wie kann das sein?
PS: Diese Fehler wurden übrigens in weiteren Shops auch festgestellt. Also KEIN Einzelfall.