CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Strange issue with Joomla 2.5.14 and CiviCRM 4.3.4 and cron jobs
Pages: [1]

Author Topic: Strange issue with Joomla 2.5.14 and CiviCRM 4.3.4 and cron jobs  (Read 1895 times)

nant

  • I post frequently
  • ***
  • Posts: 143
  • Karma: 4
    • Joomlapolis
  • CiviCRM version: 4.3.4
  • CMS version: Joomla 2.5.11
  • MySQL version: 5
  • PHP version: 5.3
Strange issue with Joomla 2.5.14 and CiviCRM 4.3.4 and cron jobs
November 01, 2013, 01:39:05 am
I have recently discovered a weird (for me) issue with my setup of:

+ Joomla 2.5.14
+ CiviCRM 4.3.4
+ CiviMail
+ cron job

I had setup an every 15 mins cli executed cron job that appeared to work just fine and it would trigger the CiviMail job to flush mailer items.

Suddenly (yeah I know - wish I could pinpoint what changed), the following situation seems to occur:

I create a new CiviMail mailing that I submit for immediate sending.
I verify that after I submit such a mailing:

+ the Mailing appears to be submitted and scheduled in the Scheduled and Sent Mailings panel of civicrm
+ the scheduled date/time stamp appears correct
+ the status is scheduled
+ the Start/Completed dates are empty
+ a new row is create in the civicrm_mailing_job table with: scheduled_date information correct (same as civicrm shows), status = scheduled, NULL values for start_date/end_date columns

When the cli cron job is executed I see the following:

+ the civicrm scheduled and sent panel shows status of this job as running
+ the civicrm panel also shows start date/time as the time that the cron job was executed
+ the database table has an extra child row linked to the previously created row

I have replicated the two relevant database rows below:


id: 194
mailing_id: 89
scheduled_date: 2013-11-01 10:26:26
start_date: 2013-11-01 10:30:02
end_date: NULL
status: Running
is_test: 0
job_type: NULL
parent_id: NULL
job_offset: 0
job_limit: 0

id: 195
mailing_id: 89
scheduled_date: 2013-11-01 10:26:26
start_date: NULL
end_date: NULL
status: Scheduled
is_test: 0
job_type: child
parent_id: 194
job_offset: 0
job_limit: 8

and the items are never emailed, the job just stays at running status forever.

Any thoughts on what the cause may be or how I can further debug this?\
--
Nick (aka nant from CB Team)

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Strange issue with Joomla 2.5.14 and CiviCRM 4.3.4 and cron jobs
November 01, 2013, 08:16:33 am

nant:

ping us on irc and we can try and debug and get it going.

creating another child record is good and the first step, i.e. the child is the job that actually delivers the mail. the next question is why is the 'child' job not starting?

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

nant

  • I post frequently
  • ***
  • Posts: 143
  • Karma: 4
    • Joomlapolis
  • CiviCRM version: 4.3.4
  • CMS version: Joomla 2.5.11
  • MySQL version: 5
  • PHP version: 5.3
Re: Strange issue with Joomla 2.5.14 and CiviCRM 4.3.4 and cron jobs
November 03, 2013, 09:12:38 am
Hi Donald!

I added a

var_dump($query);

to line 110 of CRM/Mailing/BAO/Job.php

and the results are:

string(562) "
      SELECT   j.*
        FROM   civicrm_mailing_job     j,
           civicrm_mailing m
       WHERE   m.id = j.mailing_id AND m.domain_id = 1
                     AND m.sms_provider_id IS NULL
         AND   j.is_test = 0
         AND   ( ( j.start_date IS null
         AND       j.scheduled_date <= 20131103190506
         AND       j.status = 'Scheduled' )
                OR     ( j.status = 'Running'
         AND       j.end_date IS null ) )
         AND (j.job_type = 'child')
         AND    ( 0 )
      ORDER BY j.mailing_id,
           j.id
      "
string(566) "
      SELECT   j.*
        FROM   civicrm_mailing_job     j,
           civicrm_mailing m
       WHERE   m.id = j.mailing_id AND m.domain_id = 1
                     AND m.sms_provider_id IS NOT NULL
         AND   j.is_test = 0
         AND   ( ( j.start_date IS null
         AND       j.scheduled_date <= 20131103190506
         AND       j.status = 'Scheduled' )
                OR     ( j.status = 'Running'
         AND       j.end_date IS null ) )
         AND (j.job_type = 'child')
         AND    ( 0 )
      ORDER BY j.mailing_id,
           j.id
      "
--
Nick (aka nant from CB Team)

nant

  • I post frequently
  • ***
  • Posts: 143
  • Karma: 4
    • Joomlapolis
  • CiviCRM version: 4.3.4
  • CMS version: Joomla 2.5.11
  • MySQL version: 5
  • PHP version: 5.3
Re: Strange issue with Joomla 2.5.14 and CiviCRM 4.3.4 and cron jobs
November 03, 2013, 09:30:25 am
So guessing that the issue is the last clause:

AND (0) which makes the whole query fail.

This is because of the:

         AND   {$mailingACL}

so I am assuming that there is something wrong with the ACL and permissions

