Hi,

Since supercron-6.x-1.3 (I don know before this version), it doesn't detect the right path of the script supercron.php. With that version, I put it in the Drupal root and it works well even if it gives me warning.

I'm in an OpenBase dir environment.

I upgraded from 1.3 to 2.x-dev and I wanted to change the path of supercron.php at admin/settings/supercron/invocation from something like:
/var/xxx/wrong-path/xxx/wrong-path/sites/all/modules/supercron/supercron.php
to:
/var/xxx/right-path/drupal-6/supercron.php

But, after changing the path of supercron.php at admin/settings/supercron/invocation, I lost the pages admin/settings/supercron/invocation and admin/settings/supercron and they point me to admin/settings. I was user 1. If I remember, the script was not yet in the directory when I changed the path in the config.

Actually I don't have access to config pages either with user 1 or any other user. So I will roll back to version 1.3.

Comments

j0nathan’s picture

Status: Active » Postponed

It seems the site I am working on is unstable since updates of a couple of modules, so I put the status of this issue as postponed. Until we can reproduce, feel free to close it.

MisterSpeed’s picture

Some menus and URLs were inaccessible in the previous 2.x version under some scenarios, and this does explain the majority of the scenario ahead; the path change may simply have been concurrent rather than the cause. Will keep it in postponed state until the new version is fully tested out.

jpcwebb’s picture

I am also getting the wrong path in this version, in my case it's duplicating part if the path as in /path/to/home/folder/drupal/drupal/supercron.php - note the drupal twice. To correct this, I put in the correct path under 'other location', but then the module wants me to edit the supercron file, even though it is actually in the correct place.

bennos’s picture

look at ther supercron file. You have to add the drupal root path in the supercron.php file.

jpcwebb’s picture

No, that doesn't work either - it's a bug in the way supercron detects the path. Also, the settings in the crontab page are not saved when trying to specify the path to the php binary.

matsta’s picture

Hi,

I have the same issue as jpcwebb in #5 above. My drupal installation is in a sub folder (it is not directly in the public_html) and the drupal root path specified in the supercron config duplicates the sub folder in the path.

I have tried to use the "other" setting as well but it doesn't work. I have tried putting the supercron.php file in a number of locations and updated the $drupal_dir settings as well each time, but it doesn't want to work.

Why is this issue postponed? It seems like a pretty important issue seeing that it prevents you from using the module.

I agree with jpcwebb that it appears to be a bug in the way that supercron detects the path.

matsta’s picture

Also, whewn trying to use the "other" location setting there is the following information

"If you place supercron.php anywhere but in the Drupal root, make sure to edit the value of $drupal_dir in supercron.php so that it contains the path to the Drupal root directory."

However, when you edit the supercron.php file it says the following:

"If you place your supercron.php in other place than Drupal root, or supercron directory. Specify your script here."

Note the first message says "path to drupal root directory", second message says "specify your script here" . Which one is it, the path to the drupal root or the path to the script?

I cannot get it to work with any configuration.

I would prefer to use the drupal root or module location, but the path generated by supercron in both instances is incorrect.

j0nathan’s picture

Status: Postponed » Active

