cant run send-campaigns --campaigns_type=regular --campaigns_limit=10 --campaigns_offset=0

pradeep sharma

Active Member
Hi @twisted1919 ,

I am unable to run the following cron job


Code:
/usr/bin/php -q /home/admin/app.domain.com/public_html/apps/console/console.php send-campaigns --campaigns_type=regular --campaigns_limit=10 --campaigns_offset=0 --verbose=1

I Get This verbose

Code:
[2024-05-15 12:18:15] - Starting the work for this batch...
[2024-05-15 12:18:15] - PCNTL processes running already, locks acquired previously!

Mutex are on redis server on and cache on a separate redis reserve

We flushed mutex by running the following command many times and no success

Code:
redis-cli FLUSHALL

even we flushed cache as well.

PHPCLI version 8.2

but wen we run the same command without --campaigns_limit=10 parameter it works.

Code:
/usr/bin/php -q /home/admin/app.domain.com/public_html/apps/console/console.php send-campaigns --campaigns_type=regular --campaigns_limit=10 --campaigns_offset=0 --verbose=1
Code:
/usr/bin/php -q /home/admin/app.domain.com/public_html/apps/console/console.php send-campaigns --campaigns_limit=10 --campaigns_offset=0 --verbose=1

Code:
/usr/bin/php -q /home/admin/app.domain.com/public_html/apps/console/console.php send-campaigns --campaigns_type=autoresponder --campaigns_limit=10 --campaigns_offset=0 --verbose=1

Above cron Worked

but

Code:
/usr/bin/php -q /home/admin/app.domain.com/public_html/apps/console/console.php send-campaigns --campaigns_type=regular --campaigns_limit=10 --campaigns_offset=0 --verbose=1

did not worked!!

Can u please help us.


Regards

Pradeep
 
Last edited:
@twisted1919 @laurentiu

We verified Several times

by Doing below procedure

1. Dissabled corn on system startup.

Code:
systemctl disable cron

rebooted the server so that no running process or any hidden process should get killed

flushed Mutex DB on Redis as well

2. We run the same cron

Code:
/usr/bin/php -q /home/admin/app.domain.com/public_html/apps/console/console.php send-campaigns --campaigns_type=regular --campaigns_limit=10 --campaigns_offset=0 --verbose=1

Got the same error message

Code:
[2024-05-16 10:22:13] - Starting the work for this batch...
[2024-05-16 10:22:13] - PCNTL processes running already, locks acquired previously!

Please look into this

Help Needed

Regards

Pradeep
 
The lock is defined as:
PHP:
// set the lock name
        $lockName = sha1(sprintf(
            '%s:campaigns_type:%s:customer_id:%s:exclude_customer_id:%s:campaign_id:%s:exclude_campaign_id:%s:list_id:%s:exclude_list_id:%s:campaigns_limit:%d:campaigns_offset:%d',
            __METHOD__,
            $this->campaigns_type,
            $this->customer_id,
            $this->exclude_customer_id,
            $this->campaign_id,
            $this->exclude_campaign_id,
            $this->list_id,
            $this->exclude_list_id,
            $this->campaigns_limit,
            $this->campaigns_offset
        ));
So if you run the command with the
Code:
--campaigns_type=regular --campaigns_limit=10 --campaigns_offset=0
params, then you should be able to run it with same params but other values just fine, since that would generate a new lock file, i.e:
Code:
--campaigns_type=regular --campaigns_limit=10 --campaigns_offset=10

So There's not much to add from our end, we tested this and it works as expected.
 
The lock is defined as:
PHP:
// set the lock name
        $lockName = sha1(sprintf(
            '%s:campaigns_type:%s:customer_id:%s:exclude_customer_id:%s:campaign_id:%s:exclude_campaign_id:%s:list_id:%s:exclude_list_id:%s:campaigns_limit:%d:campaigns_offset:%d',
            __METHOD__,
            $this->campaigns_type,
            $this->customer_id,
            $this->exclude_customer_id,
            $this->campaign_id,
            $this->exclude_campaign_id,
            $this->list_id,
            $this->exclude_list_id,
            $this->campaigns_limit,
            $this->campaigns_offset
        ));
So if you run the command with the
Code:
--campaigns_type=regular --campaigns_limit=10 --campaigns_offset=0
params, then you should be able to run it with same params but other values just fine, since that would generate a new lock file, i.e:
Code:
--campaigns_type=regular --campaigns_limit=10 --campaigns_offset=10

So There's not much to add from our end, we tested this and it works as expected.

did you try with PCNTL YES??

I am able to run the same cron if PCNTL is NO ! So the issue is somewhere in PCNTL or something i don't know much !!

Please check I can give you my server access if required!!
 
Back
Top