I think when scheduled task is running like this (?scheduled=task;ts=1515043800) there is an error reported like this (Headers already sent in /var/www/clients/clientXXX/webXXX/web/index.php at line 33).
I believe this is due to MultiTenancy addon but I need a direction to check for this to fix it.
Thank you in advance.
Depends on the direction you need.
In general it just means that the header function was called before the one in index.php at line 33.
The reason... well, most of the cases an error that for some reason sends an header too early in the games.
I resolved it by running the fast cgi after dispatcher code, instead of before it.
if (isset($_GET['scheduled']))
{
$controller = new ScheduledTasks_Controller();
$controller->action_autotask();
// Don't make people wait on us if we can help it.
if (function_exists('fastcgi_finish_request')) {
fastcgi_finish_request();
}
}
I am, however, not sure of its effects though I managed to stop the header error.
Will it hurts if default ElkArte is also running in the above changed sequence instead of default as below?
if (isset($_GET['scheduled']))
{
// Don't make people wait on us if we can help it.
if (function_exists('fastcgi_finish_request'))0
fastcgi_finish_request();
$controller = new ScheduledTasks_Controller();
$controller->action_autotask();
}
hmm...
There is no other errors?
Did you try running manually the scheduled task?
As I said, usually the headers already sent is due to a previous error firing, so I think that finishing the request before is just a silencing the error, sort of adding a @.
Yes. I did try manually running the scheduled task but there is no error. I also waited until now, and still no error.
The addon does not modify ScheduledTasks.controller.php, so I am not sure which part of the modification (or even hook) triggers the header send when fastcgi_finish_request() is run first before the scheduled tasks.
I can only follow the error if it is there but they are just the same if I am using the default index.php. So I am clueless to figure out other solution.
Does the addon have any scheduled task at all?
When you go to admin > manintenance > scheduled tasks > task log do you see any with a red cross? (Actually a red question mark :P)
I don't think so or at least not that I remembered anything about it while browsing the code, but I will check it out today. Thanks for the tips.
BTW: 1.0 or 1.1?
Because on 1.0 I remember seeing such errors around but I think it was fixed in 1.1?
I am using 1.1 now with the addon as well. What were the errors in 1.0 and how was that fixed? May be that will help me in narrowing this down.
Heck if I remember...
No problem. At least for now. ;)
Check the error log file. Anything relevant?