The cleanurl behavior is detected in civicrm.settings.php with this test:
------------
if ( function_exists( 'variable_get' ) && variable_get('clean_url', '0') != '0' ) {
define( 'CIVICRM_CLEANURL', 1 );
} else {
define( 'CIVICRM_CLEANURL', 0 );
}
------------
The test works correctly in the normal case where Drupal bootstraps before CiviCRM (i.e. Drupal... -> civicrm_initialize... -> require civicrm.settings.php). However, when CiviCRM bootstraps before Drupal, the 'variable_get' function is undefined at the critical moment, so the test determines that cleanurl is unavailable. This most likely causes failures in all cron scripts.
There is probably some clean solution which involves moving the test logic from civicrm.settings.php to some part of CRM/Utils/System/Drupal.php where the availability of variable_get can be assured. It's not obvious to me where that is. In lieu of that, the attached patch adds an extra instruction to loadBootstrap which refreshes cleanURL.
Aside: This bug would not be reproduced when using, say, CiviMail's "Preview" feature (or "Send test mailing" – but I didn't test) because that uses the standard Drupal->CiviCRM bootstrapping. To reproduce, one must actually invoke the cron script in the documented fashion.
please discuss on forums. this is a permisisoning issue