Project

General

Profile

Actions

Bug #57789

closed

Install 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.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Install Tool
Target version:
-
Start date:
2014-04-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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
Actions #1

Updated by Gautam K. over 10 years ago

Fields:
  • tt_content.loginstatusredirect_status
  • tt_content.loginstatusredirect_pid

MySQL version 5.5.33 on Mac OS X 10.9.2

Actions #2

Updated by Markus Klein over 10 years ago

Please do not link the images but upload them here directly.

Actions #4

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.

Actions #5

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'
);
Actions #6

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!

Actions #7

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)

Actions #8

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.

Actions #9

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?

Actions #10

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.

Actions #11

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.

Actions #12

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.

Actions #13

Updated by Alexander Opitz about 10 years ago

  • Target version deleted (next-patchlevel)

Hi Gautam,

do you have some more information to this issue?

Actions #14

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.

Actions #15

Updated by Markus Klein about 10 years ago

What are the differences you saw?

Actions #16

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.

Actions

Also available in: Atom PDF