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

Move apps from apps to apps2 folder can cause issues #29807

Closed
mmattel opened this issue Dec 10, 2017 · 15 comments
Closed

Move apps from apps to apps2 folder can cause issues #29807

mmattel opened this issue Dec 10, 2017 · 15 comments
Labels

Comments

@mmattel
Copy link
Contributor

mmattel commented Dec 10, 2017

Steps to reproduce

  1. disable an app
  2. enable maintenance mode
  3. move app from folder apps/ to apps2/
  4. disable maintenance mode
  5. try to reenable app

Expected behaviour

app should be enabled

Actual behaviour

4 example apps I tried
Info, Musik worked

pastedgraphic-3

pastedgraphic-2

Temporary Fix

In maintenace mode on, I needed to delete the app physically, then maintenance mode off, then I was able to download the app from the Marketplace (before it was identified as installed).

Server configuration

Operating system: Ubuntu 16.04

Web server: nginx

Database: mysql

PHP version: 7

ownCloud version: 10.0.4

Updated from an older ownCloud or fresh install: updated

Where did you install ownCloud from: tar

Signing status (ownCloud 9.0 and above):

No errors have been found.

The content of config/config.php:

{
    "system": {
        "instanceid": "oct7bkicorxf",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "xyz"
        ],
        "datadirectory": "\/var\/www\/owncloud\/data",
        "overwrite.cli.url": "https:\/\/xyz",
        "dbtype": "mysql",
        "version": "10.0.4.4",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "Europe\/Vienna",
        "installed": true,
        "filelocking.enabled": "true",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "localhost",
            "port": 6379,
            "timeout": 0,
            "dbindex": 0
        },
        "filesystem_check_changes": 1,
        "loglevel": 2,
        "mail_smtpmode": "smtp",
        "mail_from_address": "xyzzy",
        "mail_smtpsecure": "tls",
        "mail_domain": "xyzzy",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtphost": "xyzzy",
        "mail_smtpport": "587",
        "maintenance": false,
        "theme": "",
        "preview_max_scale_factor": 1,
        "enabledPreviewProviders": {
            "0": "OC\\Preview\\PNG",
            "1": "OC\\Preview\\JPEG",
            "2": "OC\\Preview\\GIF",
            "11": "OC\\Preview\\Illustrator",
            "12": "OC\\Preview\\Postscript",
            "13": "OC\\Preview\\Photoshop",
            "14": "OC\\Preview\\TIFF"
        },
        "excluded_directories": [
            ".snapshot",
            "~snapshot"
        ],
        "upgrade.automatic-app-update": true,
        "quota_include_external_storage": false,
        "singleuser": false,
        "apps_paths": [
            {
                "path": "\/var\/www\/owncloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/owncloud\/apps2",
                "url": "\/apps2",
                "writable": true
            }
        ]
    }
}

List of activated apps:

Enabled:
  - activity: 2.3.6
  - 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_clipboard: 0.6.2
  - files_external: 0.7.1
  - files_external_dropbox: 1.0.0
  - files_external_ftp: 0.2.0
  - files_pdfviewer: 0.8.2
  - files_sharing: 0.10.1
  - files_texteditor: 2.2.1
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - gallery: 16.0.2
  - market: 0.2.3
  - music: 0.5.5
  - notifications: 0.3.2
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - templateeditor: 0.1
  - updatenotification: 0.2.1
Disabled:
  - encryption
  - external
  - theme-example
  - user_external

Are you using external storage, if yes which one: local, smb, ftp, dropbox...

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Safari

Operating system: MacOs

Logs

ownCloud log (data/owncloud.log)

Based on the examples of Gallery and Files_Clipboard

{"reqId":"ug4BQZSMIge2bgohLY4g","level":3,"time":"2017-12-10T20:34:16+01:00","remoteAddr":"w.x.y.z","user":"user_1","app":"PHP","method":"GET","url":"\/apps\/files","message":"require_once(\/var\/www\/owncloud\/apps\/gallery\/appinfo\/app.php): failed to open stream: No such file or directory at \/var\/www\/owncloud\/lib\/private\/legacy\/app.php#243"}
{"reqId":"ug4BQZSMIge2bgohLY4g","level":3,"time":"2017-12-10T20:34:16+01:00","remoteAddr":"w.x.y.z","user":"user_1","app":"PHP","method":"GET","url":"\/apps\/files","message":"require_once(): Failed opening required '\/var\/www\/owncloud\/apps\/gallery\/appinfo\/app.php' (include_path='\/var\/www\/owncloud\/apps:\/var\/www\/owncloud\/apps2') at \/var\/www\/owncloud\/lib\/private\/legacy\/app.php#243"}

