clickstorm / cs_seo

[clickstorm] SEO
Other
33 stars 49 forks source link

Can't install on TYPO3 9.5 with generated PackageStates (+ can't extend existing model) #220

Closed jwittorf closed 5 years ago

jwittorf commented 5 years ago

Hi,

I'm using a fresh TYPO3 9.5.4 with cs_seo 4.1.0, composer and typo3console.

After installing all dependencies via composer I'm running typo3cms install:generatepackagestates in order to have all extensions installed once finished the TYPO3 Install wizard in the browser.

Hower, I can't get passed step 4, creating the admin user and creating the database. I'm getting this in my log:

Thu, 07 Feb 2019 17:53:45 +0100 [CRITICAL] request="" component="TYPO3.CMS.Core.Error.ProductionExceptionHandler": Core: Exception handler (WEB): Uncaught TYPO3 Exception: An exception occurred while executing 'SELECT `pid`, `uid`, `title`, `doktype`, `slug`, `tsconfig_includes`, `TSconfig`, `is_siteroot`, `t3ver_oid`, `t3ver_wsid`, `t3ver_state`, `t3ver_stage`, `backend_layout_next_level`, `hidden`, `starttime`, `endtime`, `fe_group`, `nav_hide`, `content_from_pid`, `module`, `extendToSubpages` FROM `pages` WHERE (`uid` = ?) AND (`pages`.`deleted` = 0)' with params [1]:

Table 't3_demo.pages' doesn't exist | Doctrine\DBAL\Exception\TableNotFoundException thrown in file L:\htdocs\t3.demo\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\AbstractMySQLDriver.php in line 61. Requested URL: http://localhost/t3.demo/web/typo3/install.php - {"TYPO3_MODE":"BE","exception":"Doctrine\\DBAL\\Driver\\Mysqli\\MysqliException: Table 't3_demo.pages' doesn't exist in L:\\htdocs\\t3.demo\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\Mysqli\\MysqliStatement.php:110
Stack trace:
#0 L:\\htdocs\\t3.demo\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\Mysqli\\MysqliConnection.php(143): Doctrine\\DBAL\\Driver\\Mysqli\\MysqliStatement->__construct(Object(mysqli), 'SELECT `pid`, `...')
#1 L:\\htdocs\\t3.demo\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Connection.php(927): Doctrine\\DBAL\\Driver\\Mysqli\\MysqliConnection->prepare('SELECT `pid`, `...')
#2 L:\\htdocs\\t3.demo\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Query\\QueryBuilder.php(219): Doctrine\\DBAL\\Connection->executeQuery('SELECT `pid`, `...', Array, Array)
#3 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\core\\Classes\\Database\\Query\\QueryBuilder.php(187): Doctrine\\DBAL\\Query\\QueryBuilder->execute()
#4 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\backend\\Classes\\Utility\\BackendUtility.php(492): TYPO3\\CMS\\Core\\Database\\Query\\QueryBuilder->execute()
#5 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\backend\\Classes\\Utility\\BackendUtility.php(388): TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getPageForRootline(1, '', true, Array)
#6 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\backend\\Classes\\Utility\\BackendUtility.php(867): TYPO3\\CMS\\Backend\\Utility\\BackendUtility::BEgetRootLine(1, '', true)
#7 L:\\htdocs\\t3.demo\\web\\typo3conf\\ext\\cs_seo\\Classes\\Utility\\ConfigurationUtility.php(74): TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getPagesTSconfig(1)
#8 L:\\htdocs\\t3.demo\\web\\typo3conf\\ext\\cs_seo\\Classes\\Utility\\ConfigurationUtility.php(50): Clickstorm\\CsSeo\\Utility\\ConfigurationUtility::getPageTSconfig()
#9 L:\\htdocs\\t3.demo\\web\\typo3conf\\ext\\cs_seo\\Classes\\Hook\\SqlExpectedSchemaHook.php(42): Clickstorm\\CsSeo\\Utility\\ConfigurationUtility::getTablesToExtend()
#10 [internal function]: Clickstorm\\CsSeo\\Hook\\SqlExpectedSchemaHook->addMetadataDatabaseSchemaToTablesDefinition(Array, 'TYPO3\\\\CMS\\\\Insta...')
#11 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\extbase\\Classes\\SignalSlot\\Dispatcher.php(155): call_user_func_array(Array, Array)
#12 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\core\\Classes\\Database\\Schema\\SqlReader.php(154): TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher->dispatch('TYPO3\\\\CMS\\\\Insta...', 'tablesDefinitio...', Array)
#13 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\core\\Classes\\Database\\Schema\\SqlReader.php(75): TYPO3\\CMS\\Core\\Database\\Schema\\SqlReader->emitTablesDefinitionIsBeingBuiltSignal(Array)
#14 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\install\\Classes\\Controller\\InstallerController.php(1159): TYPO3\\CMS\\Core\\Database\\Schema\\SqlReader->getTablesDefinitionString(true)
#15 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\install\\Classes\\Controller\\InstallerController.php(650): TYPO3\\CMS\\Install\\Controller\\InstallerController->importDatabaseData()
#16 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\install\\Classes\\Http\\InstallerRequestHandler.php(113): TYPO3\\CMS\\Install\\Controller\\InstallerController->executeDatabaseDataAction(Object(TYPO3\\CMS\\Core\\Http\\ServerRequest))
#17 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\install\\Classes\\Http\\Application.php(65): TYPO3\\CMS\\Install\\Http\\InstallerRequestHandler->handle(Object(TYPO3\\CMS\\Core\\Http\\ServerRequest))
#18 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\core\\Classes\\Http\\AbstractApplication.php(110): TYPO3\\CMS\\Install\\Http\\Application->handle(Object(TYPO3\\CMS\\Core\\Http\\ServerRequest))
#19 L:\\htdocs\\t3.demo\\web\\typo3\\install.php(104): TYPO3\\CMS\\Core\\Http\\AbstractApplication->run()
#20 L:\\htdocs\\t3.demo\\web\\typo3\\install.php(105): {closure}()
#21 {main}