Please note that I am running the cron job from cli using a superadmin username/password.
« Last Edit: November 03, 2013, 09:47:04 am by nant »
--
Nick (aka nant from CB Team)

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Strange issue with Joomla 2.5.14 and CiviCRM 4.3.4 and cron jobs
November 04, 2013, 07:03:53 am

nick:

i suspect this is due to the acl changes we made in 4.4.0 (and which i think u patched)

i'll take a look and analyse this later today / befor 4.4.1 is released

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

nant

  • I post frequently
  • ***
  • Posts: 143
  • Karma: 4
    • Joomlapolis
  • CiviCRM version: 4.3.4
  • CMS version: Joomla 2.5.11
  • MySQL version: 5
  • PHP version: 5.3
Re: Strange issue with Joomla 2.5.14 and CiviCRM 4.3.4 and cron jobs
November 04, 2013, 08:22:58 am
Quote from: Donald Lobo on November 04, 2013, 07:03:53 am

nick:

i suspect this is due to the acl changes we made in 4.4.0 (and which i think u patched)

i'll take a look and analyse this later today / befor 4.4.1 is released

thanx

lobo

That would be great.
Let me know if I can test.
--
Nick (aka nant from CB Team)

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Strange issue with Joomla 2.5.14 and CiviCRM 4.3.4 and cron jobs
November 04, 2013, 03:10:51 pm

2 questions:

a. what user are you running with cli?

b. does the mailing send when you run it via the url:

http://HOSTNAME/administrator/?option=com_civicrm&task=civicrm/mailing/queue&reset=1

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Strange issue with Joomla 2.5.14 and CiviCRM 4.3.4 and cron jobs
November 04, 2013, 03:48:48 pm

investigated some more. Seems like this is due to the fact that we do not load the joomla user during the joomla bootstrap process. this caused the permission call to fail and hence the issue :(

from my irc log with lcdweb:

Code: [Select]
03:45:17 PM) dlobo: check
(03:45:39 PM) dlobo: CRM/Utils/System/Joomla.php
(03:45:45 PM) dlobo: function loadBootstrap
(03:45:53 PM) dlobo: (also check the drupal file)
(03:46:03 PM) dlobo: in joomla we ignore the loadUser parameter
(03:46:12 PM) dlobo: and we cant do so anymore in 4.4 (since we fixed the acl thingee)
(03:46:27 PM) dlobo: so we need to fix it and load the right user
(03:46:32 PM) dlobo: so permission checks work etc
(03:47:53 PM) dlobo: i.e we want the right user logged in, so:
(03:47:59 PM) dlobo: JFactory::getUser()->authorise will do the right stuff

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Strange issue with Joomla 2.5.14 and CiviCRM 4.3.4 and cron jobs
November 04, 2013, 04:30:34 pm

since we want 4.4.1 out, i'm thinking of rolling back my changes so WP/Joomla wont have civi acls working for now (which was the status quo prior to 4.4 anyway). this seems like a bigger can of worms than i expected :(

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

nant

  • I post frequently
  • ***
  • Posts: 143
  • Karma: 4
    • Joomlapolis
  • CiviCRM version: 4.3.4
  • CMS version: Joomla 2.5.11
  • MySQL version: 5
  • PHP version: 5.3
Re: Strange issue with Joomla 2.5.14 and CiviCRM 4.3.4 and cron jobs
November 04, 2013, 10:43:16 pm
Quote from: Donald Lobo on November 04, 2013, 04:30:34 pm

since we want 4.4.1 out, i'm thinking of rolling back my changes so WP/Joomla wont have civi acls working for now (which was the status quo prior to 4.4 anyway). this seems like a bigger can of worms than i expected :(

lobo

That's a shame.

As always I am available to test Joomla related fixes.
--
Nick (aka nant from CB Team)

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Strange issue with Joomla 2.5.14 and CiviCRM 4.3.4 and cron jobs
November 05, 2013, 07:10:16 am

we'll need someone who's familiar with joomla internals to help fill out some of the stub functions in CRM/Utils/System/Joomla.php

specifically, the loadUser aspect of things. It will need to work for both 2.5.x and 3.x.

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

nant

  • I post frequently
  • ***
  • Posts: 143
  • Karma: 4
    • Joomlapolis
  • CiviCRM version: 4.3.4
  • CMS version: Joomla 2.5.11
  • MySQL version: 5
  • PHP version: 5.3
Re: Strange issue with Joomla 2.5.14 and CiviCRM 4.3.4 and cron jobs
November 05, 2013, 10:35:04 am
Quote from: Donald Lobo on November 05, 2013, 07:10:16 am

we'll need someone who's familiar with joomla internals to help fill out some of the stub functions in CRM/Utils/System/Joomla.php

specifically, the loadUser aspect of things. It will need to work for both 2.5.x and 3.x.

lobo

Ok, I took a look at this file.
It looks like in some cases code is not using the Joomla API and instead goes directly to database.

I need to understand what the issues are in order to be able to help (or state that I cannot).

And I am having trouble understanding how this code is causing ACL related issues.
--
Nick (aka nant from CB Team)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Strange issue with Joomla 2.5.14 and CiviCRM 4.3.4 and cron jobs

This forum was archived on 2017-11-26.