Hi matsta (#6),
The status was postponed as per my comment in #1.
I put it back to active.

Andy B’s picture

Status: Active » Needs work

Why did you postpone it? Just like a prior comment, the issue is reproduceable regardless of what drupal install you are using. I have 6.19 ATM. It never worked since I have installed it on 6.17. Anyways, relating to the path problem, here is the error I get when going to the Administrate>Site Configuration>Super cron tab:

The supercron.php file should be copied from the e:\web\public_html\eternityrecords\drupal\index.php/sites/all/modules/supercron directory to e:\web\public_html\eternityrecords\drupal\index.php/; until that is done, your cron-driven tasks will not execute when scheduled to.

An interesting point about supercron not being able to detect the right file/folder combo:

1. Why does supercron think that index.php is a folder? and how do you fix that?
2. Regardless of where I put supercron.php, it doesn't work at all. supercron can't find supercron.php regardless of what setting in the crontab settings I make.
3. Clarification on whether supercron module is looking for the absolute/relative path to supercron.php file itself or just the folder it lives in would be good.
4. I have drupal installed in /drupal. A sub folder off of my hosting root.
5. I have a subdomain mapped to this drupal folder. so, as far as drupal is concerned, / is the drupal root.
For reference, here is the info from the current status report:

Drupal 6.19
Access to update.php Protected
Audio import Import directory ../mp3 exists
CAPTCHA Already 1 blocked form submission
CTools CSS Cache Exists
Configuration file Protected
Cron maintenance tasks Last run 41 min 47 sec ago
You can run cron manually.
Database updates Up to date
Drupal core update status Up to date
File system Writable (public download method)
GD library bundled (2.0.34 compatible)
GD library bundled (2.0.34 compatible)
Mime type detection File Extension
MimeDetect is using the browser supplied filename for file extension lookups. It is strongly recommended that you install and configure the PHP Fileinfo Extension or the UNIX 'file' command to provide more accurate sever-side mime type detection.
Module and theme update status Out of date
There are updates available for one or more of your modules or themes. To ensure the proper functioning of your site, you should update as soon as possible. See the available updates page for more information.
MySQL database 5.1.34
PHP 5.2.14
PHP DOM Extension Enabled
PHP memory limit 128M
PHP register globals Disabled
Panels operating normally
Panels is operating normally - no out-of-date plugins or modules are forcing it into legacy mode
SimpleXML Enabled
SimpleXML Enabled
Text CAPTCHA API Key updated and server contacted
Unicode library PHP Mbstring Extension
Update notifications Enabled
Upload progress Not enabled
Your server is not capable of displaying file upload progress. File upload progress requires PHP 5.2 and an Apache server.
Web server Microsoft-IIS/6.0
XML sitemap Last generated on 08/18/2010 - 8:01pm (21 hours 12 min ago).
XML sitemap user Anonymous access to user profiles
In order to list user profile links in the sitemap, the anonymous user must have the access user profiles permission.
Zlib library Enabled
cURL Enabled
getID3() 1.7.9-20090308
jQuery UI 1.6

Prpl_Ppl_Etr’s picture

The problem, as I can see it, is that the function, super_cron_get_script_path(), is a little funky.
It contains the line:
return str_replace('supercron.module', '', realpath(__FILE__)).SUPERCRON_SCRIPT_NAME ;

...?????

I think maybe this is what was intended:
return str_replace('supercron.module', SUPERCRON_SCRIPT_NAME, realpath(__FILE__)) ;
or, to be more "Drupally" about it...
return drupal_get_path('module','supercron').'/'.SUPERCRON_SCRIPT_NAME;

Also, with regard to that warning message...

There were two places with the following similar code:
(from supercron.admin.inc _supercron_check_requirements())

              array(
          '!script' => SUPERCRON_SCRIPT_NAME,
          '!here'   => supercron_base_path() . drupal_get_path('module', 'supercron'),
          '!path'   => supercron_base_path()
        )

...and...

(from supercron.admin.inc supercron_settings(&$form_state))

                    $message = t($message, array(
        '!script' => SUPERCRON_SCRIPT_NAME,
        '!here'   => supercron_base_path() . drupal_get_path('module', 'supercron'),
        '!path'   => supercron_base_path()
      )

Both of these use supercron_base_path() which I believe to be in error as well:
return str_replace('/index.php', '', $_SERVER['SCRIPT_FILENAME']) . $base_path;
...???? Why add $base_path to the end of the string?

...and doesn't $base_path give us what we're after anyway?

so, why not just this instead:
return $base_path;
???

I made all of the above changes to my local version (I have no experience creating/posting patches, sorry) and I got rid of the mentioned errors.

joelbox-mondial-it’s picture

Hi in which file is that?

damienmckenna’s picture

Is this related to having 40,000 calls to "supercron/run-autocron-[unique id]" in my "page not found" watchdog list after half an hour? :p

Sam Straub’s picture

Just wanted to add that #10 worked for me as well. Thank you!

I'll add for #11 that the function is "supercron_get_script_path()" in supercron-main.inc.

pillarsdotnet’s picture

Status: Needs work » Needs review
StatusFileSize
new3.37 KB

Patch, based on #10 but using realpath() for user-visible output.

cor3huis’s picture

Title: path to supercron.php » Path to supercron.php incorrectly determined by the module code
Priority: Normal » Critical

Changed Priority, without the fixes the module just does not work... which is a shame since it is a Great module! All it just really needs is some TLC then all will be fine for it's future...

IMHO do not be afraid to just release a Beta at current state with fixes. The more Drupal enthusiasts will start using the module. Then discovering the power and usefulness and more issue filed and can be solved. Is that not what a beta is for?

Release often, release early, hmmm I heard that before...

pillarsdotnet’s picture

StatusFileSize
new10.37 KB

Combined patch for this and other critical issues.

cor3huis’s picture

WOW, that's fast! abig thank you! Will combine patch and test after my other tasks are done. I will also not available for a week o two maybe.

So to all other using SuperCron, get ya patch and start testing, and you highly likely will have a well working SuperCron. Let your Drupal installs benefit from pillarsdotnet good work ;)

cor3huis’s picture

Well since I would see if patched worked very urgently, I tried against D6 v2.x-dev

$ patch -b

gave

patching file supercron-main.inc
patching file supercron.admin.inc
patching file supercron.admin.rule.inc
patching file supercron.classes.inc
patching file supercron.crontab-admin.inc
patching file supercron.drush.inc
patching file supercron.info
Hunk #1 FAILED at 4.
1 out of 1 hunk FAILED -- saving rejects to file supercron.info.rej
--- supercron.info
+++ supercron.info
@@ -4,3 +4,4 @@
 core = 6.x
 version = 6.x-1.4-alpha
 php = 5.0
+depends[] = dblog

Should it be tested against v1.4?

cor3huis’s picture

Well since I would see if patched worked very urgently, I tried against D6 v2.x-dev

$ patch -b <supercron.combined.patch

gave

patching file supercron-main.inc
patching file supercron.admin.inc
patching file supercron.admin.rule.inc
patching file supercron.classes.inc
patching file supercron.crontab-admin.inc
patching file supercron.drush.inc
patching file supercron.info
Hunk #1 FAILED at 4.
1 out of 1 hunk FAILED -- saving rejects to file supercron.info.rej
--- supercron.info
+++ supercron.info
@@ -4,3 +4,4 @@
 core = 6.x
 version = 6.x-1.4-alpha
 php = 5.0
+depends[] = dblog

Should it be tested against v1.4?

cor3huis’s picture

Ah, possible reason:

$ cat supercron.info

gives

; $Id: supercron.info,v 1.2 2010/03/18 22:57:45 63reasons Exp $
name = SuperCron
description = Get absolute control over Cron tasks
core = 6.x
version = 6.x-1.4-alpha
php = 5.0

; Information added by drupal.org packaging script on 2010-07-11
version = "6.x-2.x-dev"
core = "6.x"
project = "supercron"
datestamp = "1278835830"
cor3huis’s picture

Some things changed for the better with settings form, however still investigating path issue. It still is not get correct. The doubles are gone but the advised path to supercron.php is wrong. Will investigate more...needs some serious investigation how it all actually should work.

pillarsdotnet’s picture

All my patches are against a checkout from git.drupalcode.org/project/supercron.git (6.x-2.x branch). This should be the same as a CVS checkout but *NOT* the same as a release.

pillarsdotnet’s picture

Abandoned module?