Bug #65065
closedCron fail when using objectManager
0%
Description
Hi,
I have a weird bug. In my website, i have a some recurring tasks in my scheduler, all working well.
I added one other lately : When i manually execute the task, everything works perfectly. But when i set it to recurring, the cron fails to execute it, and the error is "Execution failed: 1232985415, The APC backend cannot be used because apc is disabled on CLI."
I thing this error has nothing to do with the real error, cause i have other recurring tasks, all working well and no problems with apc or cli
So i started debugging, enabling my code line by line, and i found that the error happens when this line code is executed :
$this->ministre = $this->objectManager->get('CCW\CcwTransparenceAgenda\Domain\Repository\MinistreRepository');
Here is the complete code :
Here's how i declare the objectManager :
$this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
I just can't understand why, manually it works, but when recurring, it fails ? Please help!
Thanks.
Updated by Wouter Wolters almost 10 years ago
- Status changed from New to Needs Feedback
Can you try to set apc.enable_cli = 1 ?
Updated by Mohamed Rebai almost 10 years ago
It's already 1. I checked in apc.php, phpinfo(), and tried echo ini_get('apc.enable_cli'); always got 1!
Updated by Mohamed Rebai almost 10 years ago
I tried this code just to test :
$objectManager->get('TYPO3\CMS\Extbase\Domain\Repository\BackendUserRepository');
Got the exact same error, so even when trying to get a Core Repository i get the error.
Updated by Wouter Wolters almost 10 years ago
Still the problem is the configruation of you APC backend cache and Command Line usage.
Did you try to check your CLI php.ini? It looks like your PHP for the web has a different configuration than your CLI PHP.
Otherwise try to disable the APC backend cache..
Updated by Mohamed Rebai almost 10 years ago
I tried to disable APC completely, tried to change configurations, tried a lot of stuff, whatever we do, we always got the same error when this line is in the code :
$objectManager->get('TYPO3\CMS\Extbase\Domain\Repository\BackendUserRepository');
So i'm not sure the issue is really related to APC ?
Updated by Mohamed Rebai almost 10 years ago
Ok forget it, a sysadmin found the problem with apc finally. Sorry for bothering you.
Updated by Stefan Neufeind almost 10 years ago
- Status changed from Needs Feedback to Closed
Thanks for the feedback. I read it was APC-related with no reason on the side of TYPO3 CMS.