Bug #54256
closed
Fatal error: RedirectLoopException
Added by Nico de Haen almost 11 years ago.
Updated almost 7 years ago.
Description
I get an uncaught exception 'TYPO3\CMS\Install\Controller\Exception\RedirectLoopException' in the InstallTool with message 'Redirect loop aborted.' which I can only avoid by commenting the redirect in the catch statement of the \TYPO3\CMS\Install\Controller\StepController->outputSpecificStep method.
This happens on different installations and on different server after upgrading from 6.1.6 to master.
The problem behind the issue:
- Some configuration changes are done behind the scene and lead to a redirect to the tool themself.
- If the configuration is overwritten in AdditionlConfiguration the change in LocalConfiguration is ignored
- The Tool themself thinks it needs to change the parameter and redirects afterwards to themself.
This Loop stops, after 10 iterations with "Fatal error: RedirectLoopException" in the Logs.
What needs to be done:
- Do not show a white page, we should output something to the user and hint what may be the problem.
- Give the tools the ability to know what was changed last and a test if this change happened after reload, then we can give detailed error message where we break.
I still get this on different machines.
Here the exact error output:
Fatal error: Uncaught exception 'TYPO3\CMS\Install\Controller\Exception\RedirectLoopException' with message'Redirect loop aborted.
If this message is shown again after a reload, your setup is so weird that the install tool is unable to handle it.
Please make sure to remove the "install[redirectCount]" parameter from your request or restart the install tool from the backend navigation.'
in /var/www/typo3_src/typo3/sysext/install/Classes/Controller/AbstractController.php:523
Stack trace:
#0 /var/www/typo3_src/typo3/sysext/install/Classes/Controller/StepController.php(132): TYPO3\CMS\Install\Controller\AbstractController->redirect('', 'databaseConnect')
#1 /var/www/typo3_src/typo3/sysext/install/Classes/Controller/StepController.php(70): TYPO3\CMS\Install\Controller\StepController->outputSpecificStep()
#2 /var/www/typo3_src/typo3/sysext/install/Start/Install.php(134): TYPO3\CMS\Install\Controller\StepController->execute()
#3 {main}
thrown in /var/www/typo3_src/typo3/sysext/install/Classes/Controller/AbstractController.php on line 523
Ok I found the reason now:
There is a condition in the DatabaseConnect Step:
\TYPO3\CMS\Install\Controller\Action\Step\DatabaseConnect::isHostConfigured()
This causes a redirect if no port and no socket is configured.
The database connection is working if the mysql port is the default port, but the install tool throws this fatal error.
In previous versions the database configuration without defining a port was working also, so this might be a show stopper for many people when upgrading, especially since there is no hint at all, what is going wrong
Hi Nico,
I'd like to know following:
- Do you use a opcode cache?
- If yes, as you are using TYPO3 5.4, this may be APC?
- Did you disable stats for APC?
- Status changed from New to Needs Feedback
I had APC enabled, but just tested it:
if I disable APC completely and restart apache, the problem remains the same: without explicitly configuring a port I end up in the redirect loop error.
I can exclude a configuration error, since the InstallTool shows the warning "No opcode cache loaded" (when I set the port to avoid the fatal error).
I tried it several times, with removing the parameter but also with starting again by clicking on the install tool icon in the Backend menu.
When you had 7 redirects, is the port or socket configured by some default value?
Since as long as the method Step\DatabaseConnect::isHostConfigured returns FALSE, the Step Controller can't continue...
It is saved with the default value of an empty string.
Ah ok, then I know what's going wrong:
I have this in AdditionalConfiguration.php:
$GLOBALS['TYPO3_CONF_VARS']['DB'] = array(
'database' => 'typo3',
'extTablesDefinitionScript' => 'extTables.php',
'host' => 'localhost',
'password' => 'foo',
'username' => 'bar'
);
So the whole $GLOBALS['TYPO3_CONF_VARS']['DB'] is overwritten and the port configuration in LocalConfiguration.php is lost when the AdditionalConfiguration.php is included.
This worked with 6.1 since it was not as "strict" as the new InstallTool.
I think this type of overwriting $GLOBALS['TYPO3_CONF_VARS']['DB'] is special case and probably not supported.
A more verbose error message would have helped to figure out what's wrong...
A better error message is hard to implement, cause it would mean that every config change which will do a redirect to the script self needs to know what it does at least and why does the change did not work. Very hard to find and hopefully do not happen very often.
But may need to be fixed.
- Subject changed from Fatal error: Redirect loop aborted to Fatal error: RedirectLoopException
- Category set to Install Tool
- Status changed from Needs Feedback to New
Also stumbled upon this today when upgrading from 6.1.9 to 6.2.9.
Problem was a missing socket
setting in my configuration. Fixed it with: socket => ''
port
was not necessary to set for me.
That's how the database configuration is currently integrated in my setup (working):
LocalConfiguration.php
return array(
'DB' => array(),
);
AdditionalConfiguration.php
$GLOBALS['TYPO3_CONF_VARS']['DB'] = array(
'database' => 'typo3',
'host' => 'localhost',
'password' => 'typo3',
'username' => 'typo3',
'socket' => '', # <- IMPORTANT! throws RedirectLoopException in Install Tool if 'socket' key is missing
);
- Target version changed from 6.2.0 to 6.2.12
This is still not fixed as of 6.2.12? Anybody got any clue as to why an optional db setting is enough to completely prevent an upgrade?
- Target version changed from 6.2.12 to 6.2.14
- Target version changed from 6.2.14 to 6.2.15
- Target version changed from 6.2.15 to 6.2.16
- Target version changed from 6.2.16 to Candidate for patchlevel
- Status changed from New to Needs Feedback
Does this still affects 7.6.x or 8.7.x ?
- Status changed from Needs Feedback to Closed
- Target version deleted (
Candidate for patchlevel)
90 days without feedback -> closing it.
If you think that this is the wrong decision or experience the issue again or have more information about how to reproduce it on recent TYPO3 versions like 8.7.x or 9.0.0, please reopen it or open a new issue with a reference to this one.
Thank you.
Also available in: Atom
PDF