Publish an RSS module that points to this feed: http://govexec.com/rss/contracting/
The feed's items are displayed
The module displays "Feed not found"
Joomla 3.4.5
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.
Status | New | ⇒ | Closed - Unconfirmed Report |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-10-23 07:51:01 |
Closed_By | ⇒ | vdespa |
Set to "closed" on behalf of @vdespa by The JTracker Application at issues.joomla.org/joomla-cms/8127
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).
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!?
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.
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".
Status | Closed - Unconfirmed Report | ⇒ | Confirmed |
Closed_Date | 2015-10-23 07:51:01 | ⇒ | |
Closed_By | vdespa | ⇒ |
Set to "open" on behalf of @vdespa by The JTracker Application at issues.joomla.org/joomla-cms/8127
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?
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."
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.
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.
@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.
@peterpeter it's the same version (3.4.5) on the local machine an on web server.
the link is correct. check the link to the RSS validator on the W3C web site.
RSS-Feed check W3C RSS-Validator:
@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.....).
@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:
@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.
Did a PR for that:
#8217
You can test, an comment it.
Closing as we have a PR by @peterpeter thanks.
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-10-30 21:52:21 |
Closed_By | ⇒ | zero-24 |
It works beautifully. Thank you for the quick resolution!
@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.
I just manually copy-pasted the code into my Joomla installation. What else should I do?
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 ;-)
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!
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.
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8127.