Forum Post Assistant too many redirects Topic is solved

This Forum board is about discussions about the FPA tool.
springburn
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Tue Feb 28, 2017 5:23 pm

Forum Post Assistant too many redirects

Post by springburn » Wed Oct 28, 2020 6:42 pm

Trying to run the fpa with domain.com\fpa-en.php we get domain.com redirected you too many times - ERR_TOO_MANY_REDIRECTS
This is a Ubuntu 20, php 7.4, vhost site running under ispconfig 3.2b3 and fpa-en.php is in the site's webroot directory.
The .htaccess matches the standard htaccess.txt
While it has issues the site does load normally.

Additionally, is there is a way to force Joomla to see webroot as:
/var/www/domain.tls/web
instead of
/var/www/clients/client1/web1/web

Thanks in advance
Last edited by imanickam on Thu Oct 29, 2020 2:31 am, edited 1 time in total.
Reason: Moved topic » from General Questions/New to Joomla! 3.x to Forum Post Assistant (FPA)

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 13261
Joined: Thu Feb 15, 2007 5:48 am
Location: Zagreb, Croatia

Re: Forum Post Assistant too many redirects

Post by toivo » Thu Oct 29, 2020 9:06 am

springburn wrote:
Wed Oct 28, 2020 6:42 pm
fpa-en.php is in the site's webroot directory.
Is that the main directory where Joomla is installed? Then no redirections should be possible, unless they have been configured in the web server.

springburn wrote:
Wed Oct 28, 2020 6:42 pm
Additionally, is there is a way to force Joomla to see webroot as:
/var/www/domain.tls/web
instead of
/var/www/clients/client1/web1/web
The web server sets the document root of each of its virtual hosts in their configuration files. Joomla has nothing to do with that.
Toivo Talikka, Global Moderator

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39463
Joined: Sat Apr 05, 2008 9:58 pm

Re: Forum Post Assistant too many redirects

Post by Webdongle » Thu Oct 29, 2020 2:29 pm

Is this a local machine or remote Host?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

springburn
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Tue Feb 28, 2017 5:23 pm

Re: Forum Post Assistant too many redirects

Post by springburn » Thu Oct 29, 2020 2:33 pm

Remote host (AWS)

springburn
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Tue Feb 28, 2017 5:23 pm

Re: Forum Post Assistant too many redirects

Post by springburn » Fri Oct 30, 2020 4:20 pm

To answer the previous question:
Yes fpa-en.php is in the site's webroot directory which is also where the joomla directory is installed.
The only redirect on the site is for http to https

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 13261
Joined: Thu Feb 15, 2007 5:48 am
Location: Zagreb, Croatia

Re: Forum Post Assistant too many redirects

Post by toivo » Fri Oct 30, 2020 4:41 pm

Thank you for the confirmation.

springburn wrote:
Fri Oct 30, 2020 4:20 pm
The only redirect on the site is for http to https
The standard method is to select the option Global Configuration - Server - Force HTTPS. Is that how the redirection was done?

Ref. Enabling HTTPS on your site - in Joomla
Toivo Talikka, Global Moderator

springburn
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Tue Feb 28, 2017 5:23 pm

Re: Forum Post Assistant too many redirects

Post by springburn » Fri Oct 30, 2020 5:04 pm

Yes Global Configuration - Server - Force HTTPS is set to entire site.

Thanks

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39463
Joined: Sat Apr 05, 2008 9:58 pm

Re: Forum Post Assistant too many redirects

Post by Webdongle » Fri Oct 30, 2020 5:48 pm

springburn wrote:
Fri Oct 30, 2020 5:04 pm
Yes Global Configuration - Server - Force HTTPS is set to entire site.
...
Then try removing the redirect from the .htaccess
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

springburn
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Tue Feb 28, 2017 5:23 pm

Re: Forum Post Assistant too many redirects

Post by springburn » Fri Oct 30, 2020 7:08 pm

Thanks for the reply.
As far as I can see there is no reference to a redirect in .htaccess.
I removed the .htaccess file and it made no difference.

springburn
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Tue Feb 28, 2017 5:23 pm

Re: Forum Post Assistant too many redirects

Post by springburn » Mon Nov 02, 2020 4:15 pm

Still struggling with this issue.
My understanding was that the FPA was an information collector.
Can anyone shed some light on how redirects would come into it?

Thanks

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 13261
Joined: Thu Feb 15, 2007 5:48 am
Location: Zagreb, Croatia

Re: Forum Post Assistant too many redirects