{"reqId":"NINdBFMbTzoEZfZlTjbw","level":3,"time":"2017-12-10T20:34:24+01:00","remoteAddr":"w.x.y.z","user":"user_1","app":"PHP","method":"GET","url":"\/apps\/files","message":"require_once(\/var\/www\/owncloud\/apps\/files_clipboard\/appinfo\/app.php): failed to open stream: No such file or directory at \/var\/www\/owncloud\/lib\/private\/legacy\/app.php#243"}
{"reqId":"NINdBFMbTzoEZfZlTjbw","level":3,"time":"2017-12-10T20:34:24+01:00","remoteAddr":"w.x.y.z","user":"user_1","app":"PHP","method":"GET","url":"\/apps\/files","message":"require_once(): Failed opening required '\/var\/www\/owncloud\/apps\/files_clipboard\/appinfo\/app.php' (include_path='\/var\/www\/owncloud\/apps:\/var\/www\/owncloud\/apps2') at \/var\/www\/owncloud\/lib\/private\/legacy\/app.php#243"}
@ownclouders
Copy link
Contributor

GitMate.io thinks the contributor most likely able to help you is @PVince81.

@PVince81
Copy link
Contributor

@mmattel did you check if oc_appconfig has hard-coded paths ?

@mmattel
Copy link
Contributor Author

mmattel commented Dec 11, 2017

Just looked into the table.
No app in the table has a configkey/configvalue which contains a path or path-component.
There are about 138 entries from varios apps (incuding some orphans where the app does not exist anymore... but anyhow this is a different story 😄 )

@mmattel
Copy link
Contributor Author

mmattel commented Dec 11, 2017

The text gets triggered at: core/settings/js/admin-apps.js at line 293

}).fail(function() {
	// server borked, emergency disable app
	$.post(OC.webroot + '/index.php/disableapp', {appid: appId}, function() {
		OC.Settings.Apps.showErrorMessage(
			appId,
			t('settings', 'Error: this app cannot be enabled because it makes the server unstable')
		);

@settermjd
Copy link
Contributor

Just confirming @mmattel's work that I can move an app into a new directory, but as there is no path reference, the move will always be slightly broken.

@PVince81
Copy link
Contributor

@VicDeo any clues as you're familiar with the resource locator ?

@VicDeo
Copy link
Member

VicDeo commented Dec 19, 2017

@PVince81 I haven't touched resource locator itself yet, could be related to caching because AppManager uses cache to store app values

@settermjd
Copy link
Contributor

From researching the codebase, it looks like it will need a bit of work to implement. However, it might be quite achievable. I'll add an issue to document what I think's required.

@mmattel
Copy link
Contributor Author

mmattel commented Dec 19, 2017

@settermjd pls. keep me posted. Very interested about your findings 😃

@settermjd
Copy link
Contributor

I've created an issue, but I'm not sure if it's effectively a duplicate of this one. That said, it was quite interesting to follow the logic in the code to, almost, understand what's going on.

@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

@cdamken
Copy link
Contributor

cdamken commented Mar 22, 2018

What happens if the app is in both folders?
Which one will be active?
and in case of upgrades - which will be updated?

@mmattel
Copy link
Contributor Author

mmattel commented Mar 22, 2018

ad 1.) don´t know... but would be interested in the result, easy testing - just try 😄

ad 2.) in case you follow the config.sample.php description of apps_path, the apps folder is read only (core apps) while the apps2 directory is read-write and apps can be updated there.

See also issue #29839 ([Feature Request] make the apps2 folder default used in new installations) to make apps2 default available when setting up a new instance.

@VicDeo
Copy link
Member

VicDeo commented Mar 23, 2018

@cdamken

What happens if the app is in both folders?

By design the most recent app should be loaded (by version). If the versions are the same - behavior is undefined, I guess app from the very first appdir will be loaded

and in case of upgrades - which will be updated?

By design one that is located in a writable appdir

settermjd added a commit that referenced this issue Aug 17, 2018
#29807 documents that moving apps
from the core to a non-core apps folder manually can cause issues. Given
that and the discussion in
owncloud-archive/documentation#4276, I decided to start
writing an app:move command, to make moving apps from the core apps
directory, to a custom non-core apps directory simpler and less messy.

When finished, the command will be able to:

- List apps that can be moved
- List any non-core app directories
- Check that non-core app directories exist
- Move one or more apps from the core apps directory to a non-core apps directory

The other reason for doing this is to better familiarise myself with
ownCloud's internals — something that, for quite some time, I've felt
I've been lacking, and that has been hindering me from doing my work
better.
@mmattel mmattel closed this as completed Jan 10, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants