Due to issues where my cron.php was timing out when accessed via the web, I've been running cron via drush. Works great, except for one thing: I'm seeing a huge number of warnings from the filefield module (25 on each cron run). When run via the web, cron throws none of these warnings.

My drush command:

/usr/bin/drush --root=/var/www/example/html --uri=http://example.com cron

The warning:

FileField was trying to display the file sites/default/files/articles/70dd29aabc2ff44ffec36428b75be54e.jpg, but it does not exist.

Comments

moshe weitzman’s picture

Status: Active » Postponed (maintainer needs more info)

try passing --url option so you better emulate what web does. after that, ask in fielfield queue.

ceejayoz’s picture

Component: Code » PM (dl, en, up ...)
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

This seems to have stopped happening. Guessing it was a glitch in filefield.

jenlampton’s picture

Title: drush cron throws filefield errors, web cron does not » drush cron throws numerous errors, web cron does not
Version: All-Versions-2.1 » All-versions-4.x-dev
Status: Closed (cannot reproduce) » Active

I'm running into this same problem.

When Drush is run via the web interface I get no errors at all, and a happy little "Cron ran successfully." drupal message, and "Cron run completed" in the dblog.

When I run drush cron I get about 15 errors reporting missing files (which are all there on the file system) and a sad "Cron run exceeded the time limit and was aborted." error message.

I tried running drush cron --url, and got the same errors, below

WD php: Notice: Undefined property: stdClass::$build_mode in paging_nodeapi() (line 412 of                                                [error]
.../sites/all/modules/contrib/paging/paging.module).
WD php: Warning: include_once(./sites/all/modules/contrib/ad/ad.module): failed to open stream: No such file or directory in theme() (line[error]
644 of .../includes/theme.inc).
WD php: Warning: include_once(): Failed opening './sites/all/modules/contrib/ad/ad.module' for inclusion                                  [error]
(include_path='.:/usr/share/php:/usr/share/pear') in theme() (line 644 of .../includes/theme.inc).
WD php: Warning: require_once(./sites/all/modules/contrib/date/date_api_elements.inc): failed to open stream: No such file or directory in[error]
date_api_elements() (line 1787 of .../sites/all/modules/contrib/date/date_api.module).
Drush command terminated abnormally due to an unrecoverable error.                                                                        [error]
Error: require_once(): Failed opening required './sites/all/modules/contrib/date/date_api_elements.inc'
(include_path='.:/usr/share/php:/usr/share/pear') in .../sites/all/modules/contrib/date/date_api.module, line 1787
WD cron: Cron run exceeded the time limit and was aborted.   

Drupal version: Pressflow 6.23-0-gf5c736a
Hosting: pantheon v1
Drush version 4.4

greg.1.anderson’s picture

Version: All-versions-4.x-dev »

Let's verify and fix on Drush-5 first, if necessary, then go back and consider Drush-4.

moshe weitzman’s picture

Status: Active » Postponed (maintainer needs more info)

@Jen - please try to reproduce with drush5 and get back to us. Also be sure you are passing --uri.

christianchristensen’s picture

Curious behavior... slightly different than @Jen, but seems to follow the same behavior of failing with `drush cron` but then "Cron run completed." with `curl http://localhost/cron.php`

drush version 5.0-dev
Drupal: Pressflow: 6.24

CLI interaction:

Indexing node 51728.                                                                                       [ok]
Indexing node 51738.                                                                                       [ok]
WD filefield: FileField was trying to display the file                                                     [warning]
sites/default/files/group_content_logo/n7957074_41873447_7239.jpg, but it does not exist.
Indexing node 51748.                                                                                       [ok]
...
Indexing node 51838.                                                                                       [ok]
WD image: Derivative images were regenerated for Ned and Sandra.                                                [info]
Drush command terminated abnormally due to an unrecoverable error.                                         [error]
WD cron: Cron run exceeded the time limit and was aborted.                                                 [warning]
...
$ drush --uri=http://localhost cron -v
Initialized Drupal 6.24 root directory at                                                                     [notice]
/srv/..../www
Initialized Drupal site default at sites/default                                                              [notice]
WD cron: Attempting to re-run cron while it is already running.                                            [warning]
Cron run failed.                                                                                           [error]
Command dispatch complete                                                                                     [notice]
....
$ drush eval "variable_del('cron_semaphore');"
$ drush --uri=http://localhost cron -v
Initialized Drupal 6.24 root directory at                                                                     [notice]
/srv/..../www
Initialized Drupal site default at sites/default                                                              [notice]
Drush command terminated abnormally due to an unrecoverable error.                                         [error]
WD cron: Cron run exceeded the time limit and was aborted.                                                 [warning]
....
$ curl http://localhost/cron.php
# syslog: "Cron run completed."
....
$ drush --uri=http://localhost cron -v
Initialized Drupal 6.24 root directory at                                                                     [notice]
/srv/..../www
Initialized Drupal site default at sites/default                                                              [notice]
Indexing node 52848.                                                                                       [ok]
Indexing node 52858.                                                                                       [ok]

(edit: forgot to include that the drush commands do the same with "--uri")

greg.1.anderson’s picture

Version: » 8.x-6.x-dev
Status: Postponed (maintainer needs more info) » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to closed (duplicate).

Please ask support questions on Drupal Answers.