J3 Issue ?
avatar tgv604
tgv604
20 May 2015

Steps to reproduce the issue

  1. Create a menu item pointing to an article - so the url is http://mysite.com/xxx/abc
  2. Change the menu item's alias so the new url is http://mysite.com/xxx/def
  3. Navigate to http://mysite.com/xxx/abc, you'll get 404 error page
  4. Create a redirect from http://mysite.com/xxx/abc to http://mysite.com/xxx/def
  5. Navigate to http://mysite.com/xxx/abc

Expected result

A nice and clean http://mysite.com/xxx/def page

Actual result

You'll get correctly redirected to http://mysite.com/xxx/def but there will be a warning saying "Error loading component: , Component not found."

In other words, exception message sticks in the queue, survives successful redirect and gets displayed when it's not relevant any more.

System information (as much as possible)

J3.4.1, SEF enabled, redirect plugin enabled

Additional comments

I could fix it for myself by clearing the message queue using ReflectionClass in redirect plugin's redirect.php line ~114 just before $app->redirect():

$appReflection = new ReflectionClass(get_class($app));
$_messageQueue = $appReflection->getProperty('_messageQueue');
$_messageQueue->setAccessible(true);
$messages = $_messageQueue->getValue($app);
foreach ($messages as $key => $message) {
if (false !== strstr($message['message'], $error->getMessage())) {
unset($messages[$key]);
}
$_messageQueue->setValue($app, $messages);
}

