Project

General

Profile

Actions

Bug #54256

closed

Fatal error: RedirectLoopException

Added by Nico de Haen almost 11 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Install Tool
Target version:
-
Start date:
2013-12-07
Due date:
% Done:

0%

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

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.

Actions #1

Updated by Nico de Haen almost 11 years ago

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

Actions #2

Updated by Nico de Haen almost 11 years ago

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

Actions #3

Updated by Alexander Opitz almost 11 years ago

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?

Actions #4

Updated by Alexander Opitz almost 11 years ago

  • Status changed from New to Needs Feedback
Actions #5

Updated by Nico de Haen almost 11 years ago

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).

Actions #6

Updated by Alexander Opitz almost 11 years ago

Ok, was an idea.

So as I understand you correct, you updated from 6.1.6 to master. And you have no configuration set for
['TYPO3_CONF_VARS']['DB']['port'] and ['TYPO3_CONF_VARS']['DB']['socket'].

Tried this, and browsed to http://localhost/typo3/sysext/install/Start/Install.php then I got 7 redirects and then all was fine.

Normaly you have something like http://localhost/typo3/sysext/install/Start/Install.php?install[redirectCount]=9&install[context]=standalone&install[controller]=tool in your browser. What happens if you remove the "install[redirectCount]=9" part and try this url again?

Actions #7

Updated by Nico de Haen almost 11 years ago

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...

Actions #8

Updated by Alexander Opitz almost 11 years ago

It is saved with the default value of an empty string.

Actions #9

Updated by Nico de Haen almost 11 years ago

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...

Actions #10

Updated by Alexander Opitz almost 11 years ago

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.

Actions #11

Updated by Alexander Opitz almost 11 years ago

  • Subject changed from Fatal error: Redirect loop aborted to Fatal error: RedirectLoopException
  • Category set to Install Tool
  • Status changed from Needs Feedback to New
Actions #12

Updated by Tilo Baller almost 10 years ago

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
);

Actions #13

Updated by Brian S over 9 years ago

  • 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?

Actions #14

Updated by Alexander Opitz over 9 years ago

  • Target version changed from 6.2.12 to 6.2.14
Actions #15

Updated by Alexander Opitz over 9 years ago

  • Target version changed from 6.2.14 to 6.2.15
Actions #16

Updated by Alexander Opitz about 9 years ago

  • Target version changed from 6.2.15 to 6.2.16
Actions #17

Updated by Riccardo De Contardi over 8 years ago

  • Target version changed from 6.2.16 to Candidate for patchlevel
Actions #18

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from New to Needs Feedback

Does this still affects 7.6.x or 8.7.x ?

Actions #19

Updated by Riccardo De Contardi almost 7 years ago

  • 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.

Actions

Also available in: Atom PDF