Post by toivo » Mon Nov 02, 2020 4:33 pm

The redirection happens before the script fpa-en.php gets started. Does the server control panel ISPConfig 3.2b3 have options that could cause the issue?
Toivo Talikka, Global Moderator

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 13261
Joined: Thu Feb 15, 2007 5:48 am
Location: Zagreb, Croatia

Re: Forum Post Assistant too many redirects

Post by toivo » Mon Nov 02, 2020 5:33 pm

Correction: The FPA script does actually redirect the request in certain circumstances. Questions:

Do you run the FPA using the URL with http or https?

Does the domain in the SSL certificate match the domain of the website?

It is possible to troubleshoot FPA v1.6.1 and get it to display errors and write them into a file called fpa_error.log in the folder where the FPA script is run.

Edit line 75 and uncomment it, by changing the line defining the diagnostic constant from:

Code: Select all

     #define ( '_FPA_DIAG', TRUE );
to:

Code: Select all

     define ( '_FPA_DIAG', TRUE );
In addition to diagnostics, this operation disables the redirection, too. Please let us know the situation with the SSL certificate and if the diagnostic setting allows the FPA to run.
Toivo Talikka, Global Moderator

springburn
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Tue Feb 28, 2017 5:23 pm

Re: Forum Post Assistant too many redirects

Post by springburn » Mon Nov 02, 2020 7:49 pm

Making the change to line 75 did allow the FPA to run. Thanks for that.

We run the FPA with https in the url
The domain cert does match.

Having said that the banner reporting that diagnostic mode is enabled also states:
SSL may not be available for this site, it is recommended that SSL is used on all sites where possible.

The address bar has the padlock and the url is: https://domainname.com/fpa-en.php

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 13261
Joined: Thu Feb 15, 2007 5:48 am
Location: Zagreb, Croatia

Re: Forum Post Assistant too many redirects

Post by toivo » Mon Nov 02, 2020 11:17 pm

springburn wrote:
Mon Nov 02, 2020 7:49 pm
the banner reporting that diagnostic mode is enabled also states:
SSL may not be available for this site, it is recommended that SSL is used on all sites where possible.
Is your website behind a load balancer?

Lines 3559 - 3561 of FPA v1.6.1 check the availability of SSL and display the above message:

Code: Select all

                    if ( @$_SERVER['HTTPS'] != 'on' ) {
                        echo '<p class="pt-1 mb-1 w-75 mx-auto"><i class="fas fa-unlock-alt fa-fw"></i> SSL may not be available for this site, it is recommended that SSL is used on all sites where possible.</p>';
                        }
The server variable $_SERVER['HTTPS'] is not 'on' if it is undefined, which can apparently happen in some servers. The variable $_SERVER['HTTPS'] can also refer to the connection between the load balancer and the web server, which may use HTTP, even if the browser communicates with the load balancer or the reverse proxy using HTTPS.

Ref. Are you using HTTPS without $_SERVER['HTTPS']
Toivo Talikka, Global Moderator

springburn
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Tue Feb 28, 2017 5:23 pm

Re: Forum Post Assistant too many redirects

Post by springburn » Tue Nov 03, 2020 2:18 pm

Yes it is behind a load balancer. Thanks for the information.

User avatar
RussW
Joomla! Exemplar
Joomla! Exemplar
Posts: 9362
Joined: Sun Oct 22, 2006 4:42 am
Location: Sunshine Coast, Queensland, Australia
Contact:

Re: Forum Post Assistant too many redirects

Post by RussW » Mon Nov 09, 2020 9:37 pm

Thanks for your time and research on this matter @toivo, an issue has been raised with the project team and we will look in to how best to work with this apparent mixed-SSL connection situation.

For the moment, if @springburn wishes to still try FPA, the best method moving forward may be to manually disable the FPA SSL-Detection routine.

Code: Select all

Line 98
define ( '_FPA_SSL_REDIRECT', TRUE);          // SSL Redirect - when possible and if a valid SSL certificate is found FPa will attempt to redirect to the SSL version of the site
either just comment this line out with a " # " infront of it, or set it to " FALSE " (from TRUE) in the define

Cheers
Russ
Joomla! on the fabulous Sunshine Coast...
hotmango, web & print http://www.hotmango.me/
The Styleguyz https://www.thestyleguyz.com/

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39463
Joined: Sat Apr 05, 2008 9:58 pm

Re: Forum Post Assistant too many redirects

Post by Webdongle » Tue Nov 10, 2020 10:13 am

