Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » [silverstripe-queuedjobs] class does not exist in Injector.php

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 379 Views
  • svandragt
    Avatar
    Community Member
    44 Posts

    [silverstripe-queuedjobs] class does not exist in Injector.php Link to this post

    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
  • kinglozzer
    Avatar
    Community Member
    142 Posts

    Re: [silverstripe-queuedjobs] class does not exist in Injector.php Link to this post

    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

  • svandragt
    Avatar
    Community Member
    44 Posts

    Re: [silverstripe-queuedjobs] class does not exist in Injector.php Link to this post

    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.

  • svandragt
    Avatar
    Community Member
    44 Posts

    Re: [silverstripe-queuedjobs] class does not exist in Injector.php Link to this post

    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.

  • svandragt
    Avatar
    Community Member
    44 Posts

    Re: [silverstripe-queuedjobs] class does not exist in Injector.php Link to this post

    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.

    379 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.