Daniel-KM / Omeka-S-module-Annotate

Module for Omeka S that implements the W3C Web Annotation Ontology to annotate (tag, comment, rate, highlight, draw, etc.) any resource.
Other
8 stars 1 forks source link

Error on install Doctrine\DBAL\Exception\TableExistsException #4

Closed sbucdh closed 3 years ago

sbucdh commented 3 years ago

Getting a SQL error on installation. CustomVocab is installed and it looks like the four annotation vocabs are successfully created but installation fails. Omeka 3.0.1 w/ MariaDB 10.1.48 and PHP 7.2.34. This is happening both on our production instance and on our test/development instance. Any assistance is greatly appreciated! Thank you.

Doctrine\DBAL\Exception\TableExistsException An exception occurred while executing 'CREATE TABLEannotation_part(idINT NOT NULL,annotation_idINT DEFAULT NULL,partVARCHAR(190) NOT NULL, INDEX IDX_4ABEA042E075FC54 (annotation_id), INDEX idx_part (part), PRIMARY KEY(id`) ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB': SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'annotation_part' already exists

Details:

PDOException: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'annotation_part' already exists in /****/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:41 Stack trace:

0 /****/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(41): PDO->exec('CREATE TABLE `a...')

1 /****/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1094): Doctrine\DBAL\Driver\PDOConnection->exec('CREATE TABLE `a...')

2 /****/omeka-s/modules/Generic/AbstractModule.php(293): Doctrine\DBAL\Connection->exec('CREATE TABLE `a...')

`

sinanatra commented 3 years ago

same here, cannot install the module:

Next Doctrine\DBAL\Exception\TableExistsException: An exception occurred while executing 'CREATE TABLE `annotation_part` (
    `id` INT NOT NULL,
    `annotation_id` INT DEFAULT NULL,
    `part` VARCHAR(190) NOT NULL,
    INDEX IDX_4ABEA042E075FC54 (`annotation_id`),
    INDEX idx_part (`part`),
    PRIMARY KEY(`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'annotation_part' already exists in ..
Daniel-KM commented 3 years ago

On the first issue, it seems that the tables are well created, but because the process failed, they are still there when you try to reinstall it. So you just need to set that the module is enabled in the sql table "module".

Daniel-KM commented 3 years ago

This is the same in the second issue, so there is probably an issue in the installer.

sbucdh commented 3 years ago

Yes! Inserting a row into the module table manually resolved the install error and it is now working on our test instance. Thank you as always :)

sinanatra commented 3 years ago

yep thank you! for future mysql readers: INSERT INTO `DATABASE_NAME`.`module` (`id`, `is_active`, `version`) VALUES ('Annotate', '1', '3.3.3.6');