Bug #58337

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

Added by Gerrit Mohrmann about 7 years ago. Updated over 2 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';

?>

#1

Updated by Oliver Hader about 7 years ago

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

Updated by Gerrit Code Review about 7 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

#3

Updated by Helmut Hummel about 7 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" ?

#4

Updated by Helmut Hummel about 7 years ago

  • Status changed from Under Review to Needs Feedback
#5

Updated by Gerrit Code Review about 7 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

#6

Updated by Gerrit Code Review about 7 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

#7

Updated by Sascha Wilking about 7 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.

#8

Updated by Gerrit Code Review about 7 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

#9

Updated by Gerrit Code Review about 7 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

#10

Updated by Gerrit Code Review about 7 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

#11

Updated by Sascha Wilking about 7 years ago

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

Updated by Gerrit Mohrmann about 7 years ago

Helmut Hummel wrote:

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

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

#13

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF