Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

[silverstripe-queuedjobs] class does not exist in Injector.php


Reply


5 Posts   503 Views

Avatar
svandragt

Community Member, 44 Posts

10 December 2013 at 10:15pm

Edited: 10/12/2013 10:18pm

I've got problems using this module on SS 3.0.8. I've created a "class VacancyPage extends Page" pagetype that needs unpublished at a certain date. (I'm using the https://github.com/silverstripe-australia/advancedworkflow module in combination with the silverstripe-queuedjobs module for running the unpublish job.

The job for this gets created ok but when it's due i get the following error:

[Error] Broken jobs were found in the job queue
/public_html/queuedjobs/code/services/QueuedJobService.php:269

Browser says:
[2013-12-09 23:59:01][ERROR] Job caused exception Class VacancyPage does not exist in /public_html/framework/control/injector/Injector.php at line 846
[2013-12-09 23:59:01][INFO] Job paused at 2013-12-09 23:59:01

I've done a /dev/build and ?flush=1 and the VacancyPages are in use on the site without issues. When I run /dev/tasks/ProcessJobQueueTask it says "No new jobs" but I receive the broken jobs error email.

Pressing what looks like a'reload job' button in the browser interface and then 'playing' the job makes it run successfully.

Any idea how I get my job to run successfully?

Attached Files
Avatar
kinglozzer

Community Member, 175 Posts

10 December 2013 at 10:22pm

Hi svandragt,

I don't have any experience with the queuedjobs module, but as it runs tasks from the command line you could try setting $_FILE_TO_URL_MAPPING and see if that helps. I'd also try flushing from the command line (I don't think this should actually change anything, but worth a shot):

php /your/site/dir/framework/cli-script.php dev/build flush=1

Loz

Avatar
svandragt

Community Member, 44 Posts

10 December 2013 at 10:28pm

Loz,
I have the $_FILE_TO_URL_MAPPING in place in the _ss_environment.php:

global $_FILE_TO_URL_MAPPING;
$_FILE_TO_URL_MAPPING['/siteroot'] = 'http://www.the.site';

I run the cronjob like this:
* * * * * [/siteroot]/framework/sake dev/tasks/ProcessJobQueueTask >/dev/null 2>&1

I've done a build+flush via the commandline see if that helps.

Avatar
svandragt

Community Member, 44 Posts

10 December 2013 at 10:32pm

Edited: 10/12/2013 10:33pm

Possibly the problem is that I run the cron job in the root's crontab but that the dev/build flush=1 was not done by this user. This solved another problem I was having so awaiting my next job to see if its working now. if this doesn't work then I will move the cronjob to the www-data user which runs the webserver.

Avatar
svandragt

Community Member, 44 Posts

23 February 2014 at 2:44am

I can confirm that the solution is to add the cron to (in my case) the user the web server is run under (www-data for ubuntu server):

sudo -u www-data crontab -e

When flushing / dev/building in the browser the www-data user is used so this then prepares the cron job.