Not sure if there's more elegant way to solve this issue, given there's no other way to change the message queue (http://issues.joomla.org/tracker/joomla-cms/3098)

Cheers

Votes

# of Users Experiencing Issue
4/4
Average Importance Score
4.00

avatar tgv604 tgv604 - open - 20 May 2015
avatar joomla-cms-bot joomla-cms-bot - change - 20 May 2015
Labels Added: ?
avatar tgv604 tgv604 - change - 20 May 2015
Build 3.4.1 staging
avatar joomla-cms-bot joomla-cms-bot - change - 20 May 2015
Build 3.4.1 staging
avatar BuddhiEash
BuddhiEash - comment - 2 Jun 2015

Hi here it's working without an issue.I enabled redirect manager plugin and did this.Think you did it in the same way.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6993.

avatar xaddict
xaddict - comment - 16 Jun 2015

This should have high priority as the text will eventually be spotted by Google as being some kind of 404 page.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6993.

avatar brianteeman
brianteeman - comment - 16 Jun 2015

Please see Bug and Issue Tracker Priority https://docs.joomla.org/Priority

avatar Bakual
Bakual - comment - 22 Jun 2015

I can't reproduce this., the redirect works fine and no message is shown.

Can you try with the current 3.4.2 RC? Maybe the issue already got fixed? https://github.com/joomla/joomla-cms/releases/tag/3.4.2-rc

avatar formfranska
formfranska - comment - 29 Jun 2015

I just wanted to say that I have the exact same issue (J 3.4.1).


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6993.

avatar cppl
cppl - comment - 3 Nov 2015

FYI/Datapoint…
We experienced this with a client last week (just after the 3.4.5 update) but they weren't interested in paying for us to dig into it, so we replaced it with a .htaccess redirect… meh. Something we didn't pay much attention to at the time was that only people that had been to the old address in the same session were experiencing the problem.

However, we've just experienced it on one of our sites. This URL was removed - http://seepeoplesoftware.com/products/virtuemart-plugins/configuring-commweb-migs-for-vm2.html and a redirect setup in Joomla to point to http://seepeoplesoftware.com/products/virtuemart-plugins/commweb-migs-plugin-for-vm2.html

This resulted in the aforementioned error message. Opening a different browser, shows the target page without any error message. (Deleting the session cookie didn't remove the error message.)Offending Error Msg


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6993.

avatar cppl
cppl - comment - 3 Nov 2015

Scratch that, now it's happening in Chrome as well…


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6993.

avatar born2webdesign
born2webdesign - comment - 3 Nov 2015

Same issue here, J! 3.4.5, same or new session doesn't matter, but only seems to happen the first time per session.
DB: 5.5.46-0ubuntu0.14.04.2 (guess MySQL)
character set, collation: latin1_swedish_ci (still, wow!)
PHP: 5.5.9-1ubuntu4.14
Server: Apache/2.4.7 (Ubuntu)

avatar nonickch
nonickch - comment - 16 Dec 2015

Just run into this aswell, J3.4.6. We had plg_system_redirect off all this time, so we don't know if this was recently introduced. From the chat history, this might be an old one.

Fun part is that it happens on our production system but not on my local machine (identical FS and almost-identical DB, had to change the redirect url so it works on localhost).
I managed to:
error_log(print_r(debug_backtrace(),1), 3, '/tmp/meow');
on line 463, right after
JLog::add(JText::sprintf('JLIB_APPLICATION_ERROR_COMPONENT_NOT_LOADING', $option, $error), JLog::WARNING, 'jerror');

After some heavy editing of the file to skip the entire JApplication object on each step, here's the stacktrace:
meow.txt

I'll get back to tracing this and get back to you if I find out anything

avatar nonickch
nonickch - comment - 16 Dec 2015

I forgot to point out that this happens consistently (on the badly behaving server), unlike born2webdesign note.
born2webdesign and cppl may actually be seing the exact same effect though: FF caches the 301 and will redirect you without actually talking to the server. My chromium will keep knocking on the redirect-from url so the warning always ends up there.

Unless I'm seeing things double, the trouble starts from libraries/cms/application/site.php line 317 (getParams()):
$option = $this->input->getCmd('option', null);

This is where (in theory) the good and bad application executions deviate. The good ones get the expected 'com_content' value for $component, the bad ones get nothing and default to null.
I said 'in theory' because I have to compare the good-case debugger with the bad-case stacktrace. But the stacktrace (meow.txt on my previous comment) is pretty clear on the contents of $component. 2 is the exact following line:
$params[$hash] = clone JComponentHelper::getParams($option);
At which point the helper freaks out for being given a null $option

Bad system (this is an amazon AMI running on EC2, load-balanced):

PHP 5.6.14 (cli) (built: Oct 16 2015 22:58:32)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

Server version: Apache/2.4.16 (Amazon)

mysql Ver 14.14 Distrib 5.5.45, for Linux (x86_64) using readline 5.1

J Cache: conservative, cache plugin off.

Good system (Debian lenny with XDebug):

PHP 5.4.45-0+deb7u2 (cli) (built: Oct 17 2015 08:26:31)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans

Server version: Apache/2.2.22 (Debian)

mysql Ver 14.14 Distrib 5.5.46, for debian-linux-gnu (x86_64) using readline 6.2

Same JCache configs (conservative, plugin off) as it's a mirror FS/DB
I do run the site in a subdirectory, in case that might throw things off a bit.

avatar dicbrus
dicbrus - comment - 27 Jan 2016

J! 3.4.8
The same issue!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6993.

avatar seagul30
seagul30 - comment - 15 Feb 2016

J! 3.4.8
Same issue

avatar HarryBosh
HarryBosh - comment - 14 Apr 2016

j! 3.5

avatar oldskule
oldskule - comment - 19 Apr 2016

J! 3.5.1

avatar pe7er
pe7er - comment - 8 May 2016

I was able to reproduce this error on Joomla! 3.6.0-dev:
After I've changed the alias, the old link gave a 404 error.
I added the old alias to the Redirect Manager to redirect to the new link
The front-end menu still had the old link on it, and clicking on it resulted in a 404 error, like reported by various people in this issue.

However, when I tried to reproduce this error for the second time,
This time I did not click the old link on the menu but instead I opened a new browser window, visited the old link, and the redirect worked correctly.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6993.

avatar brianteeman brianteeman - change - 10 May 2016
Status New Confirmed
avatar ppetree
ppetree - comment - 21 May 2016

This problem exists in:
Joomla! 3.4.8 Stable [ Ember ] 24-December-2015 19:30 GMT
Joomla! 3.5.1 Stable [ Unicorn ] 05-April-2016 22:45 GMT

FYI: I used this to redirect the top level of a pulldown menu which is defined as a "menu header" and which, when clicked, produced a 404 error.

FYI: If you click on that menu header a 2nd time you do not get this message again, during that session, for that menu header. You must click on each redirected menu header twice in each session.

avatar beat
beat - comment - 13 Jun 2016

Confirming error too (disappears on hitting browser reload button to display the redirected page again). Joomla 3.5.1. But each time you paste a redirecting URL, it re-displays that error:

Warning

Error loading component: , Component not found.

avatar abacmedia
abacmedia - comment - 21 Jul 2016

Exactly the same issue: in the first load of the old url the error is visible, and reloading, disappears the error. (Joomla 3.6.0, PHP 5.3.29, MySQL 5.1.73)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6993.

avatar Fedik
Fedik - comment - 22 Sep 2016

I got same

The problem that Application tried to load null $option for non existing url, instead of throw the error "not found".
trace:

screen 2016-09-22 16 20 58 643x145

avatar lausianne
lausianne - comment - 25 Oct 2016

Same on 3.6.3


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/6993.

avatar aaron-harding
aaron-harding - comment - 31 Oct 2016

I was having the same error as this and found it was caused by a menu item with an alias that was the same as my redirect.

Example:
I was trying to redirect "/test" to "/testing". I also had a menu item with an alias of "test". Changing the menu item alias to something completely different then removed the "Error loading component: , Component not found." message after it had been redirected.

avatar r3dvorak
r3dvorak - comment - 4 Nov 2016

same in 3.6.4...
fireshot screen capture 1220

avatar durian808
durian808 - comment - 30 Dec 2016

[correction - 3rd time is a charm. mods please remove above 2 comments]

I am seeing this error on Joomla 3.6.5.

Error message is seen when the expired URL is, for example, http://mydomain.com/about-us and the new URL is http://mydomain.com/about-us/about-my-company. Error message is not seen when the new URL is http://mydomain.com/about/about-my-company.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/6993.

avatar mbabker
mbabker - comment - 30 Dec 2016

If you come here to GitHub directly versus using the issue tracker it allows editing messages. That feature hasn't gotten into the issue tracker yet.

avatar durian808
durian808 - comment - 30 Dec 2016

Now I see edit and delete icons. Thanks.

avatar tonypartridge
tonypartridge - comment - 19 Mar 2017

@durian808 can you please test with Joomla! 3.7 standard rooting? I cannot replicate this.

avatar lausianne
lausianne - comment - 31 Mar 2017

This helped me solve it: "I was having the same error as this and found it was caused by a menu item with an alias that was the same as my redirect." - J3.6.5

I have several menu aliases on this site. All I did to fix the issue was going through the menu items, open ("Edit"), then Save/Close. No changes.
Maybe routing gets confused when a redirect points at a menu item that has an alias menu item in it's path. And when the menu item is re-saved after the redirection is in place, it all gets sorted. ???

avatar N8Solutions
N8Solutions - comment - 11 May 2017

I'd like to confirm that this is still happening in Joomla 3.7. I just upgraded and did some site modifications and when a page is redirected the page is displaying the error message as described here.

Going back to the menu item and choosing "Save/Close" did not solve the issue.

@brianteeman & @mbabker After 2 years of this issue existing is it possible for this to be prioritized a little higher especially since it's still rearing it's ugly head in Joomla v3.7?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/6993.

avatar aaron-harding
aaron-harding - comment - 11 May 2017

I have had a look through this error in some detail and looks to be quite a tricky one to solve without any major changes to the way components are dispatched/routed.

The message "Error loading component: , Component not found." is thrown because the active menu path has no component associated with it. The following menu item types produce a component id of 0 when they are created:

  • Menu Heading
  • Text Separator
  • Url
  • Menu Item Alias

Example:
If you create a "Heading" menu item with an alias of "my-heading" and then go to your-site.com/my-heading. You should get an error page "404 - Component Not Found".

If you then setup a redirect for /my-heading to go to the homepage. This will produce the system message "Error loading component: , Component not found." after being redirect. The system message is thrown from here: https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/component/helper.php#L467-L488

When the site is being dispatched it is getting the currently active menu item (which is our menu item of type "Heading") and then attempting to load and render that component, which in this case does not exist.

The system message is displayed after the redirect because the message queue was not cleared from the system error page that would have been displayed if there was no redirect setup.

I'm not sure what should be fixed here. Do you make sure that when a redirect happens it clears the message queue? Or do you update the dispatch method to not attempt to render a menu item which has a component id of 0?

There is also the update to routing in Joomla 3.8, so this issue may want to be tested with that as well.

avatar Chadwyke
Chadwyke - comment - 16 May 2017

I just upgraded to 3.7.0. The usual error on my redirect pages: Warning Error Loading Component:, Component Not Found is no longer present after two years of frustration. This is good!

However, all of the modules (sidebar menus, etc.) assigned to those pages have now disappeared as well. So the error is now gone, but so are my other modules. I tried checking the module page assignments, reassigning them and also recreating the redirect, but it's not working.

avatar durian808
durian808 - comment - 28 May 2017

@durian808 can you please test with Joomla! 3.7 standard rooting? I cannot replicate this.

Is it still happening in Joomla 3.7.2? Sorry, been swamped with work... no time to test.

avatar shayandavoodi
shayandavoodi - comment - 24 Jun 2017

I can confirm that I have this problem on 3.7.2.

Steps to reproduce:

  1. Visit http://www.sitestory.net/fa/%D8%B3%D8%A6%D9%88-%D8%A8%D9%87%DB%8C%D9%86%D9%87-%D8%B3%D8%A7%D8%B2%DB%8C-%D8%B3%D8%A7%DB%8C%D8%AA/%D8%B3%D8%B1%D9%88%DB%8C%D8%B3-%D8%B3%D8%A6%D9%88.html . Everything is fine.
  2. Visit http://www.sitestory.net/fa/%D8%B3%D8%A6%D9%88-%D8%A8%D9%87%DB%8C%D9%86%D9%87-%D8%B3%D8%A7%D8%B2%DB%8C-%D8%B3%D8%A7%DB%8C%D8%AA.html . This URL is redirected to the previous URL and you will see the warning "Component not found".

Note: Although the caching is disabled, whenever I clear the cache, the steps above produce the explained results. Without clearing the cache, both URLs return "Component not found".

Update: After turning off all the Siteground caching mechanisms, the problem discribed in "Note" doesn't appear anymore. The steps to produce the problem work right.

You can see the warning at the top of the page. If you open the target URL directly, you won't see the warning.

avatar franz-wohlkoenig franz-wohlkoenig - change - 8 Nov 2017
The description was changed
Status Confirmed Discussion
avatar joomla-cms-bot joomla-cms-bot - change - 8 Nov 2017
Status Discussion Confirmed
avatar joomla-cms-bot joomla-cms-bot - edited - 8 Nov 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 8 Nov 2017
Status Confirmed Discussion
avatar brianteeman brianteeman - change - 25 Mar 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 25 Mar 2018
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 2 Aug 2018

@shayandavoodi i have looked at your 2 URLs above and haven got Warnings (also not on Top of the Page).

avatar franz-wohlkoenig franz-wohlkoenig - change - 2 Aug 2018
Status Discussion Information Required
avatar brianteeman
brianteeman - comment - 2 Aug 2018

I am going to close this - it has been over a year since the last comment and there have been so many changes since then. It can always be reopened if updated

avatar brianteeman brianteeman - change - 2 Aug 2018
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2018-08-02 11:20:43
Closed_By brianteeman
avatar brianteeman brianteeman - close - 2 Aug 2018
avatar mehdidavoudnia
mehdidavoudnia - comment - 25 Sep 2018

Note: Although the caching is disabled, whenever I clear the cache, the steps above produce the explained results. Without clearing the cache, both URLs return "Component not found".
http://melody98.com/


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/6993.

Add a Comment

Login with GitHub to post a comment