Project

General

Profile

Actions

Bug #58337

closed

'Clear all cache' redirects to 'Detected Fatal Error' with 'No database selected'

Added by Gerrit Mohrmann almost 10 years ago. Updated over 5 years ago.

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

100%

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

Description

Detected Fatal Error
Uncaught exception 'RuntimeException' with message 'TYPO3 Fatal Error: No database selected!' in /xxxx/typo3_src-test/typo3/sysext/core/Classes/Database/DatabaseConnection.php:1563 Stack trace: #0 /xxxx/typo3_src-test/typo3/sysext/install/Classes/Service/ClearCacheService.php(116): TYPO3\CMS\Core\Database\DatabaseConnection->connectDB() #1 /xxxx/typo3_src-test/typo3/sysext/install/Classes/Service/ClearCacheService.php(67): TYPO3\CMS\Install\Service\ClearCacheService->getDatabaseConnection() #2 /xxxx/typo3_src-test/typo3/sysext/install/Classes/Controller/Action/Tool/ImportantActions.php(162): TYPO3\CMS\Install\Service\ClearCacheService->clearAll() #3 /xxxx/typo3_src-test/typo3/sysext/install/Classes/Controller/Action/Tool/ImportantActions.php(57): TYPO3\CMS\Install\Controller\Action\Tool\ImportantActions->clearAllCache() #4 /xxxx/typo3_src-test/typo3/sysext/install/Classes/C in /xxxx/typo3_src-test/typo3/sysext/core/Classes/Database/DatabaseConnection.php on line 1563

New T3 6.2.1 installation. Core symlinked.
After moving the database settings from LocalConfiguration.php to an external file and include this in AdditionalConfiguration.php the error comes up.
The Install Tool shows the right database parameter and the backend worked.
But 'Clear all caches' in the Install Tool throws the error.

AdditionalConfiguration.php:

<?php
if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}

$configFile = PATH_site . '../../config/T3Configuration.php';
if (file_exists($configFile)) {
    require_once($configFile);
}

?>

T3Configuration.php:

<?php
if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}

$GLOBALS['TYPO3_CONF_VARS']['DB']['database'] = 'xxxx';
$GLOBALS['TYPO3_CONF_VARS']['DB']['password'] = 'xxxx';
$GLOBALS['TYPO3_CONF_VARS']['DB']['host'] = '127.0.0.1';
$GLOBALS['TYPO3_CONF_VARS']['DB']['port'] = 3306;
$GLOBALS['TYPO3_CONF_VARS']['DB']['username'] = 'xxxx';

?>

Actions #1

Updated by Oliver Hader almost 10 years ago

  • Status changed from New to Accepted
  • Priority changed from Must have to Should have
  • Target version deleted (next-patchlevel)
Actions #2

Updated by Gerrit Code Review almost 10 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29811

Actions #3

Updated by Helmut Hummel almost 10 years ago

Gerrit Mohrmann wrote:

AdditionalConfiguration.php:
[...]

require_once of T3Configuration.php is wrong. It must be just plain require here!

What are the reasons not to use just "require" ?

Actions #4

Updated by Helmut Hummel almost 10 years ago

  • Status changed from Under Review to Needs Feedback
Actions #5

Updated by Gerrit Code Review almost 10 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29811

Actions #6

Updated by Gerrit Code Review almost 10 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29811

Actions #7

Updated by Sascha Wilking almost 10 years ago

Correct, it recommend to use require instead of require_once. But it don't make sense to reload LocalConfiguration and AdditionalConfiguration in the clear all cache method.

Actions #8

Updated by Gerrit Code Review almost 10 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29811

Actions #9

Updated by Gerrit Code Review almost 10 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29811

Actions #10

Updated by Gerrit Code Review almost 10 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29811

Actions #11

Updated by Sascha Wilking almost 10 years ago

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

Updated by Gerrit Mohrmann almost 10 years ago

Helmut Hummel wrote:

What are the reasons not to use just "require" ?

No reason for the require_once, require does it. Thanks!

Actions #13

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF