Hello there!

I'm trying to use drush on my small production site, so I'm ssh-ing into the server and trying to set up drush there, but I can't get any of the pm commands specifically to work.

Most of the other commands seem to work fine. Updatedb works, status modules works, even sql dump works.

However if, for example, I try to use `drush uninstall weather` it fails with this error message:

weather is not disabled. If active, use `disable` command before [error]
`uninstall`.
An error occurred at function : drush_pm_uninstall [error]

where, in this example case, the weather module was indeed disabled despite the error message reporting otherwise.

I have the drush Module Manager module installed into my drupal installation so I get all the 'mm' commands too (although it looks like you have rolled a number of the mm commands into core drush, and that the Module Manager module is going the way of the Dodo, is that true?)

I tried and failed to use 'php -a /path/to/drush/drush.php' to maybe step through the code and watch drush bootstrap to try to figure out why it's not finding the pm commands ... any suggestions for trying to debug the problem?

Comments

ccoletta’s picture

some other command line interactions to help us suss out what's going on:

$ drush pm install rotor
The command 'drush pm install rotor' could not be found.             [error]
$ drush help pm install
Invalid command pm install.                                          [error]
An error occurred at function : drush_core_help                      [error]

Here is the output when I type `drush help`

$ drush help
Execute a drush command. Run `drush help [command]` to view command-specific
help.

Examples:
  drush dl cck zen                     	Download CCK module and Zen theme.                 
  drush --uri=http://example.com status	Show status command for the example.com multi-site.
  drush help --pipe                    	A space delimited list of commands                 

Options:
  -r <path>, --root=<path>	Drupal root directory to use (default: current directory)            
  -l <uri> , --uri=<uri>  	URI of the drupal site to use (only needed in multisite environments)
  -v, --verbose           	Display extra information about the command.                         
  -d, --debug             	Display even more information, including internal messages.          
  -q, --quiet             	Hide all output                                                      
  -y, --yes               	Assume 'yes' as answer to all prompts                                
  -s, --simulate          	Simulate all relevant actions (don't actually change the system)     
  -i, --include           	A list of paths to search for drush commands                         
  -c, --config            	Specify a config file to use. See example.drushrc.php                
  -u, --user              	Specify a user to login with. May be a name or a number.             
  -b, --backend           	Hide all output and return structured data (internal use only).      
  -p, --pipe              	Emit a compact representation of the command for scripting.          

Commands: 
  test mail           	Run all tests and mail the results to your team.                                                  
  test clean          	Delete leftover tables and files from prior test runs.                                            
  sql conf            	Print database connection details.                                                                
  sql connect         	A string for connecting to the DB.                                                                
  sql dump            	Exports the Drupal DB as SQL using mysqldump.                                                     
  sql query           	Execute a query against the site database.                                                        
  sql load            	Copy source database to target database.                                                          
  sql cli             	Open a SQL command-line interface using Drupal’s credentials.                                   
  help                	Print this help message. Use --filter to limit command list to one command file (e.g. --filter=pm)
  cron                	Run all cron hooks.                                                                               
  updatedb            	Execute the update.php process from the command line                                              
  status              	Provides a birds-eye view of the current Drupal installation, if any.                             
  script              	Run php script(s).                                                                                
  cache clear         	Clear all caches.                                                                                 
  watchdog show       	Shows recent watchdog log messages. Optionally filter for a specific type.                        
  watchdog delete     	Delete all messages or only those of a specified type.                                            
  sync                	Rsync the Drupal tree to/from another server using ssh.                                           
  eval                	Evaluate arbitrary php code after bootstrapping Drupal.                                           
  enable              	Enable one or more modules.                                                                       
  disable             	Disable one or more modules.                                                                      
  uninstall           	Uninstall one or more modules.                                                                    
  statusmodules       	Show module enabled/disabled status                                                               
  refresh             	Refresh update status information                                                                 
  updatecode          	Update your project code                                                                          
  update              	Update your project code and apply any database updates required (update.php)                     
  info                	Release information for a project                                                                 
  dl                  	Download core Drupal and projects like CCK, Zen, etc.                                             
  mm list             	Lists the available modules.                                     
  mm enable           	Enables (and if necessary installs) the given modules and depend.
  mm disable          	Disable the given modules and reverse dependants.                
  mm uninstall        	Uninstalls the given modules and reverse dependants.             
  mm dot              	Generates a dot file of all modules.           
moshe weitzman’s picture

Status: Active » Fixed

you are using `pm enable` and such. the pm prefix has been dropped.

ccoletta’s picture

Status: Fixed » Active

No that unfortunately doesn't fix the problem. Here are some more command line interactions. How would I step through the php code to debug the problem? Is there a switch to turn on drush debug output?

$ drush enable rotor
Module rotor was not found and will not be enabled.                  [error]
There were no modules that could be enabled.                         [ok]
An error occurred at function : drush_pm_enable                      [error]

$ drush uninstall simplepie
The following modules will be uninstalled: simplepie
Do you really want to continue? (y/n): y
simplepie is not disabled. If active, use `disable` command before   [error]
`uninstall`.
An error occurred at function : drush_pm_uninstall                   [error]

$ drush disable simplepie
SimplePie Core is already disabled.                                  [warning]
There were no modules that could be disabled.                        [ok]
moshe weitzman’s picture

All the command line switches are documented in `drush help`. You want --debug.

CHEETAH’s picture

Hey, I'm having the same exact issue. I am unable to install modules, etc.
I am getting the same error messages as ccoletta...

Does anybody know what gives?

jonhattan’s picture

CHEETAH, colleta: what is the exact command you are using and the output given with --debug flag ?

You must use --root and --uri to indicate drush what drupal instance it must bootstrap. Alternatively you can go to the drupal dir and run drush from there without --root nor --uri:

cd /var/www/drupal/sites/example.com
drush dl pathauto                   # download
drush enable pathauto           # enable the module and it's dependencies. aditionally will prompt to download missing deps.
jonhattan’s picture

Status: Active » Postponed (maintainer needs more info)
OldAccount’s picture

Same issue, can't uninstall a module that's already disabled. I've tried "drush uninstall xml_sitemap" from root Drupal directory and still get the same drush_pm_uninstall error.

bbeyer’s picture

same issue, I am on version 2 and it tells me my module is not disabled when i try to uninstall but it tells me it is disabled when i try to disable it

greg.1.anderson’s picture

Presume working in drush-3.0. Please reopen with more information if needed.

greg.1.anderson’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)
capellic’s picture

Version: 6.x-2.0-alpha2 » All-versions-3.0-rc4
Status: Closed (fixed) » Active

I'm new to Drush. I have it installed and when I run "drush status", I get the expected result. I was able to download the google_analytics module from Drush, but I am not able to enable it:

google_analytics was not found and will not be enabled. [1.07 sec, 34.5 MB]              [error]
There were no projects that could be enabled. [1.07 sec, 34.5 MB]                        [ok]
An error occurred at function : drush_pm_enable [1.07 sec, 33.61 MB]                     [error]
owen barton’s picture

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

Perhaps you downloaded google_analytics somewhere where Drupal can't find it. Either way, we will need more detail to reproduce...

greg.1.anderson’s picture

This is a common one. The output of dl was enhanced in HEAD to make this more clear.

Project google_analytics (6.x-2.2) downloaded to /home/ga/google_analytics.
Project google_analytics contains a module named googleanalytics. 

So in other words, drush dl google_analytics, but drush en googleanalytics.

greg.1.anderson’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

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