Next Doctrine\\DBAL\\Exception\\TableNotFoundException: An exception occurred while executing 'SELECT `pid`, `uid`, `title`, `doktype`, `slug`, `tsconfig_includes`, `TSconfig`, `is_siteroot`, `t3ver_oid`, `t3ver_wsid`, `t3ver_state`, `t3ver_stage`, `backend_layout_next_level`, `hidden`, `starttime`, `endtime`, `fe_group`, `nav_hide`, `content_from_pid`, `module`, `extendToSubpages` FROM `pages` WHERE (`uid` = ?) AND (`pages`.`deleted` = 0)' with params [1]:

Table 't3_demo.pages' doesn't exist in L:\\htdocs\\t3.demo\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\AbstractMySQLDriver.php:61
Stack trace:
#0 L:\\htdocs\\t3.demo\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\DBALException.php(184): Doctrine\\DBAL\\Driver\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\DBAL\\Driver\\Mysqli\\MysqliException))
#1 L:\\htdocs\\t3.demo\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\DBALException.php(158): Doctrine\\DBAL\\DBALException::wrapException(Object(Doctrine\\DBAL\\Driver\\Mysqli\\Driver), Object(Doctrine\\DBAL\\Driver\\Mysqli\\MysqliException), 'An exception oc...')
#2 L:\\htdocs\\t3.demo\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Connection.php(938): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\Mysqli\\Driver), Object(Doctrine\\DBAL\\Driver\\Mysqli\\MysqliException), 'SELECT `pid`, `...', Array)
#3 L:\\htdocs\\t3.demo\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Query\\QueryBuilder.php(219): Doctrine\\DBAL\\Connection->executeQuery('SELECT `pid`, `...', Array, Array)
#4 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\core\\Classes\\Database\\Query\\QueryBuilder.php(187): Doctrine\\DBAL\\Query\\QueryBuilder->execute()
#5 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\backend\\Classes\\Utility\\BackendUtility.php(492): TYPO3\\CMS\\Core\\Database\\Query\\QueryBuilder->execute()
#6 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\backend\\Classes\\Utility\\BackendUtility.php(388): TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getPageForRootline(1, '', true, Array)
#7 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\backend\\Classes\\Utility\\BackendUtility.php(867): TYPO3\\CMS\\Backend\\Utility\\BackendUtility::BEgetRootLine(1, '', true)
#8 L:\\htdocs\\t3.demo\\web\\typo3conf\\ext\\cs_seo\\Classes\\Utility\\ConfigurationUtility.php(74): TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getPagesTSconfig(1)
#9 L:\\htdocs\\t3.demo\\web\\typo3conf\\ext\\cs_seo\\Classes\\Utility\\ConfigurationUtility.php(50): Clickstorm\\CsSeo\\Utility\\ConfigurationUtility::getPageTSconfig()
#10 L:\\htdocs\\t3.demo\\web\\typo3conf\\ext\\cs_seo\\Classes\\Hook\\SqlExpectedSchemaHook.php(42): Clickstorm\\CsSeo\\Utility\\ConfigurationUtility::getTablesToExtend()
#11 [internal function]: Clickstorm\\CsSeo\\Hook\\SqlExpectedSchemaHook->addMetadataDatabaseSchemaToTablesDefinition(Array, 'TYPO3\\\\CMS\\\\Insta...')
#12 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\extbase\\Classes\\SignalSlot\\Dispatcher.php(155): call_user_func_array(Array, Array)
#13 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\core\\Classes\\Database\\Schema\\SqlReader.php(154): TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher->dispatch('TYPO3\\\\CMS\\\\Insta...', 'tablesDefinitio...', Array)
#14 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\core\\Classes\\Database\\Schema\\SqlReader.php(75): TYPO3\\CMS\\Core\\Database\\Schema\\SqlReader->emitTablesDefinitionIsBeingBuiltSignal(Array)
#15 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\install\\Classes\\Controller\\InstallerController.php(1159): TYPO3\\CMS\\Core\\Database\\Schema\\SqlReader->getTablesDefinitionString(true)
#16 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\install\\Classes\\Controller\\InstallerController.php(650): TYPO3\\CMS\\Install\\Controller\\InstallerController->importDatabaseData()
#17 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\install\\Classes\\Http\\InstallerRequestHandler.php(113): TYPO3\\CMS\\Install\\Controller\\InstallerController->executeDatabaseDataAction(Object(TYPO3\\CMS\\Core\\Http\\ServerRequest))
#18 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\install\\Classes\\Http\\Application.php(65): TYPO3\\CMS\\Install\\Http\\InstallerRequestHandler->handle(Object(TYPO3\\CMS\\Core\\Http\\ServerRequest))
#19 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\core\\Classes\\Http\\AbstractApplication.php(110): TYPO3\\CMS\\Install\\Http\\Application->handle(Object(TYPO3\\CMS\\Core\\Http\\ServerRequest))
#20 L:\\htdocs\\t3.demo\\web\\typo3\\install.php(104): TYPO3\\CMS\\Core\\Http\\AbstractApplication->run()
#21 L:\\htdocs\\t3.demo\\web\\typo3\\install.php(105): {closure}()
#22 {main}"}

