My site is taking a feed from http://www.rya.org.uk/news.rss at hourly intervals, but when the aggregator runs via cron (or even through the UI) no items are updated. I have to first remove all existing local items before the feed will update correctly via the admin menu options. After this manual remove and update, no further updates happen - eventhough the cron is running correctly. Old feed items are expired and removed correctly. The problem has existed for a while (since before 7.24). Any suggestions?

Drupal 7.31, PHP: 5.3.28, web server: Apache 2.4.9, Database: mysql 5.5.33

Comments

dcam’s picture

Updated how? Existing items aren't being changed, new items aren't being downloaded, or both?

Check the queue table in the database. Look for records with a name of aggregator_feeds. If there are any in there, it could indicate that queue items aren't being executed properly for some reason.

adwuk’s picture

Certainly new items aren't being downloaded. Difficult to say if the existing items aren't being changed as the existing items in the feed don't appear to change. The existing items certainly expire and are removed from the local cache.

I have checked the database and there are no records in the aggregator_feeds queue. I believe that the cron is running correctly. Even when I try and update the feed manually using the admin menu options it finds no new records. However, when I remove all items and then update the feed manually, it downloads all new items successfully.

dcam’s picture

It's unusual for Aggregator to have this problem. I work on a site that has Aggregator import a lot of feeds. I don't really have time to test the feed you're importing today, but I'll try when I have time. Have you tested it on a clean install of Drupal 7? Do you have any modules enabled that change Aggregator's behavior?

dcam’s picture

Version: 7.31 » 7.x-dev

I did test the feed on a clean install of 7.x and confirmed the issue. The feed won't update and pull in new items on a cron run or when manually updating it. The feed's items have to be removed first.

I'm not sure what is causing this problem yet. I haven't seen this behavior in Aggregator before. There could be something wrong with the feed or something about it could be causing a processing problem in Aggregator. I'll keep looking into it.

adwuk’s picture

Glad that you have been able to reproduce the error. My guess is that it is something to do with an items publish date as the aggregator, when run, reports "no new items" even when there are some. If you delete all the items, then I presume the feed aggregator simply imports all items regardless of the date. Let me know if there is anything else you need tested.

noovocreative’s picture

I have exactly the same issue... obviously using a different feed.

Once I remove all the items then 'update' my feed is correct.

jelo’s picture

I have exactly the same issue that no updates are coming through.

Is there a simple way in a custom module to trigger on a hook just before the aggregation for a specific feed is attempted to clean out all items in that feed automatically and prior to the run as an interim solution? That way it would work again while we wait for a patch.

Apparently, not many sites might use the aggregator, given that it has been a known issue and basically it doesn't function correctly.

noovocreative’s picture

I have now switched to the feeds module and all works perfectly.

adwuk’s picture

In my case the feed was returning an etag of "" (or at least that is what was stored in the database row for the feed). The next RSS query was using this etag and getting no data returned (304 - not changed return code). I modified line 26 of aggregator.fetcher.inc from:
if ($feed->etag) {
to:
if ($feed->etag && strcmp($feed->etag, "\\\"\\\"") !== 0) {
All seems to be working now.

vinothg’s picture

If anyone still interested for the interim workaround, here is the solution for it:

/**
 * Implements hook_cron().
 */
function your_module_cron() {
  // Interim solution until the drupal core issue has been fixed.
  // https://www.drupal.org/node/2344795
  // TODO: Remove the hardcoded feed id value.
  $feed = aggregator_feed_load(1);
  aggregator_remove($feed);
}

Note: Make sure your hook runs before the aggregator's cron hook, adjust your module's weight

rajesh.vishwakarma’s picture

Getting the same issue with Drupal 7.50.
Update Items button not updating the data but once delete current data it fetch the updated data from XML.

edvanleeuwen’s picture

This is still a problem in 7.70.