The drush command 'colorbox-plugin' could not be found error is displayed when issuing the command in sites directory.

Comments

frjo’s picture

Category: bug » support

Did you activate the Colorbox module first?

drush en colorbox -y
drush colorbox-plugin
wizonesolutions’s picture

I did, and I am still getting the error. Have a look:

Do you really want to continue? (y/n): y
WD actions: One orphaned action (comment_unpublish_action) exists in [warning]
the actions table. Remove orphaned actions
colorbox was enabled successfully.                                   [ok]

...

drush colorbox-plugin
You need to download the Colorbox plugin and extract the entire contents of the       [error]
archive into the sites/all/libraries/colorbox folder of your server.
wizonesolutions’s picture

Category: support » bug

This happened on 6.x-1.0 for me, but I'm guessing the Drush code is the same.

frjo’s picture

What version of Drush?

I'm using 4.4 and just tested "drush colorbox-plugin" and it ran without a problem on both D6 and D7.

finex’s picture

I confirm the error using drush 4.4 with colorbox 7.x-1.0 and 7.x-1.x-dev

frjo’s picture

Please run it in debug mode and paste in the messages here.

drush --debug colorbox-plugin
finex’s picture

Hi, this is the result:

$ drush --debug colorbox-plugin
Bootstrap to phase 0. [0.01 sec, 2.7 MB]                             [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.01 sec, 2.92 MB] [bootstrap]
Bootstrap to phase 5. [0.03 sec, 6.29 MB]                                              [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.03 sec, 6.29 MB]             [bootstrap]
Initialized Drupal 7.4 root directory at /var/www/testsite [0.04 sec, 7.81 MB]      [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.04 sec, 7.82 MB]             [bootstrap]
Initialized Drupal site default at sites/default [0.04 sec, 7.82 MB]                      [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.04 sec, 7.82 MB]    [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.05 sec, 7.84 MB]         [bootstrap]
Successfully connected to the Drupal database. [0.05 sec, 7.84 MB]                     [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.05 sec, 8.63 MB]             [bootstrap]
You need to download the Colorbox plugin and extract the entire contents of the archive[error]
into the sites/all/libraries/colorbox folder of your server. [0.31 sec, 45.39 MB]
The drush command 'colorbox-plugin' could not be found. [0.33 sec, 45.87 MB]           [error]

P.S: If the colorbox plugin is already available in /sites/all/libraries, the command replace the existing plugin.

frjo’s picture

Status: Active » Needs review
StatusFileSize
new966 bytes
new964 bytes

You are absolutely right, bad testing by me. I had a previous version and only tested re-downloading the library.

When I remove the library first I get the same result as you do. This is a bad bug!

I have committed the two attached patches already to 6-dev and 7-dev (it takes some hours for dev tarballs to rebuild). They are quickfixes to get the drush command working again. Please try them out and report back here how it works for you.

The bug was that the Colorbox module displays a message when it loads if the plugin is missing. This broke the Drush command. The patches removes the message but best would be to disable it when PHP runs form the cli/drush. Will investigate that.

finex’s picture

Indeed, commenting out that else { ... } makes drush work. Anyway it looks that drush check to initialize ( _init() ) the module before calling the function, but _init() calls colorbox_get_js() which returns FALSE.

frjo’s picture

Version: 7.x-1.0-beta4 » 7.x-1.x-dev
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

kallekwd’s picture

Maybe this is drush issue, but cannot get this to work with D6.22 and drush 7.x-4.5.

sites/all/modules/colorbox$ drush --debug colorbox-plugin
Bootstrap to phase 0. [0.03 sec, 1.44 MB]                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.04 sec, 1.58 MB] [bootstrap]
Bootstrap to phase 5. [0.11 sec, 3.8 MB]                               [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.11 sec, 3.8 MB] [bootstrap]
Initialized Drupal 6.22 root directory at /var/www/testsite [0.12 sec, 4.37 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.13 sec, 4.37 MB] [bootstrap]
Initialized Drupal site default at sites/default [0.13 sec, 4.38 MB]   [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.16 sec, 4.38 MB]  [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.16 sec, 4.41 MB] [bootstrap]
Successfully connected to the Drupal database. [0.16 sec, 4.41 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.18 sec, 4.65 MB]  [bootstrap]
The drush command 'colorbox-plugin' could not be found. [1.3 sec, 26.16 MB] [error]
hutch’s picture

Not sure if this is relevant, but I recently found that I had to put the drush directory in my $PATH, not just a symlink to the exec.
Once I did that it found the colorbox plugin straightaway.

tatewaky’s picture

what do you mean in my $PATH, the drupal path directory?

hutch’s picture

By $PATH I mean your shell environment. Where that is defined depends on your shell setup but this might typically be .bashrc in your home directory.
To find out what that is (I'm assuming *nix here) type

echo $PATH

On the command line.
Let's assume you have drush in your home at /home/myname/drush
You could add the following line to your .bashrc

export PATH="/home/myname/drush":$PATH

Logout and Login again and run echo $PATH again and it should be prepended to the path and typing 'drush' should work anywhere.