I can work around the problem by removing cs_seo from PackageStates.php before running the Install wizard. If I add the extension afterwards via e.g. Extensionmanager, the extension gets installed.


On extending an existing model: Following the documentation, I've added the following code to my extension's ext_tables.sql:

CREATE TABLE tx_news_domain_model_news (
    tx_csseo int(11) DEFAULT '0' NOT NULL
);

I removed cs_seo from the PackageStates.php as stated above, but still should be able to add something to an existing table.

Still, I'm getting this in my log:

Thu, 07 Feb 2019 18:08:23 +0100 [CRITICAL] request="" component="TYPO3.CMS.Core.Error.ProductionExceptionHandler": Core: Exception handler (WEB): Uncaught TYPO3 Exception: #30: There is no column with name 't3ver_oid' on table 'tx_news_domain_model_news'. | Doctrine\DBAL\Schema\SchemaException thrown in file L:\htdocs\t3.demo\vendor\doctrine\dbal\lib\Doctrine\DBAL\Schema\SchemaException.php in line 89. Requested URL: http://localhost/t3.demo/web/typo3/install.php - {"TYPO3_MODE":"BE","exception":"Doctrine\\DBAL\\Schema\\SchemaException: There is no column with name 't3ver_oid' on table 'tx_news_domain_model_news'. in L:\\htdocs\\t3.demo\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Schema\\SchemaException.php:89
Stack trace:
#0 L:\\htdocs\\t3.demo\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Schema\\Table.php(314): Doctrine\\DBAL\\Schema\\SchemaException::columnDoesNotExist('t3ver_oid', 'tx_news_domain_...')
#1 L:\\htdocs\\t3.demo\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Schema\\Table.php(175): Doctrine\\DBAL\\Schema\\Table->_createIndex(Array, 't3ver_oid', false, false, Array, Array)
#2 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\core\\Classes\\Database\\Schema\\DefaultTcaSchema.php(515): Doctrine\\DBAL\\Schema\\Table->addIndex(Array, 't3ver_oid')
#3 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\core\\Classes\\Database\\Schema\\SchemaMigrator.php(280): TYPO3\\CMS\\Core\\Database\\Schema\\DefaultTcaSchema->enrich(Array)
#4 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\core\\Classes\\Database\\Schema\\SchemaMigrator.php(176): TYPO3\\CMS\\Core\\Database\\Schema\\SchemaMigrator->parseCreateTableStatements(Array)
#5 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\install\\Classes\\Controller\\InstallerController.php(1162): TYPO3\\CMS\\Core\\Database\\Schema\\SchemaMigrator->install(Array)
#6 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\install\\Classes\\Controller\\InstallerController.php(650): TYPO3\\CMS\\Install\\Controller\\InstallerController->importDatabaseData()
#7 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\install\\Classes\\Http\\InstallerRequestHandler.php(113): TYPO3\\CMS\\Install\\Controller\\InstallerController->executeDatabaseDataAction(Object(TYPO3\\CMS\\Core\\Http\\ServerRequest))
#8 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\install\\Classes\\Http\\Application.php(65): TYPO3\\CMS\\Install\\Http\\InstallerRequestHandler->handle(Object(TYPO3\\CMS\\Core\\Http\\ServerRequest))
#9 L:\\htdocs\\t3.demo\\web\\typo3\\sysext\\core\\Classes\\Http\\AbstractApplication.php(110): TYPO3\\CMS\\Install\\Http\\Application->handle(Object(TYPO3\\CMS\\Core\\Http\\ServerRequest))
#10 L:\\htdocs\\t3.demo\\web\\typo3\\install.php(104): TYPO3\\CMS\\Core\\Http\\AbstractApplication->run()
#11 L:\\htdocs\\t3.demo\\web\\typo3\\install.php(105): {closure}()
#12 {main}"}

I guess I should use a statement to maybe ALTER the table and only add the column, correct? I guess this can be figured out "pretty easily" but I'm unsure about the first, main problem.

_/E: According to the official docs the content of ext_tables.sql should be correct with only CREATE TABLE._

I'm looking forward hearing from you, thanks for all your work so far and the efforts you are making!

mhirdes commented 5 years ago

Hi. Please remove the manual added SQL. We use a hook to add the column. In the current documentation it is also described https://docs.typo3.org/typo3cms/extensions/cs_seo/Developer/ExtendExistingModel/Index.html

Kind regards, Marc

jwittorf commented 5 years ago

Hi, thanks for your quick response and sorry, I should pay more attention while reading.

I made sure to remove the content from the ext_tables.sql but the upper problem above the line still occurs. Could you please take a look at the Table 't3_demo.pages' doesn't exist log or could you point me out to something that could cause the problem?

/E: Just to make sure I removed all custom extensions as a test and afterwards everything else, only keeping this in my composer.json, still doesn't work:

...
"require": {
        "php": ">=7.2",
        "typo3/minimal": "^9.5",
        "clickstorm/cs_seo": "^4.0",
        "helhum/typo3-console": "^5.6"
},
...