{"action":"created","issue":{"url":"https://api.github.com/repos/wp-cli/wp-cli/issues/2315","labels_url":"https://api.github.com/repos/wp-cli/wp-cli/issues/2315/labels{/name}","comments_url":"https://api.github.com/repos/wp-cli/wp-cli/issues/2315/comments","events_url":"https://api.github.com/repos/wp-cli/wp-cli/issues/2315/events","html_url":"https://github.com/wp-cli/wp-cli/issues/2315","id":123283212,"number":2315,"title":"wp-cli-0.21.1 slight plugin install diagnostic bug related to permission checking","user":{"login":"davidfavor","id":87222,"avatar_url":"https://avatars.githubusercontent.com/u/87222?v=3","gravatar_id":"","url":"https://api.github.com/users/davidfavor","html_url":"https://github.com/davidfavor","followers_url":"https://api.github.com/users/davidfavor/followers","following_url":"https://api.github.com/users/davidfavor/following{/other_user}","gists_url":"https://api.github.com/users/davidfavor/gists{/gist_id}","starred_url":"https://api.github.com/users/davidfavor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidfavor/subscriptions","organizations_url":"https://api.github.com/users/davidfavor/orgs","repos_url":"https://api.github.com/users/davidfavor/repos","events_url":"https://api.github.com/users/davidfavor/events{/privacy}","received_events_url":"https://api.github.com/users/davidfavor/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-21T13:53:04Z","updated_at":"2015-12-23T16:06:39Z","closed_at":"2015-12-21T15:43:41Z","body":"Summary - wp install --activate - reports both failure + success + actually does succeed. Diagnostic message is incorrect.\r\n\r\nDetails...\r\n\r\nnet4-dev# wp-cli.phar --allow-root --info\r\nPHP binary:\t/usr/bin/php5\r\nPHP version:\t5.6.11-1ubuntu3.1\r\nphp.ini used:\t/etc/php5/cli/php.ini\r\nWP-CLI root dir:\tphar://wp-cli.phar\r\nWP-CLI global config:\t\r\nWP-CLI project config:\t\r\nWP-CLI version:\t0.21.1\r\n\r\nTo reproduce...\r\n\r\ncd .../wordpress\r\n\r\nnet4-dev# wp core version\r\n4.4\r\n\r\nnet4-dev# ls wp-content/plugins\r\nindex.php\r\n\r\n### Install --activate plugin reports as both failure + success.\r\n\r\nnet4-dev# /bin/ls -hFqld --group-directories-first --color .\r\ndrwxr-x--- 5 www-data www-data 4.0K Dec 20 17:16 ./\r\n\r\nnet4-dev# sudo -u www-data $(which wp-cli.phar) plugin install wp-fail2ban --activate\r\nInstalling WP fail2ban (2.3.1)\r\nPHP Warning:  mkdir(): Permission denied in phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/FileCache.php on line 265\r\nPHP Stack trace:\r\nPHP   1. {main}() /david-favor/tools/wp-cli.phar:0\r\nPHP   2. include() /david-favor/tools/wp-cli.phar:4\r\nPHP   3. include() phar:///david-favor/tools/wp-cli.phar/php/boot-phar.php:5\r\nPHP   4. WP_CLI\\Runner->start() phar:///david-favor/tools/wp-cli.phar/php/wp-cli.php:21\r\nPHP   5. WP_CLI\\Runner->_run_command() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Runner.php:699\r\nPHP   6. WP_CLI\\Runner->run_command() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Runner.php:318\r\nPHP   7. WP_CLI\\Dispatcher\\Subcommand->invoke() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Runner.php:311\r\nPHP   8. call_user_func:{phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Dispatcher/Subcommand.php:295}() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Dispatcher/Subcommand.php:295\r\nPHP   9. WP_CLI\\Dispatcher\\CommandFactory::WP_CLI\\Dispatcher\\{closure}() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Dispatcher/Subcommand.php:295\r\nPHP  10. call_user_func:{phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Dispatcher/CommandFactory.php:52}() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Dispatcher/CommandFactory.php:52\r\nPHP  11. Plugin_Command->install() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Dispatcher/CommandFactory.php:52\r\nPHP  12. WP_CLI\\CommandWithUpgrade->install() phar:///david-favor/tools/wp-cli.phar/php/commands/plugin.php:447\r\nPHP  13. Plugin_Command->install_from_repo() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/CommandWithUpgrade.php:145\r\nPHP  14. WP_CLI::get_http_cache_manager() phar:///david-favor/tools/wp-cli.phar/php/commands/plugin.php:316\r\nPHP  15. WP_CLI::get_cache() phar:///david-favor/tools/wp-cli.phar/php/class-wp-cli.php:131\r\nPHP  16. WP_CLI\\FileCache->__construct() phar:///david-favor/tools/wp-cli.phar/php/class-wp-cli.php:79\r\nPHP  17. WP_CLI\\FileCache->ensure_dir_exists() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/FileCache.php:56\r\nPHP  18. mkdir() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/FileCache.php:265\r\nDownloading install package from https://downloads.wordpress.org/plugin/wp-fail2ban.2.3.2.zip...\r\nUnpacking the package...\r\nInstalling the plugin...\r\nPlugin installed successfully.\r\nSuccess: Translations updates are not needed for the 'English (US)' locale.\r\nActivating 'wp-fail2ban'...\r\nWarning: Plugin 'wp-fail2ban' is already active.\r\n\r\n### Plugin is in fact installed\r\n\r\nnet4-dev# ll wp-content/plugins\r\ntotal 8.0K\r\ndrwxr-xr-x 2 www-data www-data 4.0K Dec 21 07:39 wp-fail2ban/\r\n-rw-r--r-- 1 www-data www-data   28 Dec 20 17:16 index.php\r\n\r\n### Plugin delete works fine\r\n\r\nnet4-dev# sudo -u www-data $(which wp-cli.phar) plugin delete wp-fail2ban\r\nSuccess: Deleted 'wp-fail2ban' plugin.\r\n\r\n### Opening all permissions still produces same output\r\n\r\nnet4-dev# chmod 777 .\r\nnet4-dev# sudo -u www-data $(which wp-cli.phar) plugin install wp-fail2ban --activate\r\nInstalling WP fail2ban (2.3.1)\r\nPHP Warning:  mkdir(): Permission denied in phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/FileCache.php on line 265\r\nPHP Stack trace:\r\nPHP   1. {main}() /david-favor/tools/wp-cli.phar:0\r\nPHP   2. include() /david-favor/tools/wp-cli.phar:4\r\nPHP   3. include() phar:///david-favor/tools/wp-cli.phar/php/boot-phar.php:5\r\nPHP   4. WP_CLI\\Runner->start() phar:///david-favor/tools/wp-cli.phar/php/wp-cli.php:21\r\nPHP   5. WP_CLI\\Runner->_run_command() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Runner.php:699\r\nPHP   6. WP_CLI\\Runner->run_command() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Runner.php:318\r\nPHP   7. WP_CLI\\Dispatcher\\Subcommand->invoke() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Runner.php:311\r\nPHP   8. call_user_func:{phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Dispatcher/Subcommand.php:295}() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Dispatcher/Subcommand.php:295\r\nPHP   9. WP_CLI\\Dispatcher\\CommandFactory::WP_CLI\\Dispatcher\\{closure}() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Dispatcher/Subcommand.php:295\r\nPHP  10. call_user_func:{phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Dispatcher/CommandFactory.php:52}() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Dispatcher/CommandFactory.php:52\r\nPHP  11. Plugin_Command->install() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/Dispatcher/CommandFactory.php:52\r\nPHP  12. WP_CLI\\CommandWithUpgrade->install() phar:///david-favor/tools/wp-cli.phar/php/commands/plugin.php:447\r\nPHP  13. Plugin_Command->install_from_repo() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/CommandWithUpgrade.php:145\r\nPHP  14. WP_CLI::get_http_cache_manager() phar:///david-favor/tools/wp-cli.phar/php/commands/plugin.php:316\r\nPHP  15. WP_CLI::get_cache() phar:///david-favor/tools/wp-cli.phar/php/class-wp-cli.php:131\r\nPHP  16. WP_CLI\\FileCache->__construct() phar:///david-favor/tools/wp-cli.phar/php/class-wp-cli.php:79\r\nPHP  17. WP_CLI\\FileCache->ensure_dir_exists() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/FileCache.php:56\r\nPHP  18. mkdir() phar:///david-favor/tools/wp-cli.phar/php/WP_CLI/FileCache.php:265\r\nDownloading install package from https://downloads.wordpress.org/plugin/wp-fail2ban.2.3.2.zip...\r\nUnpacking the package...\r\nInstalling the plugin...\r\nPlugin installed successfully.\r\nSuccess: Translations updates are not needed for the 'English (US)' locale.\r\nActivating 'wp-fail2ban'...\r\nWarning: Plugin 'wp-fail2ban' is already active.\r\n\r\n### root user works, apache user fails, likely a WP-4.4 issue\r\n\r\nnet4-dev# chmod 750 .\r\nnet4-dev# sudo -u www-data $(which wp-cli.phar) plugin delete wp-fail2ban \r\nSuccess: Deleted 'wp-fail2ban' plugin.\r\nnet4-dev# wp plugin install wp-fail2ban --activate\r\nInstalling WP fail2ban (2.3.1)\r\nDownloading install package from https://downloads.wordpress.org/plugin/wp-fail2ban.2.3.2.zip...\r\nUnpacking the package...\r\nInstalling the plugin...\r\nPlugin installed successfully.\r\nSuccess: Translations updates are not needed for the 'English (US)' locale.\r\nActivating 'wp-fail2ban'...\r\nWarning: Plugin 'wp-fail2ban' is already active.\r\nnet4-dev# chown -hR www-data:www-data wp-content/plugins"},"comment":{"url":"https://api.github.com/repos/wp-cli/wp-cli/issues/comments/166932457","html_url":"https://github.com/wp-cli/wp-cli/issues/2315#issuecomment-166932457","issue_url":"https://api.github.com/repos/wp-cli/wp-cli/issues/2315","id":166932457,"user":{"login":"danielbachhuber","id":36432,"avatar_url":"https://avatars.githubusercontent.com/u/36432?v=3","gravatar_id":"","url":"https://api.github.com/users/danielbachhuber","html_url":"https://github.com/danielbachhuber","followers_url":"https://api.github.com/users/danielbachhuber/followers","following_url":"https://api.github.com/users/danielbachhuber/following{/other_user}","gists_url":"https://api.github.com/users/danielbachhuber/gists{/gist_id}","starred_url":"https://api.github.com/users/danielbachhuber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielbachhuber/subscriptions","organizations_url":"https://api.github.com/users/danielbachhuber/orgs","repos_url":"https://api.github.com/users/danielbachhuber/repos","events_url":"https://api.github.com/users/danielbachhuber/events{/privacy}","received_events_url":"https://api.github.com/users/danielbachhuber/received_events","type":"User","site_admin":false},"created_at":"2015-12-23T16:06:39Z","updated_at":"2015-12-23T16:06:39Z","body":"I can't reproduce:\r\n\r\n```\r\nsalty-wordpress ➜  wordpress-test.dev  wp plugin install wp-fail2ban --activate\r\nInstalling WP fail2ban (2.3.1)\r\nDownloading install package from https://downloads.wordpress.org/plugin/wp-fail2ban.2.3.2.zip...\r\nUnpacking the package...\r\nInstalling the plugin...\r\nPlugin installed successfully.\r\nSuccess: Translations updates are not needed for the 'English (US)' locale.\r\nActivating 'wp-fail2ban'...\r\nSuccess: Plugin 'wp-fail2ban' activated.\r\n```\r\n\r\nRegarding:\r\n\r\n> This behavior occurs first time a plugin is installed, so appears to have no relation to left over plugin residue from an uninstall.\r\n\r\nThis is with a brand new WordPress install? Can you reproduce with a second brand new WordPress install in a separate environment?"}}