extdn / installer-m2

Universal extension installer for Magento 2, see introductory blog post here
https://fooman.com/blog/introducing-the-extdn-installer-for-magento-2.html
MIT License
24 stars 0 forks source link

Undefined method exitWithError #7

Closed peterjaap closed 4 years ago

peterjaap commented 4 years ago
$ ./extdn_installer.phar install kiwicommerce/module-admin-activity
➜          
 ______      _   _____  _   _   _____           _        _ _           
|  ____|    | | |  __ \| \ | | |_   _|         | |      | | |          
| |__  __  _| |_| |  | |  \| |   | |  _ __  ___| |_ __ _| | | ___ _ __ 
|  __| \ \/ / __| |  | | . ` |   | | | '_ \/ __| __/ _` | | |/ _ \ '__|
| |____ >  <| |_| |__| | |\  |  _| |_| | | \__ \ || (_| | | |  __/ |   
|______/_/\_\__|_____/|_| \_| |_____|_| |_|___/\__\__,_|_|_|\___|_|   
➜  Running ExtDN Installer 
 [ExtDN\Task\CheckMagentoRoot] Checking that we are running in the correct folder.
 [ExtDN\Task\CheckMagentoRoot] [OK]
 [ExtDN\Task\CheckPermissions] Checking current user.
 [ExtDN\Task\CheckPermissions] [OK]
 [ExtDN\Task\CheckPermissions] Checking file ownership.
PHP Fatal error:  Uncaught Error: Call to undefined method ExtDN\Task\CheckPermissions::exitWithError() in phar:///data/clientname/magento2/extdn_installer.phar/src/Task/CheckPermissions.php:72
Stack trace:
#0 phar:///data/clientname/magento2/extdn_installer.phar/src/Task/CheckPermissions.php(17): ExtDN\Task\CheckPermissions->checkForSufficientPermissions()
#1 phar:///data/clientname/magento2/extdn_installer.phar/vendor/consolidation/robo/src/Collection/CollectionBuilder.php(590): ExtDN\Task\CheckPermissions->run()
#2 phar:///data/clientname/magento2/extdn_installer.phar/vendor/consolidation/robo/src/Collection/CollectionBuilder.php(574): Robo\Collection\CollectionBuilder->runTasks()
#3 phar:///data/clientname/magento2/extdn_installer.phar/src/Command/Installer.php(59): Robo\Collection\CollectionBuilder->run()
#4 [internal function]: ExtDN\Command\Installer->install('kiwicommerce/mo...', Array)
#5 phar:///data/clientname/magento2/extdn_installer.phar/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_us in phar:///data/clientname/magento2/extdn_installer.phar/src/Task/CheckPermissions.php on line 72

Fatal error: Uncaught Error: Call to undefined method ExtDN\Task\CheckPermissions::exitWithError() in phar:///data/clientname/magento2/extdn_installer.phar/src/Task/CheckPermissions.php on line 72

Error: Call to undefined method ExtDN\Task\CheckPermissions::exitWithError() in phar:///data/clientname/magento2/extdn_installer.phar/src/Task/CheckPermissions.php on line 72

Call Stack:
    0.0073     855808   1. {main}() /data/clientname/magento2/extdn_installer.phar:0
    0.0074     853528   2. require('phar:///data/clientname/magento2/extdn_installer.phar/bin/extdn_installer') /data/clientname/magento2/extdn_installer.phar:10
    0.0102    1254544   3. Robo\Runner->execute() phar:///data/clientname/magento2/extdn_installer.phar/bin/extdn_installer:32
    0.0153    2081576   4. Robo\Runner->run() phar:///data/clientname/magento2/extdn_installer.phar/vendor/consolidation/robo/src/Runner.php:155
    0.0345    4440856   5. Robo\Application->run() phar:///data/clientname/magento2/extdn_installer.phar/vendor/consolidation/robo/src/Runner.php:233

ERROR: Uncaught Error: Call to undefined method ExtDN\Task\CheckPermissions::exitWithError() in phar:///data/clientname/magento2/extdn_installer.phar/src/Task/CheckPermissions.php:72
Stack trace:
#0 phar:///data/clientname/magento2/extdn_installer.phar/src/Task/CheckPermissions.php(17): ExtDN\Task\CheckPermissions->checkForSufficientPermissions()
#1 phar:///data/clientname/magento2/extdn_installer.phar/vendor/consolidation/robo/src/Collection/CollectionBuilder.php(590): ExtDN\Task\CheckPermissions->run()
#2 phar:///data/clientname/magento2/extdn_installer.phar/vendor/consolidation/robo/src/Collection/CollectionBuilder.php(574): Robo\Collection\CollectionBuilder->runTasks()
#3 phar:///data/clientname/magento2/extdn_installer.phar/src/Command/Installer.php(59): Robo\Collection\CollectionBuilder->run()
#4 [internal function]: ExtDN\Command\Installer->install('kiwicommerce/mo...', Array)
#5 phar:///data/clientname/magento2/extdn_installer.phar/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_us 
in phar:///data/clientname/magento2/extdn_installer.phar/src/Task/CheckPermissions.php:72
fooman commented 4 years ago

hey @peterjaap thanks for checking this out.

The latest commit https://github.com/extdn/installer-m2/commit/fe6515e7b8684a5553a94284465e81f4d675c224 should take care of what I missed in a refactor.

If you could confirm that there is indeed a permission issue to start with that be great. We use find . ! -writable -not -path "*.git/objects/pack*" to find files not writable by the current user.

peterjaap commented 4 years ago

That is indeed the case;

➜                                                                                                                                                                                                                                                                                           
 ______      _   _____  _   _   _____           _        _ _                                                                                                                                                                                                                                
|  ____|    | | |  __ \| \ | | |_   _|         | |      | | |                                                                                                                                                                                                                               
| |__  __  _| |_| |  | |  \| |   | |  _ __  ___| |_ __ _| | | ___ _ __                                                                                                                                                                                                                      
|  __| \ \/ / __| |  | | . ` |   | | | '_ \/ __| __/ _` | | |/ _ \ '__|                                                                                                                                                                                                                     
| |____ >  <| |_| |__| | |\  |  _| |_| | | \__ \ || (_| | | |  __/ |                                                                                                                                                                                                                        
|______/_/\_\__|_____/|_| \_| |_____|_| |_|___/\__\__,_|_|_|\___|_|                                                                                                                                                                                                                         
➜  Running ExtDN Installer                                                                                                                                                                                                                                                                  
 [ExtDN\Task\CheckMagentoRoot] Checking that we are running in the correct folder.                                                                                                                                                                                                          
 [ExtDN\Task\CheckMagentoRoot] [OK]                                                                                                                                                                                                                                                         
 [ExtDN\Task\CheckPermissions] Checking current user.                                                                                                                                                                                                                                       
 [ExtDN\Task\CheckPermissions] [OK]                                                                                                                                                                                                                                                         
 [ExtDN\Task\CheckPermissions] Checking file ownership.                                                                                                                                                                                                                                     
 [ExtDN\Task\CheckPermissions]  The following files are not writable for the current user                                                                                                                                                                                                   
./.git/objects/55/f966853b0a2d2d5d7eed19d29c0cfb76d6ff73                                                                                                                                                                                                                                    
./.git/objects/2e/8cdeca624d145925aa7c252033a247853ab0f5                                                                                                                                                                                                                                    
./.git/objects/6e/f1a687e1f46a73a80b4949b9aacdcaf55e267b                                                                                                                                                                                                                                    
./.git/objects/6e/22da6db28b33de1d3a44a939fc099b5789d340                                                                                                                                                                                                                                    
./.git/objects/cd/48ce00207933bf985c1cfa63bb85c95f4571be                                                                                                                                                                                                                                    
./.git/objects/e9/4ccb0fcc89a3e3ba047e88ecf94c71d886b6ca                                                                                                                                                                                                                                    
./.git/objects/e6/f7129f5f79380b75d99fca6f0a8714fa657340
etc

However, these are owned by the user I'm running the command with;

sh -ic "$(curl -sS https://raw.githubusercontent.com/extdn/installer-m2/v1.0.0-beta4/bin/oneliner.sh)" -- install kiwicommerce/module-admin-activity

We are using Docker as our development environment, so the command is run through PHP, which runs in a Docker container. I haven't really had any issues with that before, permissions-wise, so I'm not sure why that happens now?

fooman commented 4 years ago

@peterjaap thanks for that. Do you mind running this command? find . ! -writable -not -path "*.git/objects/pack*" and this find . ! -writable -not -path "*.git/objects/*"

I currently do not think this is a docker issue but git for some reason seems to produce files which are owned by the user but not writable. I so far had them excluded with the first query but it looks these type of files can be in different paths.

If the second query works (ie no files show up) - I will push out a new version with this amendment.

peterjaap commented 4 years ago

@fooman first command returns 63 items, second command zero.

fooman commented 4 years ago

Thanks for confirming - changed in beta5