Bug #57789
closedInstall Tool Upgrade Wizard stuck on "Update database schema: Create tables and fields"
Added by Gautam K. over 10 years ago. Updated over 9 years ago.
0%
Description
I installed a copy of TYPO3 6.2.0 over a TYPO3 6.1.6 installation.
When running the Install Tool Upgrade Wizard, it gets stuck on the Upgrade Wizard: "Update database schema: Create tables and fields".
It wants to ALTER tt_content, add two fields. However, these fields exist, so it crashes. Even when I manually remove the fields, rerun the wizard (success), it loops back to the same message (it wants to add the same fields, which it can't).
As I cannot manually continue to the next Upgrade Wizard, I'm stuck in an infinite loop and cannot finish the Upgrade Wizard.
Files
Screenshot_2014-04-09_19.52.56.png (84.9 KB) Screenshot_2014-04-09_19.52.56.png | overview | Gautam K., 2014-04-09 23:05 | |
Screenshot_2014-04-09_19.56.39.png (21.5 KB) Screenshot_2014-04-09_19.56.39.png | database analyzer | Gautam K., 2014-04-09 23:05 | |
Screenshot_2014-04-09_19.58.36.png (19.4 KB) Screenshot_2014-04-09_19.58.36.png | database analyzer: error | Gautam K., 2014-04-09 23:05 | |
Screenshot_2014-04-09_19.59.36.png (27.7 KB) Screenshot_2014-04-09_19.59.36.png | page on which I'm stuck | Gautam K., 2014-04-09 23:05 |
Updated by Gautam K. over 10 years ago
- tt_content.loginstatusredirect_status
- tt_content.loginstatusredirect_pid
MySQL version 5.5.33 on Mac OS X 10.9.2
Updated by Markus Klein over 10 years ago
Please do not link the images but upload them here directly.
Updated by Gautam K. over 10 years ago
- File Screenshot_2014-04-09_19.52.56.png Screenshot_2014-04-09_19.52.56.png added
- File Screenshot_2014-04-09_19.56.39.png Screenshot_2014-04-09_19.56.39.png added
- File Screenshot_2014-04-09_19.58.36.png Screenshot_2014-04-09_19.58.36.png added
- File Screenshot_2014-04-09_19.59.36.png Screenshot_2014-04-09_19.59.36.png added
Markus Klein wrote:
Please do not link the images but upload them here directly.
Alright. Please find them attached.
Updated by Markus Klein over 10 years ago
- Status changed from New to Needs Feedback
These are non-Core database fields. Please find out from which extension they are and paste the content of the ext_tables.sql here.
Updated by Gautam K. over 10 years ago
EXT:loginstatusredirect
CREATE TABLE tt_content ( loginstatusredirect_status varchar(3) NOT NULL DEFAULT 'in', loginstatusredirect_pid int(10) NOT NULL DEFAULT '0' );
Updated by Markus Klein over 10 years ago
Hm, I applied that in a demo extension here, but the compare database does not complain.
The fields exist and obviously they are properly identified to exist by the Core.
Something is weird with your database somehow, since the analyzer always has the impression that these fields are not present in the db.
I can not help you here, sorry, you need to debug why the fields are not detected.
Maybe someone else is able to reproduce this, I only have Fedora and MariaDB at hand.
Thanks for taking the time to report!
Updated by Gautam K. over 10 years ago
Thanks, Markus.
I have the same problem in another site, with different tables. Seems like TYPO3 doesn't understand the additional key specification.
ALTER TABLE tx_kestats_cache DROP KEY whereclause_index; ALTER TABLE tx_kestats_cache ADD KEY whereclause_index (whereclause(260),orderby(20),groupby(20));
EXT:ke_stats/ext_tables.sql:
[...] # # Table structure for table 'tx_kestats_cache' # CREATE TABLE tx_kestats_cache ( uid int(11) NOT NULL auto_increment, whereclause text NOT NULL, orderby text NOT NULL, groupby text NOT NULL, result longtext NOT NULL, PRIMARY KEY (uid), KEY whereclause_index (whereclause(260),orderby(20),groupby(20)) ); [...]
(this one's on a Debian machine)
Updated by Markus Klein over 10 years ago
I knew this kind of problems, but I did not experience these issues for a long time now. Maybe there's some crucial database setting that causes this, which we don't know of yet.
It would be really interesting what information the DatabaseSchemaMigrationService gets from the database. If you have the possibility to debug this, it would be awesome.
Updated by Gautam K. over 10 years ago
Markus Klein wrote:
If you have the possibility to debug this, it would be awesome.
Sure, I'd be happy to. Could you give me some instructions on how to do this?
Updated by Markus Klein over 10 years ago
Sorry, I can't give you a full how-to on debugging PHP here. There are just way too many ways and too many possible system setups.
Please consider finding a tutorial on the web matching you setup best. Thanks for your understanding.
Updated by Gautam K. over 10 years ago
I understand. I do know basic debugging and have it all set up on my system, but a starting point/where to look for would be useful. I'm not so much into the TYPO3 core.
Updated by Markus Klein over 10 years ago
Ups, I understood you wrong. ;-)
Sure I can give you a hint about breakpoints.
Start with:
typo3/sysext/install/Classes/Updates/AbstractDatabaseSchemaUpdate.php line 68 ($this->schemaMigrationService->getFieldDefinitions_database();
)
Step into the getFieldDefinitions_database()
function and have a look what is going on in there. I guess line 197 is the most interesting part, where a table's fields are loaded.
Updated by Alexander Opitz about 10 years ago
- Target version deleted (
next-patchlevel)
Hi Gautam,
do you have some more information to this issue?
Updated by Gisèle Wendl about 10 years ago
I found that the main reason for this are differences in the file ext_tables.sql and the return of MySQL.
Under TYPO3 6.1 in file /typo3/sysext/install/Classes/Updates/SchemaMigrator.php - function getDatabaseExtra around Line 344:
You can check a given table with this:
public function getDatabaseExtra($FDsrc, $FDcomp, $onlyTableList = '', $ignoreNotNullWhenComparing = TRUE) { $extraArr = array(); $diffArr = array(); if (is_array($FDsrc)) { foreach ($FDsrc as $table => $info) { // added lines if ($table == 'tx_toctoc_comments_ipbl_static') { print '<br>file:<br>'; print_r ($FDsrc[$table]); print '<br>database:<br>'; print_r ($FDcomp[$table]); exit; } // end added lines if (!strlen($onlyTableList) || \TYPO3\CMS\Core\Utility\GeneralUtility::inList($onlyTableList, $table)) { if (!isset($FDcomp[$table])) { ...
replace 'tx_toctoc_comments_ipbl_static' by the table you want to see the two arrays (from file versus from MySQL).
Then run Compare Database in Installtool to see the output.
I found often spaces in the ext_tables.sql to be the cause of the "DROP KEY - ADD KEY"-Bug. But Comparing the 2 arrays shows all possible causes.
Updated by Markus Klein over 9 years ago
- Status changed from Needs Feedback to Closed
No feedback within 90 days, closing this issue.
If you think this is the wrong decision, please open a new ticket and reference this one.