Project

General

Profile

Actions

Bug #57393

closed

Task #57578: TceformsUpdateWizard improvements (Migrate all file relations from tt_content.image and pages.media)

Endless Loop in TceformsUpdateWizard

Added by Benjamin Pucher about 10 years ago. Updated over 5 years ago.

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

100%

Estimated time:
0.25 h
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

Description

I'm currently updating a large TYPO3 Website from 4.5 to 6.2 and have found a bug in the Upgrade Wizard.
The migration with title 'Migrate all file relations from tt_content.image and pages.media' (typo3/sysext/install/Classes/Updates/TceformsUpdateWizard.php) ends up in an endless loop.
The problem exists in the do/while loop starting at line 188 respectively in the getRecordsFromTable method in typo3/sysext/install/Classes/Updates/TceformsUpdateWizard.php.

188 do {
189     $records = $this->getRecordsFromTable($table, $fieldToMigrate, $fieldsToGet, self::RECORDS_PER_QUERY);
190     foreach ($records as $record) {
191         $this->migrateField($table, $record, $fieldToMigrate, $fieldConfiguration, $customMessages);
192     }
193 } while (count($records) === self::RECORDS_PER_QUERY);

self::RECORDS_PER_QUERY is set to 1000. Every time a query like 'select ... LIMIT 1000' is created. Because there's no starting point defined after the LIMIT statement (which should be 0 on first loop and then += self::RECORDS_PER_QUERY) the query will always fetch the first self::RECORDS_PER_QUERY entries. Thus the while condition is always true.
To fix this the LIMIT statement should have the starting point included like LIMIT <entries_fetched_so_far>, self::RECORDS_PER_QUERY.

Please fix this asap since many people will update their TYPO3 LTS Websites shortly.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #43725: TceformsUpdateWizard exceeds memory_limit/max_execution_timeClosed2012-12-07

Actions
Related to TYPO3 Core - Task #57572: TceformsUpdateWizard has to handle SQL errorsClosedMarkus Klein2014-04-02

Actions
Actions #1

Updated by Steffen Krüchten almost 10 years ago

I can confirm this Bug, also trying to update a small Installation to 6.2.0 from 4.5.32 with PHP 5.3.27. Everything else went smooth, Frontend is up and running but no Content images at all.

Upgrade Wizard throws a "Uncaught TYPO3 Exception" in Debug-Mode when trying to execute "Migrate all file relations from tt_content.image and pages.media":
PHP Warning: Invalid argument supplied for foreach() in typo3/sysext/install/Classes/Updates/TceformsUpdateWizard.php line 190.

Actions #2

Updated by Markus Klein almost 10 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (next-patchlevel)

These are two different issues.

The issue reported here is IMO not an issue. The limit is ok, you can always start from 0, because the select query only looks at records not yet migrated!

Regarding the foreach() thing. There seems to be a DB issue, the select seems to fail.
I'll create a new ticket for this, which introduces a better check and issues an exception with the SQL error.

Actions #3

Updated by Markus Klein almost 10 years ago

The new ticket for the foreach() issue is #57572

Actions #4

Updated by Markus Klein almost 10 years ago

  • Parent task set to #57578
Actions #5

Updated by Tobias Braumann almost 10 years ago

I can confirm this Bug, too. In our case the Problem was that we have a lot of pictures in tt_content,
which no longer exist and the script don't set the image field to 1 or delete the entries.
So in the foreach() there are still the same 1000 entries (infinityloop).

We fix that problem by increasing the value self::RECORDS_PER_QUERY to the number of entries from tt_content.

Actions #6

Updated by Alexander Opitz over 9 years ago

  • Status changed from Needs Feedback to New
Actions #7

Updated by Sebastian Helzle over 9 years ago

We also had this issue today with a big site (~15000 pages) and more than 1000 missing media files in the page properties because we tried the upgrade on a lightweight copy without the assets.

Actions #8

Updated by Gerrit Code Review about 9 years ago

  • Status changed from New to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37032

Actions #9

Updated by Gerrit Code Review about 9 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37032

Actions #10

Updated by Gerrit Code Review about 9 years ago

Patch set 3 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37032

Actions #11

Updated by Markus Klein about 9 years ago

We kindly ask you to please test the patch linked above with your databases.
If it works for you, please vote accordingly.

Thanks a lot!

Actions #12

Updated by Markus Klein about 9 years ago

  • Target version set to next-patchlevel
  • Complexity changed from easy to medium
Actions #13

Updated by Gerrit Code Review about 9 years ago

Patch set 4 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37032

Actions #14

Updated by Gerrit Code Review about 9 years ago

Patch set 5 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37032

Actions #15

Updated by shanmugarajan k about 9 years ago

It seems,once click Execute, i never see this "Migrate all file relations from tt_content.image and pages.media" upgrade wizard.

I have around 10000+ records.

I re-imported the db, but still i could not see the wizard again. can you please let me know if i doing something wrong?

Actions #16

Updated by shanmugarajan k about 9 years ago

i just saw in the LocalConfiguration.php

'INSTALL' => array() having the 'wizardDone' wizard is entered. Hence its not visible again.

so it seems, this is added as soon as first run completed.

Actions #17

Updated by Markus Klein about 9 years ago

@shanmugarajan

Which TYPO3 version are you upgrading from?
Are you sure you actually need this patch?

It can well be that the wizard manages to complete the migration in one go, so it won't show up again.

Actions #18

Updated by shanmugarajan k about 9 years ago

Hello Markus,

Yes. i upgrading from 4.5 to 6.2.

Yes. needed. thanks.

Actions #19

Updated by Nicole Cordes about 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #20

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF