Bug #42882
FileDoesNotExistException thrown in update
Status: | Resolved | Start date: | 2012-11-12 | |
---|---|---|---|---|
Priority: | Must have | Due date: | ||
Assigned To: | Andreas Wolf | % Done: | 100% |
|
Category: | File Abstraction Layer (FAL) | Spent time: | - | |
Target version: | 6.0.1 | |||
TYPO3 Version: | 6.0 | Is Regression: | ||
PHP Version: | 5.3 | Sprint Focus: | ||
Complexity: | easy |
Description
The install tool update step 2 or 3 from TYPO3 4.7 to 6.0 ends up in an uncaught exception if an image file is not found. There is no folder "_migrated".
Uncaught TYPO3 Exception
TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException thrown in file
/var/www/mydomain/web/typo3_src-6.0.0rc1/typo3/sysext/core/Classes/Resource/Driver/AbstractDriver.php in line 400.
7 TYPO3\CMS\Core\Resource\Driver\AbstractDriver::getFile("_migrated/pics/nattier043_w.jpg")
/var/www/mydomain/web/typo3_src-6.0.0rc1/typo3/sysext/core/Classes/Resource/ResourceStorage.php:
00793: */
00794: public function getFile($identifier) {
00795: return $this->driver->getFile($identifier);
00796: }
00797:
6 TYPO3\CMS\Core\Resource\ResourceStorage::getFile("_migrated/pics/nattier043_w.jpg")
/var/www/mydomain/web/typo3_src-6.0.0rc1/typo3/sysext/install/Classes/Updates/TceformsUpdateWizard.php:
00199: rename($sourcePath, $targetPath);
00200: // get the File object
00201: $file = $this->storage->getFile($fieldConfiguration['targetPath'] . $item);
00202: if ($file instanceof \TYPO3\CMS\Core\Resource\File) {
00203: $fields = array(
5 TYPO3\CMS\Install\Updates\TceformsUpdateWizard::migrateField("tt_content", array, "image", array)
/var/www/mydomain/web/typo3_src-6.0.0rc1/typo3/sysext/install/Classes/Updates/TceformsUpdateWizard.php:
00147: foreach ($records as $record) {
00148: foreach ($fieldsToMigrate as $field) {
00149: $dbQueries = array_merge($this->migrateField($table, $record, $field, $tableConfiguration[$field]));
00150: }
00151: }
4 TYPO3\CMS\Install\Updates\TceformsUpdateWizard::performUpdate(array, "")
/var/www/mydomain/web/typo3_src-6.0.0rc1/typo3/sysext/install/Classes/Installer.php:
05761: $dbQueries = array();
05762: $databaseQueries = array();
05763: if ($tmpObj->performUpdate($dbQueries, $customOutput)) {
05764: $performUpdateMarkers['updateStatus'] = 'Update successful!';
05765: } else {
3 TYPO3\CMS\Install\Installer::updateWizard_parts("performUpdate")
/var/www/mydomain/web/typo3_src-6.0.0rc1/typo3/sysext/install/Classes/Installer.php:
05599: // call wizard
05600: $action = $this->INSTALL['database_type'] ? $this->INSTALL['database_type'] : 'checkForUpdate';
05601: $this->updateWizard_parts($action);
05602: $this->output($this->outputWrapper($this->printAll()));
05603: }
2 TYPO3\CMS\Install\Installer::updateWizard()
/var/www/mydomain/web/typo3_src-6.0.0rc1/typo3/sysext/install/Classes/Installer.php:
00539: $this->checkDatabase();
00540: $this->silent = 0;
00541: $this->updateWizard();
00542: break;
00543: case 'config':
1 TYPO3\CMS\Install\Installer::init()
/var/www/mydomain/web/typo3_src-6.0.0rc1/typo3/install/index.php:
00080: require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('install') . 'mod/class.tx_install.php';
00081: $install_check = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Install\\Installer', TRUE);
00082: $install_check->init();
00083: ?>
Related issues
Associated revisions
[BUGFIX] FAL: update wizard fails if file does not exist
The FAL update wizard throws an exception during migration if a file is
missing. As we cannot do that much about a missing source file, we
should at least not fatal here, but give the user a warning message in
the logs instead.
Change-Id: I3ab0ecd8d8f60e782b7459d7f92f89d2c0a9fd40
Resolves: #42882
Releases: 6.1, 6.0
Reviewed-on: https://review.typo3.org/16533
Reviewed-by: Franz Holzinger
Tested-by: Franz Holzinger
Reviewed-by: Francois Suter
Tested-by: Francois Suter
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
[BUGFIX] FAL: update wizard fails if file does not exist
The FAL update wizard throws an exception during migration if a file is
missing. As we cannot do that much about a missing source file, we
should at least not fatal here, but give the user a warning message in
the logs instead.
Change-Id: I3ab0ecd8d8f60e782b7459d7f92f89d2c0a9fd40
Resolves: #42882
Releases: 6.1, 6.0
Reviewed-on: https://review.typo3.org/16533
Reviewed-by: Franz Holzinger
Tested-by: Franz Holzinger
Reviewed-by: Francois Suter
Tested-by: Francois Suter
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
Reviewed-on: https://review.typo3.org/17489
History
#1 Updated by Andreas Wolf over 2 years ago
Does the whole folder "_migrated" not exist or just the file? And does the file uploads/pics/nattier043_w.jpg exist/did it exist before the update?
What I'm trying to find out: Did the migration fail completely or was it just a missing file that did not exist before the update.
#2 Updated by Andreas Wolf over 2 years ago
- Category set to File Abstraction Layer (FAL)
- Status changed from New to Needs Feedback
- Assigned To set to Andreas Wolf
- Target version set to 6.0.0
#3 Updated by Franz Holzinger over 2 years ago
There is a folder ~/web/fileadmin/_migrated/pics. Maybe this one is correct.
However it contains only 2 image files. Much too few for this homepage.
The install tool's update process is broken. There is no option to continue from here.
The file "uploads/pics/nattier043_w.jpg" does not exist. Apperently this file has been removed before the update. But the install tool should not stop in such a case or offer to remove the image automatically.
#4 Updated by Klaus Hinum over 2 years ago
Same here, step
Migrate all file relations from tt_content.image and pages.media
stops after a missing image and wont continue.
#5 Updated by Franz Holzinger over 2 years ago
This happens in the install tool.
Step 2 - Configuration of updates
Migrate all file relations from tt_content.image and pages.media
#6 Updated by Andreas Wolf over 2 years ago
- Status changed from Needs Feedback to Accepted
- Target version changed from 6.0.0 to 6.0.0-RC2
Ok, I think we should automatically remove files which are not present and note this in the syslog.
#7 Updated by Gerrit Code Review over 2 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16533
#8 Updated by Gerrit Code Review over 2 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16533
#9 Updated by Klaus Hinum over 2 years ago
still not fixed in 6.0.0RC2
#10 Updated by Christian Eßl over 2 years ago
still not fixed in 6.0
impossible to proceed the update process from there.
#11 Updated by Klaus Hinum over 2 years ago
same here, cant update to 6.0
#12 Updated by Andreas Wolf over 2 years ago
Right, this is not fixed - but there is a patch. I'd be glad if you tested it in your environment to see if it works with the patch. If yes, please vote for it, so we get it in for 6.0.1.
#13 Updated by Franz Holzinger over 2 years ago
I have applied this patch:
Then it ends up in this error message:
Fatal error: Class '\\TYPO3\CMS\Core\Log\LogManager' not found in /var/www/mydomain/web/typo3_src-6.0.0/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 4155
This is wrong:
public function construct() {
/** @var $logManager \TYPO3\CMS\Core\Log\LogManager */
$logManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\TYPO3\CMS\Core\Log\LogManager');
$this->logger = $logManager->getLogger(__CLASS);
}
Fix:
==> $logManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Log\\LogManager');
And after this, the
Step 2 - Configuration of updates
I get:
Migrate all file relations from tt_content.image and pages.media
Update successful!
So make this bugfix and I can vote. But where do I vote?
#14 Updated by Gerrit Code Review over 2 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16533
#15 Updated by Andreas Wolf over 2 years ago
- Target version changed from 6.0.0-RC2 to 6.0.1
- Complexity set to easy
Franz Holzinger wrote:
So make this bugfix and I can vote. But where do I vote?
I'll upload a revised version of the patch in a minute. You could just give you +1 on "code review" and "verified" in Gerrit. The login is your usual typo3.org login as used for Forge and all other services.
#16 Updated by Stefan Neufeind over 2 years ago
On gerrit it was mentioned that the fix under review here seems to also fix #43509. Please consider in tests or when finally closing this bug here.
#17 Updated by Dmitry Dulepov over 2 years ago
- File not-migrated.png added
Added a way to show what was NOT migrated. See the screenshot.
#18 Updated by Gerrit Code Review over 2 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16533
#19 Updated by Gerrit Code Review over 2 years ago
Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/17489
#20 Updated by Anonymous over 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset aa1463e03c68d9b9ebb69ebe657a1e6275815e81.