cron mail

coullet

Member
Hi,

i have some cron mail task that work when i run it manually in backend.
But when scheduled run in frontend i get en error 1064.
This error come only one time (i have several task, so one time per task), because last run of task is setting, so on next page loading, task is not run.
 
Can you post error details?
Do you see anything in the fabrik_log table?

You've set prefilters on your lists applied to registered and using my->id in an IN condition.
In the frontend my->id is the id of the logged in user. If an IN () is empty you'll get a mySQL error.

Additionally you have enabled "Run gating" in the scheduled tasks.
If set to yes, Fabrik will temporarily unpublish this plugin when it is running, to prevent multiple copies being run at the same time. This is useful if you have a script which can potentially take longer to execute than the run interval. If you use this option, you should periodically check to make sure you pligin has not become stuck as unpublished, as if your script causes certain error conditions, we may not be able to re-publish it

BTW: if you apply prefilters to registered they are NOT applied to public, so the complete unfiltered list is visible/editable to everybody not logged in (if list view/edit access is set to public...)
If your site is accessed by a guest it will run the scheduled task using the list without any prefilter.
 
it's an error 1064, i put the query in attached file (i make it more readable, so error is at line 95/96 (two FROM clause)

You've set prefilters on your lists applied to registered and using my->id in an IN condition.
In the frontend my->id is the id of the logged in user. If an IN () is empty you'll get a mySQL error.

BTW: if you apply prefilters to registered they are NOT applied to public, so the complete unfiltered list is visible/editable to everybody not logged in (if list view/edit access is set to public...)
If your site is accessed by a guest it will run the scheduled task using the list without any prefilter.

All site is only accessible to registered users (except the connexion page...), so i assume that user id can't be empty, and pre filters are always applied.
But i keep this in mind for other site...
 

Attachments

  • query.txt
    9.9 KB · Views: 184
All site is only accessible to registered users
This doesn't matter, the list is accessible for public if someone is editing the URL.
And I think the scheduled task is already triggered when the start site (any site) is loaded.
 
This doesn't matter, the list is accessible for public if someone is editing the URL.

ok... so best way is to restrict access ro registered for all list?

And I think the scheduled task is already triggered when the start site (any site) is loaded.

not sure: the error i get come only after connection. On the start page (with only connection form) there is no error
 
Does that query look correct (other than the error!), or does it look like two different queries have become conflated?

if you disable all but that one, does it work?

-- hugh
 
Query look correct :
SELECT
field list
FROM (and a second FROM that cause the error)
join list
WHERE clause (with a mysterious 2=-2 ...)

Don't understand what you want to disable?
 
ok ;)
Yes only one is enabled.
i have 3 tasks, if all is activated, then error coming 3 times before i get normal access to the page.
 
Which is weird, as the cron plugin doesn't run till afterRender, so no errors from it should be visible.

Looking now.

-- hugh
 
That query in the error you attached is just screwed up. All the joins and the FROM are doubled up.

At this point I have no clue whatsoever what is causing that.


-- hugh
 
So where do you see the error? I've set it to run once a second, and am loading a page on the front end, no errors.

-- hugh
 
ah yes, forgot to talk about that:
Because there is also a time problem:
look at the last run time, there is two hour between time in the list task and the task edit form.
If you reset it to an hour before now, you'll see the error
 
I just managed to replicate the problem locally. Which is good news, as that means I can track and fix it.

-- hugh
 
I have no idea why, but locally it seems like commenting out line 260 in ./plugins/system/fabrikcron/fabrikcron.php ...

Code:
//$this->log->message .= "\n" . $thisListModel->buildQuery();

... I no longer get that error.

Can you try that?

-- hugh
 
Ok, it work now!
But i have now another error
i see that in log:
2,DateTime::__construct(): Failed to parse time string (DATE_FORMAT(NOW(),"%Y-%m-%d"))

it's for the task #4 refer to the list #162
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top