I've had this module (or an older version) installed since may -- then on Sept 24th I upgraded to the newest version of the recommender API (2.0-beta3), and switched my module it was using to the fivestar_rec.
After that, things works completely perfectly for 4 days (until the 28th). Recommendations were setup to run every 3 hours, and it was doing so successfully.

However, after the 28th it stopped making updates. As I looked further, it turned out Cron hadn't run at all since the 28th (11+ days). So I went and browsed to mysite.com/cron.php -- and what it immediately did was went to the recommendations page, and ran the update recommendations script. If i went back and IMMEDIATELY hit cron.php again, it also didn't actually run my entire cron, it just updated the recommendations again (yes, it'd do it about a minute later, even though my frequency setting is 3 hours).

So I looked in drupal_variable, and there's no record set for recommender_last_cron. I tried adding one hoping that would make it use it, but it continues to ignore it, and only do updates when I run the script manually.

I've tried un-installing and re-installing the recommender API.

It doesn't appear that I installed any other new modules on or around the 28th.

Does anyone have any ideas?

I'm running drupal 6.13

Comments

danithaca’s picture

Assigned: Unassigned » danithaca

i'll take a look soon.

angusmccloud’s picture

Thanks!

ezar’s picture

suscribe!
Its very important because cron fails with this module.
Thanks,
eZar.

jdlind38’s picture

Yeah, I'm having the same issue. Cron times out and gets "stuck".

angusmccloud’s picture

I've been playing around with it, and it appears that other pieces of my cron are running (backup and migrate will still make a DB backup). However, the recommender API doesn't kick it back to the full cron task, so the sitewide last_cron doesn't get updated, and the recommender_last_cron doesn't get updated.

danithaca’s picture

Status: Active » Closed (works as designed)

I double-checked the code, and I don't think there's a bug in it.

A work-around would be to set Recommender never run in cron. Go to "Recommender running frequency in cron job" and choose "Never". Note the description of this option: "Please specify the optional frequency to run recommender algorithms in cron. Note that this is a time consuming operation and might timeout or affect your other cron tasks. Not recommended for large site. Consider using the Drush script with system cron."

Let me know if there's anything else I can do as the developer.

angusmccloud’s picture

I turned my frequency off and cron runs, but then this no longer runs on a schedule.

Is there a script (page) i can hit to make the recommendations run? Or do i need to be logged in as an admin and go to the recommender API page? (I'm basically trying to figure out if I can hit/run these automatically without the sitewide cron run).

danithaca’s picture

sure thing. you can use the Drush together with RecAPI. Then you'll just need to schedule Drush with your system cron.

ceriamy’s picture

Have we got this issue resolved? I am doing cron job and RUNNING RECOMMENDER stays there for.... i don't know how long more... hours? i have "recommender-6.x-2.0-beta3" installed. What's next?

cronix’s picture

subscribing. Same issue here.

Max K.’s picture

Priority: Normal » Critical
Status: Closed (works as designed) » Needs work

I'm sorry, but this is not "by design". It's preventing all cron processes scheduled later in the queue from running, and common.inc is throwing up the "Cron run exceeded the time limit and was aborted." message. This is interfering with core functionality and should not be regarded lightly. I'm not certain what the problem is, but Drupal only throws that message when the cron_semaphore variable doesn't get unset properly. I'm having the secondary effect of being redirected to admin/settings/recommender which seems unusual. (And I might add that there is an extra '/' between my site's base directory and 'admin'.) Unfortunately, we may be looking at a tricky heisenbug because the code looks good at first glance. Some others are reporting that disabling certain modules, then re-enabling them may cause the bug to evaporate.

And for the record, this bug is also present in -beta4.

danithaca’s picture

Version: 6.x-2.0-beta3 » 6.x-2.x-dev

another similar bug report at #777834: Recommender Overrides Cron - Cron Can't Run!. investigating.

danithaca’s picture

I'm sorry for those who have this problem. I just run through everything again on my local development environment and still can't find any problem with cron ....

To help me debug this problem, please run the following SQL on your MySQL db, and send me the results. I can then try to diagnose what was wrong on your environment.

select * from watchdog where type='recommender' order by timestamp desc limit 100;
select * from variable where name like '%cron%' or name like '%recommender%';

In the meantime, please uninstall anything related to the recommender modules until this problem is solved.

If you still want to use the recommender modules while I investigate the issue, just go to recommender.module file, and remove the "function recommender_cron() {....}" function. This should be a workaround fix to the problem.

mstef’s picture

You marked my issue as a dupe, even though I'm not really seeing people having the same exact issue.

Here: http://drupal.org/node/777834

danithaca’s picture

@mikestefff: please refer to the comment at http://drupal.org/node/597510#comment-2150376. That's why I think your issue #777834: Recommender Overrides Cron - Cron Can't Run! is a duplicate.

mstef’s picture

acknowledged

mstef’s picture

Version: 6.x-2.x-dev » 6.x-2.0-beta4

Any work on this? The module is unusable - maybe it would be a good idea to leave this as a dev rather than a beta release.

mstef’s picture

Any work on this? The module is unusable - maybe it would be a good idea to leave this as a dev rather than a beta release.

danithaca’s picture

Priority: Critical » Normal
Status: Needs work » Postponed (maintainer needs more info)

@mikestefff: please refer to http://drupal.org/node/597510#comment-2876950. I couldn't find any problem on my local dev environment in terms of problem. Unless I receive further debugging info from the environment that does have the problem, I can't do anything about it.

Superhero’s picture

I've got the same problem

Anonymous’s picture

I just found the same issue and ended up here while searching for a resolution to this problem.

Would love to help! But as for
http://drupal.org/node/597510#comment-2876950

is watchdog a module or something else? I'm on shared hosting so I'm afraid I won't be of much help. But how I discovered this issue in the first place was: Wanted to run Cron manually and got a loooong error message.

On clicking the "running cron manually" link on the status report it leads directly to the cron job for recommender, saying that it is running and then spits out the following error message (it's in German so I tried to translate it):

user warning: Table 'DATABASENAME.schreiberlinge_schreiberlinge_og_uid' does not exist query: INSERT INTO schreiberlinge_recommender_similarity(app_id, mouse1_id, mouse2_id, similarity, created) SELECT 1, n1.nid, n2.nid, COUNT(*), 1275081677 FROM schreiberlinge_schreiberlinge_og_uid n1 INNER JOIN schreiberlinge_schreiberlinge_og_uid n2 ON n1.uid=n2.uid GROUP BY n1.nid, n2.nid in /drupalinstallation-path/modules/recommender/Recommender.php on line 680.

"schreiberlinge" is the name of my site and of the layout I'm using (Sub-Theme of Beginning Web 2.0 - if that's important) and I changed Databasename and installationpath for privacy/security reasons.

Other information about my drupal installation:
Drupal 6.16
Recommender API 6.x-2.0-beta4
OG Similar Groups 6.x-1.1 (since it depends on Recommender)
Webserver: Apache
MySQL: 5.1.46
PHP: 5.2.13-0.dotdeb.1

For now I switched Recommender back to never running on Cron jobs. So Cronjobs work again. As for the recommender: Running it manually from mysite/admin/settings/recommender I get the same errormessage.

I tried re-installing the OG Similar Groups module but the error turned up again. Don't know if it has anything to do with the fact that the page is not really up yet and there's only 3 users and 2 groups. but since it says in the errormessage that the table does not exist, I don't think the error is because of the lack of users/groups.

I also uninstalled and re-installed the recommender module - no change.

Hope this helps.

danithaca’s picture

Status: Postponed (maintainer needs more info) » Needs work

thanks. this is helpful info. i'll debug soon.

cmejo’s picture

Hi danithaca,

Not sure why no one got you the information you needed sooner. Here you go:

http://p.linode.com/3881

http://p.linode.com/3882

Let me know how else I can be of help.

danithaca’s picture

Status: Needs work » Closed (works as designed)

@Amancham: You issue appears to be an OG Similar Groups module problem. It's fixed and will be available in the next release of similargroups module (perhaps in 1-2 days)

@CWFEU: Thanks for the information. But your logging data doesn't seem to have any problem...

Here's a summary of for the rest of the users:

Due to the complexity of the recommendation algorithm, the Recommender modules usually take very long time to finish running. That's why it could mess up cron process because cron would timeout before Recommender finish running. After several rounds of code review, I still can't find a bug in the code. If you believe there's a bug, please follow comment #13 and provide more info for me to debug. Otherwise I'll leave the issue as "by design"

For those of you who still want to use the Recommender modules, please refer to comments #6 and #13 for workaround solutions. In short, the workaround is to avoid using Recommender modules in the Drupal cron process, but to try the "drush recommender" command with the system cron.

For those of you who are running critical production server, please test the module in the dev environment first before deploying it. If you are not satisfied, please uninstall the module and try other alternatives, or wait for the next major improvement of the module.

To improve performance of the module, I'll try to work on #816112: Evaluate alternatives to boost performance (CPU/RAM) over the summer. Hopefully it'll solve key limitation of this module.

Anonymous’s picture

Thanks for looking into this and the information. I'll check for the new release of similar groups asap

lameei’s picture

+1

socialnicheguru’s picture

in #24, you mentioned ""drush recommender" command with the system cron." when i run drush on my system I see no such command. am I missing something? thanks

Eli Baskin’s picture

Is there anything new about it? I have the same problem.

angusmccloud’s picture

I stopped using Cron with this module a while ago. Even when I could run Cron, my server would crash trying to do the calcs. I do everything offline for recommendations now.

danithaca’s picture

Please see http://groups.drupal.org/node/137054 for the plan of RecAPI regarding the performance issue. Once it's switched to use Mahout running on a remote (or local) computer, there should be no cron problem.

ageres’s picture

Version: 6.x-2.0-beta4 » 6.x-2.0-beta5

drupal drupal-6.26
recommender-6.x-2.0-beta5
I have a similar problem. Run cron is redirect to a page of the progress of the process, then redirect to a page Recommender API. Queue cron processes is processed only to the Recommender API. The recommendation is not being updated.
I have a sloppy solution, but it works.

includes\form.inc : function batch_process($redirect = NULL, $url = NULL)
Change to
includes\form.inc function batch_process($redirect = NULL, $url = NULL, $progressive = TRUE)
In this fuction of the string "'progressive' => TRUE" change to "'progressive' => $progressive"

...modules/recommender/recommender.module : function recommender_run($selected = NULL)
The string "batch_process('/admin/settings/recommender')" change to "batch_process('/admin/settings/recommender',NULL,FALSE)"