You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We run Drupal cron with drush to catch errors. When the sentence "Cron run completed" is no in the output then we know it is an error
#!/bin/bash# Only print drush output when it does not contain "Cron run completed."# Usage: drush-cron9.sh /var/www/jobiqo-decoupled/backendcd"$1"||exit
DRUSH_OUTPUT=$(/usr/bin/drush cron -v 2>&1)
RETURN_CODE=$?# Check if the success message has a translation.# Use it as regex pattern for grep.
SUCCESS_MESSAGE=$(/usr/bin/drush ev 'print t("Cron run successful.") . "|Cron run completed.";')# If the success message is not in the output then we print all the output.# shellcheck disable=SC2086ifecho$DRUSH_OUTPUT| grep -vqE "$SUCCESS_MESSAGE";thenecho"$DRUSH_OUTPUT"fiexit$RETURN_CODE
This worked fine in Drush 11, but since the upgrade to Drush 12.5.2 the cron command does not always print all info log messages. Somehow Drush or the Drupal site can get into a state where all info log messages are not printed in Drush output. A drush cr fixes it and then the output is correct again with all info log messages.
A broken drush cron -v output look like this, note the missing info messages at the end:
[info] Drush bootstrap phase: bootstrapDrupalRoot()
[info] Change working directory to /var/www/example/site/backend/web
[info] Initialized Drupal 10.1.8 root directory at /var/www/example/site/backend/web
[info] Drush bootstrap phase: bootstrapDrupalSite()
[info] Initialized Drupal site example.com at sites/default
[info] Drush bootstrap phase: bootstrapDrupalConfiguration()
[info] Drush bootstrap phase: bootstrapDrupalDatabase()
[info] Successfully connected to the Drupal database.
[info] Drush bootstrap phase: bootstrapDrupalFull()
[info] Starting bootstrap to none
[info] Drush bootstrap phase 0
[info] Try to validate bootstrap phase 0
Correct would be:
[info] Drush bootstrap phase: bootstrapDrupalRoot()
[info] Change working directory to /var/www/example/site/backend/web
[info] Initialized Drupal 10.1.8 root directory at /var/www/example/site/backend/web
[info] Drush bootstrap phase: bootstrapDrupalSite()
[info] Initialized Drupal site example.com at sites/default
[info] Drush bootstrap phase: bootstrapDrupalConfiguration()
[info] Drush bootstrap phase: bootstrapDrupalDatabase()
[info] Successfully connected to the Drupal database.
[info] Drush bootstrap phase: bootstrapDrupalFull()
[info] Starting bootstrap to none
[info] Drush bootstrap phase 0
[info] Try to validate bootstrap phase 0
[info] Starting execution of commerce_cart_cron(), execution of example_mails_cron() took 14.49ms.
[info] Starting execution of dblog_cron(), execution of commerce_cart_cron() took 9.02ms.
...
[info] Execution of password_policy_cron() took 0.44ms.
[info] Cron run completed.
To Reproduce
Unclear yet, we don't know how Drush/Drupal gets into the state that info log output is missing.
Expected behavior
Info log output is always printed including "Cron run completed".
Actual behavior
Info log output is missing from drush cron output.
Workaround
?
System Configuration
Q
A
Drush version?
12.5.2
Drupal version?
10.1.8
PHP version
8.1
OS?
Linux
Additional information
The text was updated successfully, but these errors were encountered:
Describe the bug
We run Drupal cron with drush to catch errors. When the sentence "Cron run completed" is no in the output then we know it is an error
This worked fine in Drush 11, but since the upgrade to Drush 12.5.2 the cron command does not always print all info log messages. Somehow Drush or the Drupal site can get into a state where all info log messages are not printed in Drush output. A
drush cr
fixes it and then the output is correct again with all info log messages.A broken
drush cron -v
output look like this, note the missing info messages at the end:Correct would be:
To Reproduce
Unclear yet, we don't know how Drush/Drupal gets into the state that info log output is missing.
Expected behavior
Info log output is always printed including "Cron run completed".
Actual behavior
Info log output is missing from
drush cron
output.Workaround
?
System Configuration
Additional information
The text was updated successfully, but these errors were encountered: