Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apps can't/aren't removed by occ if appstoreenabled => false #27074

Closed
solracsf opened this issue May 22, 2021 · 2 comments · Fixed by #27088
Closed

Apps can't/aren't removed by occ if appstoreenabled => false #27074

solracsf opened this issue May 22, 2021 · 2 comments · Fixed by #27088
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: occ

Comments

@solracsf
Copy link
Member

solracsf commented May 22, 2021

  1. Set 'appstoreenabled' => false,
  2. issue app:remove <appname>
  3. It outputs it is removed, but it is not, and command can be run on a loop, ex.:
$ php occ app:remove ransomware_protection
ransomware_protection disabled
ransomware_protection 1.10.1 removed

$ php occ app:remove ransomware_protection
ransomware_protection disabled
ransomware_protection 1.10.1 removed

$ php occ app:remove ransomware_protection
ransomware_protection disabled
ransomware_protection 1.10.1 removed
...
  1. Set 'appstoreenabled' => true,
  2. issue app:remove <appname>
  3. App is removed
$ php occ app:remove ransomware_protection
ransomware_protection disabled
ransomware_protection 0 removed

$ php occ app:remove ransomware_protection
ransomware_protection is not installed

While this is the right behaviour to install apps, it should be allowed to remove them even if 'appstoreenabled' => false,

@solracsf solracsf added bug 0. Needs triage Pending check for reproducibility or if it fits our roadmap feature: occ labels May 22, 2021
@gary-kim
Copy link
Member

This may be the issue. Removing an app relies on OC_App::getInstallPath() which returns false if 'appstoreenabled' => false.

$appDir = OC_App::getInstallPath() . '/' . $appId;

public static function getInstallPath() {
if (\OC::$server->getSystemConfig()->getValue('appstoreenabled', true) == false) {
return false;
}
foreach (OC::$APPSROOTS as $dir) {
if (isset($dir['writable']) && $dir['writable'] === true) {
return $dir['path'];
}
}
\OCP\Util::writeLog('core', 'No application directories are marked as writable.', ILogger::ERROR);
return null;
}

@gary-kim
Copy link
Member

I'm working on it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: occ
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants