?
avatar pedro-acevedo
pedro-acevedo
23 Oct 2015

Steps to reproduce the issue

Publish an RSS module that points to this feed: http://govexec.com/rss/contracting/

Expected result

The feed's items are displayed

Actual result

The module displays "Feed not found"

System information (as much as possible)

Joomla 3.4.5

Additional comments

In Global Config, setting debug mode to on and error reporting to max displays nothing related to the RSS feed. Pointing the module to http://rss.cnn.com/rss/edition.rss instead of http://govexec.com/rss/contracting/ works fine.

avatar pedro-acevedo pedro-acevedo - open - 23 Oct 2015
avatar vdespa
vdespa - comment - 23 Oct 2015

Thanks for your report.

I had a look into it and it seems that the problem is not really related to Joomla. At the first glance it seems to be a server mis-configuration on the side of govexec.com as they are returning a 500 error code when the resource is requested from PHP.

Hope this helps you.

screen shot 2015-10-23 at 02 50 11


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

avatar vdespa vdespa - change - 23 Oct 2015
Status New Closed - Unconfirmed Report
Closed_Date 0000-00-00 00:00:00 2015-10-23 07:51:01
Closed_By vdespa
avatar vdespa
vdespa - comment - 23 Oct 2015

Set to "closed" on behalf of @vdespa by The JTracker Application at issues.joomla.org/joomla-cms/8127

avatar joomla-cms-bot joomla-cms-bot - close - 23 Oct 2015
avatar joomla-cms-bot joomla-cms-bot - close - 23 Oct 2015
avatar pedro-acevedo
pedro-acevedo - comment - 23 Oct 2015

Thanks for clarifying. I did a file_get_contents('http://govexec.com/rss/contracting/') and confirmed the 500 error code. However, and admittedly I don't know much about how Joomla is structured, shouldn't the CMS try a little harder to get the content? The feed opens fine if I navigate to it with Chrome, and wget also retrieves it successfully (although not sure why it receives a 301 code while doing so).


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

avatar vdespa
vdespa - comment - 23 Oct 2015

When the server is responding with a 500 status, where is not much that Joomla can do. Joomla relies on existing PHP functionality. If you provide a PHP snippet with manages to connect to this server, there might be something that Joomla can do. As far as I could debug, Joomla is doing it's best.

Yes, calling the address using the browser or wget works. Nevertheless, the first response code is a 301 (redirect), pointing to the same domain name!?


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

avatar pedro-acevedo
pedro-acevedo - comment - 24 Oct 2015

Interestingly, Joomla 2.5.28 displays that RSS feed fine. See the left sidebar at http://federalcontractingpr.com/

Not sure what happened between versions, but PHP is indeed able to read that feed.


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

avatar vdespa
vdespa - comment - 24 Oct 2015

The Feed reader was completely re-written in Joomla 3.x

Based on your observation that the feed works in Joomla 2.5, I am moving this to "Confirmed".


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

avatar vdespa vdespa - change - 24 Oct 2015
Status Closed - Unconfirmed Report Confirmed
Closed_Date 2015-10-23 07:51:01
Closed_By vdespa
avatar vdespa
vdespa - comment - 24 Oct 2015

Set to "open" on behalf of @vdespa by The JTracker Application at issues.joomla.org/joomla-cms/8127

avatar joomla-cms-bot joomla-cms-bot - reopen - 24 Oct 2015
avatar joomla-cms-bot joomla-cms-bot - reopen - 24 Oct 2015
avatar peterpeter
peterpeter - comment - 26 Oct 2015

Did a little bit code-sniffin:
In 2.5.28 Joomla uses the external library 'simplepie' (../libraries/simplepie) to get feeds. In 3.4.5 the simplepie-library is still shipped with the core, but the php's XMLReader-class is instead in use, with a fallback to Joomlas JHttp class, if the directive 'allow_url_fopen' is set to true. Is that the case on your test-site/server-envoirement?


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

avatar pedro-acevedo
pedro-acevedo - comment - 27 Oct 2015

allow_url_fopen is off on the 2.5 site. On the 3.4 site, it says allow_url_fopen is on, further down the page it has allow_url_fopen under "Disable functions."


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

avatar peterpeter
peterpeter - comment - 28 Oct 2015

