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

[OCP\App\AppManagerException] when I run occ app:enable theme-* twice #31475

Closed
michaelstingl opened this issue May 18, 2018 · 10 comments · Fixed by #31771
Closed

[OCP\App\AppManagerException] when I run occ app:enable theme-* twice #31475

michaelstingl opened this issue May 18, 2018 · 10 comments · Fixed by #31771
Assignees
Milestone

Comments

@michaelstingl
Copy link

michaelstingl commented May 18, 2018

Environment variable OWNCLOUD_APPS_INSTALL doesn't work for themes with official Docker. /cc @tboerger

Steps to reproduce

  1. install oC 10.0.8
  2. run occ app:enable theme-example 2x

Expected behaviour

I shouldn't get a serious exception when I enable an app a 2nd time. Other apps doesn't have this problem:

root@399115d8d870: /var/www/owncloud # occ app:enable configreport
configreport enabled

root@399115d8d870: /var/www/owncloud # occ app:enable configreport
configreport enabled

Actual behaviour

root@399115d8d870: /var/www/owncloud # occ app:enable theme-example
theme-example enabled

root@399115d8d870: /var/www/owncloud # occ app:enable theme-example

  [OCP\App\AppManagerException]                                    
  theme-example can't be enabled until theme-example is disabled.  

app:enable [-g|--groups GROUPS] [--] <app-id>

root@468b1fb3f3ae: /var/www/owncloud # occ app:enable theme-example -vvv

In AppManager.php line 257:

  [OCP\App\AppManagerException]                                    
  theme-example can't be enabled until theme-example is disabled.  

Exception trace:
 OC\App\AppManager->canEnableTheme() at /var/www/owncloud/lib/private/App/AppManager.php:231
 OC\App\AppManager->enableApp() at /var/www/owncloud/lib/private/legacy/app.php:417
 OC_App::enable() at /var/www/owncloud/core/Command/App/Enable.php:75
 OC\Core\Command\App\Enable->execute() at /var/www/owncloud/lib/composer/symfony/console/Command/Command.php:252
 Symfony\Component\Console\Command\Command->run() at /var/www/owncloud/lib/composer/symfony/console/Application.php:946
 Symfony\Component\Console\Application->doRunCommand() at /var/www/owncloud/lib/composer/symfony/console/Application.php:248
 Symfony\Component\Console\Application->doRun() at /var/www/owncloud/lib/composer/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at /var/www/owncloud/lib/private/Console/Application.php:161
 OC\Console\Application->run() at /var/www/owncloud/console.php:106
 require_once() at /var/www/owncloud/occ:11

app:enable [-g|--groups GROUPS] [--] <app-id>

Server configuration

Operating system:
Ubuntu 16.0.4

Web server:
Apache/2.4.18

Database:
mysql Ver 14.14 Distrib 5.7.22

PHP version:
PHP 7.0.30

ownCloud version: (see ownCloud admin page)
10.0.8

Updated from an older ownCloud or fresh install:
fresh install

Where did you install ownCloud from:
official Docker

Signing status (ownCloud 9.0 and above):

No errors have been found.

The content of config/config.php:

root@468b1fb3f3ae: /var/www/owncloud # occ config:list system
{
    "system": {
        "datadirectory": "\/mnt\/data\/files",
        "apps_paths": [
            {
                "path": "\/var\/www\/owncloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/owncloud\/custom",
                "url": "\/custom",
                "writable": true
            }
        ],
        "dbtype": "mysql",
        "dbhost": "db:3306",
        "dbname": "owncloud",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "trusted_domains": [
            "localhost"
        ],
        "license-key": "***REMOVED SENSITIVE VALUE***",
        "marketplace.key": "***REMOVED SENSITIVE VALUE***",
        "mysql.utf8mb4": true,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "http:\/\/localhost\/",
        "version": "10.0.8.5",
        "logtimezone": "UTC",
        "installed": true,
        "instanceid": "oco5nqezi0ln",
        "updatechecker": "false",
        "upgrade.disable-web": "true",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "redis",
            "port": 6379
        },
        "filelocking.enabled": "true",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "maintenance": false,
        "loglevel": "2",
        "default_language": "en",
        "htaccess.RewriteBase": "\/"
    }
}