A simple checkbox for if there is a load balancer ... with If/OR in the code?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

User avatar
RussW
Joomla! Exemplar
Joomla! Exemplar
Posts: 9362
Joined: Sun Oct 22, 2006 4:42 am
Location: Sunshine Coast, Queensland, Australia
Contact:

Re: Forum Post Assistant too many redirects

Post by RussW » Tue Dec 01, 2020 12:44 am

Unfortunately @Webdongle, the majority of users wouldn't know if they are behind a forward/reverse proxy or load-balancer, so we'll need to try and work that out for ourselves to avoid the redirects in the first place.

Otherwise the FPA user won't even get the chance to use the checkbox option because the issue is observed immediately causing a fatal error.
Joomla! on the fabulous Sunshine Coast...
hotmango, web & print http://www.hotmango.me/
The Styleguyz https://www.thestyleguyz.com/

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39463
Joined: Sat Apr 05, 2008 9:58 pm

Re: Forum Post Assistant too many redirects

Post by Webdongle » Tue Dec 01, 2020 1:07 am

A simple IF Else?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

User avatar
RussW
Joomla! Exemplar
Joomla! Exemplar
Posts: 9362
Joined: Sun Oct 22, 2006 4:42 am
Location: Sunshine Coast, Queensland, Australia
Contact:

Re: Forum Post Assistant too many redirects

Post by RussW » Tue Dec 01, 2020 2:43 am

If/Else What?

That is the question and is currently under investigation to determine the requirements and the methodologies. Always open to suggestions/solutions.
Joomla! on the fabulous Sunshine Coast...
hotmango, web & print http://www.hotmango.me/
The Styleguyz https://www.thestyleguyz.com/

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39463
Joined: Sat Apr 05, 2008 9:58 pm

Re: Forum Post Assistant too many redirects

Post by Webdongle » Tue Dec 01, 2020 10:40 am

If it fails then have it run the next line of code like it would do if Line 98 was commented out? Unless once the error occurs it is 'out of the hands' of the fpa?

Is there no way for the script to detect a load balancer?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

User avatar
RussW
Joomla! Exemplar
Joomla! Exemplar
Posts: 9362
Joined: Sun Oct 22, 2006 4:42 am
Location: Sunshine Coast, Queensland, Australia
Contact:

Re: Forum Post Assistant too many redirects

Post by RussW » Thu Dec 03, 2020 3:31 am

I obviously didn't explain the cause well enough, the issue causes a web-server redirect, so the same code continues to run upon each redirect, ultimately ending in a "fatal" called by a server timer-pop, so there is no variable or condition to check for prior to the loop starts and continues, so at that precise moment it won't be evaluating any IF/ELSE statements.

So, at the moment I'm working on detecting if there is a forwarding or upstream protocol in use BEFORE evaluating the status of protocol in use on the downstream server. Then we can potentially decide whether to use the upstream protocol or at the very least just skip the FPA auto-forwarding routine. PHP does have some HTTP_X_FORWARDED global variables that may be able to be used, but testing will require assistance from people with a variety of reverse-proxy, load-balancer and CDN environments with mixed and equal SSL configurations. So as stated in the issue, this will take some time, especially for testing/proving.

Hope that explains the cause and the subsequent resolution delay a little better.
Joomla! on the fabulous Sunshine Coast...
hotmango, web & print http://www.hotmango.me/
The Styleguyz https://www.thestyleguyz.com/

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39463
Joined: Sat Apr 05, 2008 9:58 pm

Re: Forum Post Assistant too many redirects

Post by Webdongle » Thu Dec 03, 2020 2:13 pm

While that is being done ... how dificult would it be to have a tick box that would prevent the code from running? At least then the the OP (and other who post the same error) could be told to tick the box instead of them having to edit code.

Yes, I know commenting out a line is simple but many who post on here don't even know what to use to edit a php file let alone comment out a line.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

frostmakk
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 194
Joined: Sun Dec 28, 2014 9:30 am
Location: Stavanger, Norway

Re: Forum Post Assistant too many redirects

Post by frostmakk » Thu Dec 03, 2020 2:45 pm

Very difficult. There will not be anything to tick before the code has run.

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 13261
Joined: Thu Feb 15, 2007 5:48 am
Location: Zagreb, Croatia

Re: Forum Post Assistant too many redirects

Post by toivo » Thu Dec 03, 2020 4:34 pm

