I'm not even sure if this is a webform or related module issue but would appreciate any helpful suggestions.

We recently setup several webform modules including webform_ab.

Everything seems to be working fine but cron errors are showing in watch dog consisting of "Cron run exceeded the time limit and was aborted" followed by an access denied on node/xyz which is the nodeID of one webform and sometimes xyz is the nodeID of the other webform.

Any suggestions? Thanks.

Comments

quicksketch’s picture

Webform core doesn't do anything on cron runs, so I doubt Webform itself is responsible for the problem. Its hard to say where this problem could be originating.

izmeez’s picture

Thanks for the fast response. I'll leave this open while I try to resolve it.

izmeez’s picture

Project: Webform » Webform A/B Testing
Version: 6.x-3.x-dev » 6.x-2.x-dev

I am still not entirely sure of the cause for this, but I am wondering if this is resulting from Drupal search and the webform_ab module where I noticed a redirect error in another action and wonder if this is happen on cron. I have tried to exclude webform and webform_ab from the search configuration and I'm not sure that it is being excluded. I am moving this to the webform_ab queue. Thanks.

BrockBoland’s picture

Status: Active » Postponed (maintainer needs more info)

webform_ab doesn't do anything on cron either. I haven't had any issues like this on sites that I've used it on, but it's entirely possible that it's trying to redirect to one of the webforms in the A/B test when something happens in the cron process.

You mention a redirect error from another action: could you provide more info on that? Could you also list any other contrib modules that you have enabled? It's possible that one of them is doing something weird on cron.

izmeez’s picture

@brockboland, the redirect error from another action I have mentioned in http://drupal.org/node/1490574

I am thinking to do some more testing including removing webform_ab and see that happens on cron and then re-enable. So I may have more info to add.

Thanks.

izmeez’s picture

Removing webform_ab definitely solves my error "Cron run exceeded the time limit and was aborted"

I am still wondering if the webform_ab node was being accessed by Drupal search giving rise to this problem. I did try to exclude it from the search without success. I am not sure how to better pinpoint the problem, but would like to so that I can make use of the webform_ab module.

benclark’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new448 bytes

I was getting the same cron error, so I did a little investigating and found that it was happening anytime a webform_ab node was being indexed by search.

A little more digging and I discovered that when a node is indexed, there is an eventual call to webform_ab_node_view($node, FALSE, FALSE), and it was the double-false case that was not being handled correctly.

The original flow of webform_ab_node_view() reads like:

if ($teaser) {
  // don't do any drupal_goto() calls
}
else {
  // drupal_goto()
}

I'm attaching a patch that changes the flow to read like:

if ($teaser) {
  // don't do any drupal_goto() calls
}
elseif ($page) { // <--
  // drupal_goto()
}

This allowed cron (and search indexing) to complete successfully.

FWIW, I only ever had cron failure when cron was run via drush cron. Running it via the cron.php script, cron ran successfully. I'm pretty baffled by that, honestly.

BrockBoland’s picture

Status: Needs review » Fixed

benclark's patch from #9 has been committed. 6.x-2.2 will be available shortly.

izmeez’s picture

Status: Fixed » Needs review

Thanks for the patch and the new version. I have tried this and it appears to have resolved the watchdog error "Cron run exceeded the time limit and was aborted". However, I am now seeing in watchdog the error, "Invalid argument supplied for foreach() in /home/xxx/public_html/modules/taxonomy/taxonomy.module on line 1293." Any thoughts?

Thanks,

Izzy

BrockBoland’s picture

I would be pretty surprised if that was related. Does the error go away if you switch back to 6.x-2.1 (and change nothing else)?

izmeez’s picture

Title: Trying a bunch of webform modules, cron run exceeded the time limit and was aborted » Webform_ab module and cron errors

I left everything the same including the existing webforms and deleted the webform-ab node but left the webform_ab module 6.22 installed and the cron error described in comment #9 went away.

BrockBoland’s picture

Have you been able to replicate the bug by creating a new Webform AB node since? Perhaps you could open a new issue with more details?

BrockBoland’s picture

Status: Needs review » Postponed (maintainer needs more info)
izmeez’s picture

It was a new webform_ab node that was created when testing the new version as described in comment #9. I can certainly open it as a new issue but I am not sure what additional details I can offer.

My thoughts were to leave it here as both of these cron errors may be an indication of some unexpected behaviour from interactions that occur during cron. The original watchdog error may have prevented progression to the point of the second error.

Is there some way to debug cron?

Thanks.

BrockBoland’s picture

I'm not sure of a good way to debug cron, and I'm not yet convinced that this error from the taxonomy module is related to Webform A/B. You could put in an error_log() call in taxonomy.module right before line 1293, and have it print out the variable that it's trying to loop over (and maybe some other relevant variables) to determine what value or node is failing there.

Bastlynn’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

There hasn't been much follow up on this since it was last reported. If this if still an issue, plz update to the latest version of code and open a new ticket. I'll be glad to take a look at that time.