List of activated apps:

root@468b1fb3f3ae: /var/www/owncloud # occ app:list          
Enabled:
  - announcementcenter: 1.2.0
  - comments: 0.3.0
  - configreport: 0.1.1
  - dav: 0.3.2
  - federatedfilesharing: 0.3.1
  - federation: 0.1.0
  - files: 1.5.1
  - files_external: 0.7.1
  - files_sharing: 0.10.1
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - market: 0.2.4
  - notifications: 0.3.3
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - updatenotification: 0.2.1
Disabled:
  - encryption
  - external
  - theme-example: 1.0.0
  - user_external
  - user_ldap

Are you using external storage, if yes which one: local/smb/sftp/...
no

Are you using encryption: yes/no
no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no

@patrickjahns is this related to the known issue in 10.0.8 and already fixed for 10.0.9?

@patrickjahns
Copy link
Contributor

patrickjahns commented May 18, 2018

@michaelstingl
This exception is because you can only enable one theme - the current behavior prevents you from destroying your instance by enabling a second theme

What you want is a Feature Request - that when a theme is already enabled, and you want to enable another theme it implicitly disables the old theme and enables the new theme

Environment variable OWNCLOUD_APPS_INSTALL doesn't work for themes with official Docker. /cc

Is the theme on the marketplace? Otherwise you need to use OWNCLOUD_APPS_ENABLE

OWNCLOUD_APPS_INSTALL will fetch the app from marketplace to install it

@michaelstingl
Copy link
Author

@patrickjahns I initially tested with theme-enterprise from Marketplace. OWNCLOUD_APPS_INSTALL installs and automatically enables the app. The Docker never starts properly with OWNCLOUD_APPS_INSTALL=enterprise_key,theme-enterprise

@michaelstingl
Copy link
Author

michaelstingl commented May 18, 2018

I don't want to install another theme. I just don't want a nasty exception if I enable my current theme twice. This is what the Docker does under the hood.

@tboerger
Copy link
Contributor

@patrickjahns it's a bug and not a feature request if you try to enable the same theme twice. You don't need to disable theme-enterprise to enable theme-enterprise.

Just add a check if somebody tries to enable the already enabled theme and it should be totally fine.

@michaelstingl
Copy link
Author

@patrickjahns @tboerger how to proceed here? Do we need an ugly workaround in the Docker to always check before activating?

@tboerger
Copy link
Contributor

tboerger commented Jun 4, 2018

@patrickjahns @tboerger how to proceed here? Do we need an ugly workaround in the Docker to always check before activating?

Even for backward compatibility it looks like I really need to add a check for that -.-

@patrickjahns
Copy link
Contributor

@michaelstingl
aknowledge the current behavior (Exception when enabling the same theme twice) as bug

My misunderstanding for the feature request, was the impression that you want to automatically disable the "old theme" when enabling a "new theme".

@VicDeo
Copy link
Member

VicDeo commented Jun 13, 2018

@PVince81 ~ 2hrs #31771

@michaelstingl
Copy link
Author

just for reference, not fixed in owncloud-10.0.9RC2.tar.bz2:

root@owncloud:/var/www/owncloud# sudo -u www-data php ./occ app:enable theme-example
theme-example enabled
root@owncloud:/var/www/owncloud# sudo -u www-data php ./occ app:enable theme-example

In AppManager.php line 257:
                                                                   
  theme-example can't be enabled until theme-example is disabled.  
                                                                   

app:enable [-g|--groups GROUPS] [--] <app-id>

@VicDeo
Copy link
Member

VicDeo commented Jun 26, 2018

@michaelstingl yes, because #31783 is waiting for 10.0.10

@PVince81 PVince81 modified the milestones: development, QA Jan 11, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants