I can refresh feeds manually, but cron doesn't refresh them. This would be a duplicate of this issue thread, http://drupal.org/node/350719 with the exception that I'm experiencing it on 1.5.

Comments

aron novak’s picture

Status: Active » Postponed (maintainer needs more info)

Does the admin/reports/dblog page contain "Cron run completed." lines?

fumbling’s picture

Hi Aron- thanks for the response. yes, it confirms that cron has run from a cron job once every five minutes . I did another manually just now and it confirmed that as well, But feeds are not refreshing for some reason.

aron novak’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Ok.
Do you know that at cron time, all of the feeds are refreshed only after the last refresh + 1800 seconds?
In practice:
- you have one feed
- just refreshed it manually
- after that, you immediately click on "run cron manually link"
- the feed won't be touched, because the last refresh + 1800 seconds time is not elapsed

After the above, is this a problem anymore?

aron novak’s picture

Status: Closed (duplicate) » Postponed (maintainer needs more info)
fumbling’s picture

Hi Aron - thanks for the reply, yes, I'm aware of the minimum refresh period, but just in case I doublechecked on that just to be sure. As it turns out unfortunately it's not the issue. Cron simply isn't refreshing the feeds for some reason regarldless of how long I wait to refresh through cron manually or automatically. Am I the only one experiencing this? If so, it's probably on my end. By the way, I no longer have a copy of 1.4, which was working for me. If I'm unable to resolve this do you happen to have a copy of 1.4? Would be great to have that as an alternative. Thanks either way. This is a truly indispensable module. Happy new year!

gmak’s picture

I am having the same issue with the current *dev version. The feeds do not get updated via cron. Even if I run cron manually, nothing happens. I'm only getting feeds refreshed if I manually go through and refresh each one (with a number of feeds this takes quite a while).

gmak’s picture

a bit more info...

cron runs are completing successfully.

I have stripped back to the point where there is only 1 feed that is setup, so it shouldn't be a problem of having too many feeds trying to refresh.

I have cleared the cron_semaphore variable, but this has not allowed feeds to refresh on cron.

I have allowed up to 36 hours to pass (to ensure that the failure to refresh is not related to the +1800 issue mentioned above.

I have increased the php max_execution time to 300 seconds to make sure that there is sufficient time to complete any 'long' tasks.

As far as I can see all other updates that are related to cron are completing without problem.

Hoping this can be resolved soon, as I'd really like to use feedapi in my production site

fumbling’s picture

Continuing to have the same issues as you, although I'm beginning to think it's on my end. I've reverted to FeedAPI 1.4, which used to refresh feeds on cron, and that isn't working either anymore in terms of cron refreshing feeds.

At this point, since FeedAPI is the heart of the site I'm working on, I've resorted to bypassing cron and using another type of "cron job" to hit the refresh-action URL itself every few minutes, which refreshes the feeds well, but you have to work out permissions for the cron job itself to hit that URL, which unlike a regular cron URL is not publicly available.

Let me know what more you find... this is an incredibly powerful module when you can get it dialed in, so I'm in it for the long-term :)

fumbling’s picture

Continuing to have the same issues as you, although I'm beginning to think it's on my end. I've reverted to FeedAPI 1.4, which used to refresh feeds on cron, and that isn't working either anymore in terms of cron refreshing feeds.

At this point, since FeedAPI is the heart of the site I'm working on, I've resorted to bypassing cron and using another type of "cron job" to hit the refresh-action URL itself every few minutes, which refreshes the feeds well, but you have to work out permissions for the cron job itself to hit that URL, which unlike a regular cron URL is not publicly available.

Let me know what more you find...

gmak’s picture

fumbling,

can you give me some more detail on how you've setup your 'alternate' cron system?

I also tried reverting back to 1.4, but that didn't help me either.

I've been looking at using SimpleFeed instead of Feedapi, but it doesn't have the same number of features. It lacks the feedapi_mapper, which is really useful.

What's your OS and other modules? Maybe we can track down where our systems are similar and find the issue.

Thanks

fumbling’s picture

Sure. I'm on a VPS at the Drupal-only host HotDrupal. I tried Simplefeed at one point but doesn't seem to have the same backing from the community or feature set (and it's still a dev snapshot) so went with FeedAPI also. I may try simplefeed again though at some point if I can't fix this.

I have a huge number of contrib modules, so that probably won't help you much. I should try turning all of them off save feedapi and see if it still happens, I'll add that to my list.

For the refresh cron, I create a cron job in my cpanel (I don't know how to create them any other way) with the following logic: wget -O - http://www.example.com/node/[feed-node-ID-here]/refresh >/dev/null 2>&1

But that's super dangerous on a production site, b/c to make it work I have to give anonymous users permission to manage FeedAPI in order to let the cron job (which is an anonymous user) hit that URL to refresh the feed. Only on dev sites.

One possibility is that it is just too intensive and processes are just timing out. FeedAPI is extremely resource-consuming for my site, but mostly b/c I generally node-process feed-items rapid-fire, several per minute, from sites like Twitter, which FeedAPI is really not meant to do.

gmak’s picture

Thanks for the info.

I, too, have many contrib modules so I'll need to take the site down for a period to turn things off and on to see if there is a conflict somewhere. Alternatively, I may try to create the same configuration on another server (same spec) and see if I can track it down there.

I don't think the problem is to do with processes being too intensive, I have reduced down to only a few feeds and they are not getting refreshed that often. Still the problem persists.

fumbling’s picture

Thanks, good to know it's not just me. Look forward to hearing what you find and I'll be sure to post my findings here as well. I expect to do a fresh install over the weekend.

dubitable’s picture

I'm having this problem too. Details: like fumbling, I can refresh manually. When I run cron via command-line ("php cron.php"), I get nothing. Poormanscron does squat too.

I've tried this with older feeds as well as brand new fresh ones, doesn't seem to be working for me.

EDIT: also, forgot to mention that I only have about four feeds going on my site, and only one of them is updated with any frequency.

fumbling’s picture

Thanks for the details dubitable. I'm not certain, but I think that FeedAPI is incompatible with poormanscron, so that might be one place to look, although I don't have poormanscron on and am having this issue so there's certainly more to it at least in my case.

gmak’s picture

dubitable,

fumbling is correct. There are a number of issues related to poormanscron (not just with FeedAPI). If you do a search, here on the Drupal site, you'll find quite a few forum and issue threads pointing out some of the problems.

As with fumbling, I'm not using poormanscron, so the cron refresh issue is repeatable and not necessarily related to poormanscron.

dubitable’s picture

Yeah...sorry if I've added unnecessary noise. I just was poking around something else and realized that at least some of my problems are being caused by poormanscron...I see errors in the error log for that. So, maybe my problems are unrelated. I'll set up a regular cron job and see if that helps, perhaps it wasn't working when I tested before for some other reason.

Thanks for the pointers--

DD

gmak’s picture

Fumbling are you running the Amazon module?

I've not confirmed that this is the problem, but on another site (which has a very similar setup) I've noticed that the Amazon module was keeping my cron from running properly. I would always get 'cron failed to run' (whether manually or automatically) or I was getting log messages saying 'cron failed to run because it was already running' (or similar wording). I also noticed that I was getting messages from the Amazon module stating that it could not update items. When I disabled Amazon, cron starting running normally.

I'll keep digging, but let me know if you've got Amazon installed.

gmak’s picture

Well, it's not the Amazon module. So, that didn't help us...

fumbling’s picture

I did a fresh install with very few contrib modules this time. So far feeds are now refreshing upon cron. So my best guess is that it was a contrib module conflicting (other than poormanscron), but I had so many it will be hard to pinpoint. As I add back modules now I'll keep an eye to see if one trips the plug...

gmak’s picture

I wait with baited breath... I'd really like to get FeedAPI back in working order.

Do let me know if you find the culprit.

gmak’s picture

I think I've found the problem! I've just turned off all of the modules associated with the File Framework project, and FeedAPI is now refreshing on cron runs. Which is a good result. However, now I've got a problem as I don't have access to all the files that have been uploaded to fileframework.

Does anyone know how to change the order of cron runs? it would seem that fileframework kills the cron run on completion of its tasks.

gmak’s picture

I tried adjusting the weight of the modules (which is supposed to effect the order in which cron tasks are performed) but that does not seem to have fixed the problem.

geodaniel’s picture

gmak, as a temporary measure you could also disable the File Framework's automatic maintenance cron runs at admin -> settings -> file which does indeed allow FeedAPI to resume updating its feeds.

fumbling, did you also have File Framework installed?

fumbling’s picture

Hi geodaniel - no, i didn't have File Framework installed, fwiw

drewish’s picture

this seems like a duplicate of #419588: Feedapi not refreshing feed via anonymous cron but works with cron by authed user which i'm running into. i can manually run cron as the admin and they update fine but when the anon cron occurs nothing gets updated.

spydmobile’s picture

Just my two cents guys. First, my site is totally driven by cron fed feedapi and feedapi mapper to bring in a georss feed of weather data and turn it into nodes. I require a high refresh rate, I opened the other ticket #419588: Feedapi not refreshing feed via anonymous cron but works with cron by authed user and now at last I have my feeds working, here is what I did:

1) I edit the feedapi.module (Every time) and change: line 15:
to say:

define('FEEDAPI_CRON_MIN_REFRESH_TIME', 60);

This says I can have a refresh every 60 seconds if I want.

2) in my simple pie parser settings on the feed node ( seem to only be able to use simple pie) I set the Cache lifetime to 30 seconds

It took this, and a reboot and wating a few hours to see the results but now my crontab calls the cron.php on localhost every 5 minutes and I have every record by 15 minutes after the hour now.

I dont know if this is related but since very few people have solved this issue I thought I would share anyway

Thanks for pointing me to this issue too DREWISH!

F

fumbling’s picture

Yeah, adjusting feed refresh time worked for me as well. I wish this was part of the admin settings so we could leave the files alone, maybe there's already a feature request for that.

alex_b’s picture

Version: 6.x-1.5 » 6.x-1.x-dev

I haven't read through the entire thread, but please note, that #255852: Poormanscron and FeedAPI don't work together.

If you are researching bugs like this, please always use the latest version of FeedAPI and try to isolate it on a vanilla Drupal installation. Does this problem persist on 6.x 1.x ?

alex_b’s picture

Problems described on #255059: Switching user to feed author during cron seem to be related.

zoltán balogh’s picture

Status: Postponed (maintainer needs more info) » Active

I have the same problem, the feeds are not refreshed on cron, but I solved myself. If somebody using any module with set_time_limit(0) command in the hook_cron function, and the module weight in the system table is smaller than FeedAPI's, the feeds are not refresed on cron, because the return value of the feedapi_cron_time function is always 0. In my case, the FeedAPI's original weigth was 5, and the Localization Server's weight was 0. I changed the weigth of the FeedAPI to -5, and the feeds are refreshed again. It is a good solution, or somebody knows a better?

aron novak’s picture

Status: Active » Needs review
StatusFileSize
new1.12 KB

Thank you for reporting this issue. It's a tricky one :)
As i found out, 0 has a special meaning, but i'm in doubt that the script will run forever, other timeouts will apply. For FeedAPI, i'd allow 1000 seconds to run when this limit is 0.
What do you think?

zoltán balogh’s picture

StatusFileSize
new1.12 KB

I think, it is too long interval, 1000 seconds is more than 15 minutes. I have more than 150 feeds from d.org, but in this case all feeds are refreshed at every cron run (my provider will be happy, because my cron frequency is 5 minutes.) I think, one or maximum two minutes better, if the time limit is zero.

aron novak’s picture

Status: Needs review » Fixed

Thank you for your insights. Just committed the patch.
Well, i think there is no 'good' value in this case, it's possible to argue pro and con, isn't it? :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.