Problem/Motivation

the below actions are running successfully but its state Failure, as you can check it from (admin/config/system/queues/jobs/drd).
Failed actions:

  • Run cron
  • Rebuild job schedulers
  • Update DRD library
  • Get or set maintenance mode (turn on, turn off)
  • Execute arbitrary PHP code
  • Updates translations
  • Execute arbitrary PHP code
  • Change user credentials

Proposed resolution

I traced the issue and I found the response for all these actions is empty array, also I checked the drd agent library latest version drd-1.7.0.phar, and I can see return []; from cron action.

I think it's better to return another response like True or False in case the action not need any other information instead of emty array.

Comments

Odai Atieh created an issue. See original summary.

Odai Atieh’s picture

Title: Failed cron jobs » Failed cron jobs - domain actions
Odai Atieh’s picture

Issue summary: View changes

  • jurgenhaas committed 761f81b on 8.x-3.x
    Issue #3072685 by Odai Atieh, jurgenhaas: Failed cron jobs - domain...
jurgenhaas’s picture

Version: 8.x-3.17 » 8.x-3.x-dev
Assigned: Unassigned » jurgenhaas
Status: Active » Needs review

Great report, thanks @Odai Atieh for taking the time to analyse it so deeply. To fix the issue I've taken a slightly different approach by better checking the return values where needed. So the fix in purely in DRD and if you give the latest dev release a try it should be fixed. Please let us know if it works for you this way.

Odai Atieh’s picture

Status: Needs review » Needs work

Thank you @jurgenhaas
I tested the latest dev release, but the same issue still exists.

jurgenhaas’s picture

Sorry, I can't reproduce the problem any longer. Here is what I'm doing:

  1. Go to a domain (e.g. /drd/domains/domain/105)
  2. Select the action "Run cron" and click apply
  3. Run the command drush advancedqueue:queue:process drd
  4. Go to /admin/config/system/queues/jobs/drd and see two jobs being completed successfully

Can you please clarify what exactly is going wrong in your case?

Odai Atieh’s picture

To reproduce the issue:

  1. Go to a domain (e.g. /drd/domains/domain/105)
  2. Select the action "Run cron" and click apply
  3. Run cron from (/admin/config/system/cron)
  4. Go to /admin/config/system/queues/jobs/drd and see two jobs being completed Failure
jurgenhaas’s picture

I can't confirm, this is working just fine with the latest dev release. So the failure in your case may come from a different source then?

Odai Atieh’s picture

I think this is related to process function in /src/Plugin/AdvancedQueue/JobType/Action.php ,
and after debugging the result array, I found it empty, so the last line will always be Failure
return new JobResult($result ? Job::STATE_SUCCESS : Job::STATE_FAILURE);

jurgenhaas’s picture

Well, the value for $result comes from $result = $this->processAction(); and the return code from that is gathered from \Drupal\drd\Plugin\AdvancedQueue\JobType\ActionEntity::processAction() and looks like return ($action->executeAction($entity) !== FALSE);

So, that can never be an empty array, it can only be TRUE or FALSE. Which is what I have introduced into the latest dev release.

jurgenhaas’s picture

Status: Needs work » Postponed (maintainer needs more info)
jurgenhaas’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)