@frostmakk, thanks for releasing the new FPA v1.6.2! It runs fine in PHP 8.0 and even works with Joomla 4 Beta6-dev, even if J4 itself is not quite ready for PHP 8.
Toivo Talikka, Global Moderator

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39463
Joined: Sat Apr 05, 2008 9:58 pm

Re: Forum Post Assistant too many redirects

Post by Webdongle » Thu Dec 03, 2020 5:30 pm

frostmakk wrote:
Thu Dec 03, 2020 2:45 pm
... There will not be anything to tick before the code has run.
No but after the code was run and the error showed ... the user would post here. Then (instead of telling a novice to edit code) just say tick the box.

How difficult would it be to create an IF statement to run the code if the box is not ticked?
If box not ticked
code
Endif

At least that would negate the novices being told to edit code when they post on here.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

frostmakk
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 194
Joined: Sun Dec 28, 2014 9:30 am
Location: Stavanger, Norway

Re: Forum Post Assistant too many redirects

Post by frostmakk » Thu Dec 03, 2020 5:58 pm

Webdongle wrote:
Thu Dec 03, 2020 5:30 pm
frostmakk wrote:
Thu Dec 03, 2020 2:45 pm
... There will not be anything to tick before the code has run.
No but after the code was run and the error showed ...
Its a fatal error. The program is dead. There is nothing to tick.

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 9999
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Forum Post Assistant too many redirects

Post by sozzled » Thu Dec 03, 2020 6:19 pm

A couple of observations.

Firstly, this discussion topic is marked as resolved. The OP has a solution; after that, this topic has become a panel discussion that analysed the cause but reached no consensus on how to solve the situation when the FPA encounters something it's not prepared for.

The FPA was designed as a general-purpose tool in a traditional/classic environment (e.g. without the "benefits" of load-balancing) or features brought into play when people created their J! websites. I'm not getting involved in understanding what happens when someone tries to run J! on a "load-balanced" server, any more than I'm interested in whether people try to run their websites on PHP 4 or PHP 8. The technical requirements are not gospel; they are what they are: a guide.

If there's a 1% of people who operate outside of the principles that 99% of people use then that's not something that 99% of people may be interested in. It's like comparing off-the-production-line motor vehicles with custom-built cars. But I digress.

As we all know the FPA works like this: it runs, gets some information about the environment and then produces a report. If the FPA encounters a problem at the beginning of the process—a situation it's unprepared-for—it stops. Sometimes it stops with an oddly-worded error message like "too many redirects". C'est la vie.

It's a bit like a tourist visiting a foreign country. On arrival, the tourist finds there's no-one who speaks their language. So what does the tourist do? Perhaps the tourist should have made a check-list of requirements before buying a ticket to visit the foreign country and one of the items on that check-list could have been "Make sure people understand my language" ... or something like that. It's a bit late in the game, after arriving, to do that check then, isn't it?

Therefore, paying my respects kindly to @Webdongle, it's not a simple if/then-else situation. This brings me to the second of my observations on the matter. A solution could be developed by separating the FPA into two parts: part A would involve a kind of "pre-flight checklist" where the user ticks boxes, etc. before part B which would be to run the report generator.

So this would be a redesign of the software and that's going to take a while. It's not a simple if/then-else clause within the current design of the FPA. Perhaps that's something we can think about?

In the meantime, let's not treat novice users as complete fools. Certainly there are people who have next-to-zero IT skills who follow the bouncing ball (three-mouse-clicks-hey-presto-here's-your-website) and then there are others who have a basic understanding of webcraft. For those who have next-to-zero IT skills there are professionals who can provide services to address problems; for the rest of us, we have to rely on our wits, self-help platforms (e.g. technical discussion forums) or pray for divine intervention. Again, c'est la vie.
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39463
Joined: Sat Apr 05, 2008 9:58 pm

Re: Forum Post Assistant too many redirects

Post by Webdongle » Thu Dec 03, 2020 7:38 pm

sozzled wrote:
Thu Dec 03, 2020 6:19 pm
... let's not treat novice users as complete fools. ...
'fools' suggests lack of intelligence. It has nothing to do with lack of intelligence rather lack of knowledge. There are many users who lack the ability to edit a php file. All I was doing was asking a few questions and giving the reasons for them. No biggie.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 9999
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Forum Post Assistant too many redirects

Post by sozzled » Thu Dec 03, 2020 7:43 pm

I apologise for implying that @Webdongle had characterised novice users as fools. Perhaps "lacking technical competence" would have been better.
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)


Post Reply

Return to “Forum Post Assistant (FPA)”