Got it! This site obviously blocks requests with no valid 'userAgent' header.
Inbuild XMLReader receives an 500 error. Joomlas JHttp class is never invoked as substitute, due to a bug in libraries/joomla/feed/factory on line 45:

                        // If allow_url_fopen is enabled
            if (ini_get('allow_url_fopen'))
            {
                // This is an error
                throw new RuntimeException('Unable to open the feed.');
            }
            else
            {
                // Retry with JHttpFactory that allow using CURL and Sockets as alternative        method when available
                $connector = JHttpFactory::getHttp();
                $feed = $connector->get($uri);

The if (ini_get('allow_url_fopen')) should be if (!ini_get('allow_url_fopen'))

So, I changed that (added the exclamation mark), JHttp is invoked, but.....receives a 500 error too, until I added a 'valid' user agent string to the options:

// Retry with JHttpFactory that allow using CURL and Sockets as alternative method when available
                $option = new \joomla\Registry\Registry();
                $option->set('userAgent','Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0');
                $connector = JHttpFactory::getHttp($option);

....and it works now, feed received!

So what to do? I don't know. Is this kind of error commonly with feeds, then it should be fixed. At least that thing with the exclamantion mark.

avatar teccrow
teccrow - comment - 28 Oct 2015

I have the same problem with the feed of Your text to link here.... Joomla on the Web server reports error! The feed could not be retrieved!. If I use the feed link into the browser, the xml is displayed correct.

The same feed with joomla via local Mamp installation, display the feeds correct.


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

avatar peterpeter
peterpeter - comment - 28 Oct 2015

@teccrow And what versions of Joomla run's on your local machine? And on web server? The same? I try to figure out, if that behaviour is to the same 'bug' related. And the feed-link you provided leads to a '404 not found' page. For testing purpose, can you post the right one that makes trouble? Thanks.


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

avatar teccrow
teccrow - comment - 29 Oct 2015

@peterpeter it's the same version (3.4.5) on the local machine an on web server.

the link http://www.windkraft-journal.de/feed/is correct. check the link to the RSS validator on the W3C web site.

RSS-Feed check local machine:
screen shot 2015-10-29 at 01 14 10

RSS-Feed check web server:
screen shot 2015-10-29 at 01 14 32

RSS-Feed check W3C RSS-Validator:
screen shot 2015-10-29 at 01 15 42


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

avatar peterpeter
peterpeter - comment - 29 Oct 2015

@teccrow Now the feed is valid (had yesterday a few 404 responses from that server). I can't reproduce your errror, the feed is shown at my local machine. As your both J's has the original FeedFactory in it (with the 2 'Bugs' above), it's only possible to connect to feeds with php's xmlreader for them. Thus I guess there is another difference related to the two systems (OS, php version, allow_url_fopen.....).

avatar teccrow
teccrow - comment - 29 Oct 2015

@peterpeter now, i had a joomla 3.4.5 installation on a different webspace. On this web space the rss-feed work's.

I tested on both web space a other Feed this. This feed is working on both web spaces. Why?

Feed from windkraft-journal work's on web space:
PHP Version 5.3.10-1ubuntu3.21; allow_url_open = Off

Feed from windkraft-journal don't work's on web space:
PHP Version 5.4.45-0+deb7u1; allow_url_open = On

i had change allow_url_open = Off an restart the server, now i'm see that:
screen shot 2015-10-29 at 05 33 45


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

avatar peterpeter
peterpeter - comment - 30 Oct 2015

@pedro-acevedo as we now knowing, what to change: will you provide a PR? Or should I made one?
@teccrow not shure, your feed has some other issues (e.g.not available/404 with browser, at least 9-10pm yesterday). I guess in your php versions you got different xmlreaders, as they have changes in between those versions (see changelog). I guess your problems should be solved too, if the changes above are made.

avatar peterpeter
peterpeter - comment - 30 Oct 2015

Did a PR for that:
#8217
You can test, an comment it.


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

avatar zero-24
zero-24 - comment - 30 Oct 2015

Closing as we have a PR by @peterpeter thanks.

avatar zero-24 zero-24 - change - 30 Oct 2015
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2015-10-30 21:52:21
Closed_By zero-24
avatar zero-24 zero-24 - close - 30 Oct 2015
avatar zero-24 zero-24 - close - 30 Oct 2015
avatar pedro-acevedo
pedro-acevedo - comment - 31 Oct 2015

It works beautifully. Thank you for the quick resolution!

avatar peterpeter
peterpeter - comment - 31 Oct 2015

@pedro-acevedo Thank you, but the patch needs at least two successful tests by other users than me, to make it in the core. If you are not familiar with patch-testing let me know.

avatar pedro-acevedo
pedro-acevedo - comment - 31 Oct 2015

I just manually copy-pasted the code into my Joomla installation. What else should I do?

avatar peterpeter
peterpeter - comment - 31 Oct 2015

Most of these patches here can be tested with a Joomla installation and having the com_patchtester installed: https://github.com/joomla-extensions/patchtester/releases
Within the patchtester extension you can easy browse/apply/revert patches.
A (slightly outdated) video is here: https://docs.joomla.org/Component_Patchtester_for_Testers
Best Joomla version for testing is mostly the newest: staging branch of the joomla repo: https://github.com/joomla/joomla-cms
You can fork it/pull it to your local machine, or grab a 'nightly build' version.
https://docs.joomla.org/Working_with_git_and_github

Patchtesting is important for patches, to get accepted, and is a way, to give something back to the project. And can easy done by 'non-coders' too :)

So many code is written, but have to wait until it's get tested - so that's your chance ;-)

avatar pedro-acevedo
pedro-acevedo - comment - 3 Nov 2015

Well, I tested it, and from this it appears that what I did was acceptable. I want to play with git but haven't gotten around to it, so I'm glad a more manual approach was also fine.

Happy to give back to the community, and thanks again for the quick and friendly support.

Cheers!

Add a Comment

Login with GitHub to post a comment