core icon indicating copy to clipboard operation
core copied to clipboard

broken commands kill occ

Open butonic opened this issue 6 years ago • 6 comments

If an app ships with an incompatible command the occ command will be broken and unusable, eg:

An unhandled exception has been thrown:
ArgumentCountError: Too few arguments to function OCA\User_LDAP\Command\Search::__construct(), 0 passed in /var/www/owncloud/lib/private/Console/Application.php on line 170 and exactly 3 expected in /var/www/owncloud/apps/user_ldap/lib/Command/Search.php:50
Stack trace:
#0 /var/www/owncloud/lib/private/Console/Application.php(170): OCA\User_LDAP\Command\Search->__construct()
#1 /var/www/owncloud/lib/private/Console/Application.php(108): OC\Console\Application->loadCommandsFromInfoXml(Array)
#2 /var/www/owncloud/console.php(105): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')
#4 {main}

https://github.com/owncloud/core/blob/3bff5c2aca12499972f285e0cf2ea467a473c6b5/lib/private/Console/Application.php#L164-L178

  • [ ] add ILogger to DI,
  • [ ] log an error
  • [ ] skip to the next command
  • [ ] add tests ... currently not covered AFAICT

butonic avatar Dec 14 '18 13:12 butonic

GitMate.io thinks possibly related issues are https://github.com/owncloud/core/issues/13402 (... broken), https://github.com/owncloud/core/issues/24494 (occ command to clear all locks), https://github.com/owncloud/core/issues/13976 (Kill OC_Request), https://github.com/owncloud/core/issues/25964 (occ-.htaccess generation breaks .htaccess), and https://github.com/owncloud/core/pull/30177 (Kill occ command maintenance:createjs).

ownclouders avatar Dec 14 '18 13:12 ownclouders

i want to work on this could you briefly define exactly what i have to do in this issue

Kanishksgithub avatar Nov 16 '23 08:11 Kanishksgithub

i want to work on this could you briefly define exactly what i have to do in this issue

instead of throwing the exception write a log statement - this way the loop will finish and all other commands are available ....

DeepDiver1975 avatar Nov 16 '23 09:11 DeepDiver1975

could you assign me i want to work on this issue

Kanishksgithub avatar Nov 16 '23 09:11 Kanishksgithub

i want to fix this bug

Kanishksgithub avatar Nov 16 '23 09:11 Kanishksgithub

could you assign me i want to work on this issue

Just go for it an submit your pull request. THX a lot! :pray:

DeepDiver1975 avatar Nov 16 '23 09:11 DeepDiver1975