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

[Bug]: app:install reports app as already installed when files have been deleted, while app:update reports not installed #48413

Closed
5 of 8 tasks
oucil opened this issue Sep 26, 2024 · 4 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: install and update needs info

Comments

@oucil
Copy link

oucil commented Sep 26, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

The recommended update process from the CLI is to remove the NC root to avoid stale files and replace with a fresh copy from the TAR, preserving only the config.php.

When doing the same with app files, prior to NC30, one could just re-run app:install _______ on the existing app, and it would re-install the files. Now in NC30, using the same process results in the app:install _______ reporting ________ already installed even when the files have been deleted preventing the files from being re-installed. Running app:update ________ results in ________ not installed.

This prevents both a fresh install of the app without removing it and reinstalling it (presumably losing any settings, etc. along with it), and running an update on it. Because the app is not actually installed even when it's reported as being installed, it does not appear in the web console either.

Steps to reproduce

  1. Use a custom defined ext_app directory and install at least one app.
  2. Perform an NC upgrade from the CLI by deleting the NC root, as well as the custom app directory
  3. Run app:install _______ on the app you previously had installed.
  4. This will result in ______ already installed, even though the files no longer exist.

Expected behavior

Like NC <= 29, I expect to be able to run app:install ______ on an app who's files have been deleted during the upgrade process, to avoid stale files, to re-install the app and replenish the fresh files.

Nextcloud Server version

30

Operating system

RHEL/CentOS

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

MySQL

Is this bug present after an update or on a fresh install?

Upgraded to a MAJOR version (ex. 28 to 29)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "otherdomain.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "30.0.0.14",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "log_type": "syslog",
        "logfile": "",
        "loglevel": "3",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": "0",
            "dbindex": "3",
            "timeout": "0.0"
        },
        "filelocking.enabled": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "cache_path": "\/srv\/data\/nextcloud",
        "apps_paths": [
            {
                "path": "\/srv\/apps\/nextcloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/srv\/apps\/nextcloud\/ext_apps",
                "url": "\/ext_apps",
                "writable": true
            }
        ],
        "upgrade.disable-web": true,
        "default_phone_region": "CA",
        "blacklisted_files": [],
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": 25,
        "mail_smtpauth": true,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "appstoreenabled": "false",
        "maintenance": false,
        "memories.exiftool_no_local": true,
        "memories.vod.path": "\/srv\/apps\/nextcloud\/ext_apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/bin\/ffprobe",
        "memories.db.triggers.fcu": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\BMP",
            "OC\\Preview\\Font",
            "OC\\Preview\\GIF",
            "OC\\Preview\\Illustrator",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\Movie",
            "OC\\Preview\\MP3",
            "OC\\Preview\\MP4",
            "OC\\Preview\\MSOffice2003",
            "OC\\Preview\\MSOffice2007",
            "OC\\Preview\\MSOfficeDoc",
            "OC\\Preview\\PDF",
            "OC\\Preview\\Photoshop",
            "OC\\Preview\\PNG",
            "OC\\Preview\\SVG",
            "OC\\Preview\\TIFF",
            "OC\\Preview\\TXT",
            "OC\\Preview\\XBitmap"
        ],
        "preview_libreoffice_path": "\/bin\/libreoffice",
        "preview_ffmpeg_path": "\/bin\/ffmpeg",
        "defaultapp": "apporder"
    }
}

List of activated Apps

Enabled:
  - activity: 3.0.0
  - bruteforcesettings: 3.0.0
  - circles: 30.0.0-dev
  - cloud_federation_api: 1.13.0
  - comments: 1.20.1
  - contactsinteraction: 1.11.0
  - dashboard: 7.10.0
  - dav: 1.31.1
  - federatedfilesharing: 1.20.0
  - federation: 1.20.0
  - files: 2.2.0
  - files_external: 1.22.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - nextcloud_announcements: 2.0.0
  - notifications: 3.0.0
  - oauth2: 1.18.1
  - password_policy: 2.0.0
  - photos: 3.0.2
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - support: 2.0.0
  - survey_client: 2.0.0
  - systemtags: 1.20.0
  - text: 4.1.0
  - theming: 2.5.0
  - twofactor_backupcodes: 1.19.0
  - twofactor_totp: 12.0.0-dev
  - updatenotification: 1.20.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0
Disabled:
  - admin_audit: 1.20.0
  - encryption: 2.18.0
  - files_downloadlimit: 3.0.0 (installed 2.0.0)
  - firstrunwizard: 3.0.0 (installed 2.14.0)
  - suspicious_login: 8.0.0
  - twofactor_nextcloud_notification: 4.0.0
  - user_ldap: 1.21.0


These apps are also being reported as installed/enabled, but have no files and so can no longer be updated...

  - announcementcenter
  - calendar
  - contacts
  - cookbook
  - deck
  - fulltextsearch
  - files_fulltextsearch
  - fileslibreofficeedit
  - keeweb
  - memories
  - metadata
  - phonetrack
  - previewgenerator
  - richdocuments
  - richdocumentscode
  - spreed
  - tasks
  - timemanager

Nextcloud Signing status

N/A

Nextcloud Logs

N/A

Additional info

None.

@oucil oucil added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Sep 26, 2024
@joshtrichards
Copy link
Member

The recommended update process from the CLI is to remove the NC root to avoid stale files and replace with a fresh copy from the TAR, preserving only the config.php.
[...]
Perform an NC upgrade from the CLI by deleting the NC root, as well as the custom app directory

Where do we recommend that? Our documented manual upgrade process explicitly says to keep your apps (see steps 10 + 11).

@oucil
Copy link
Author

oucil commented Sep 26, 2024

@joshtrichards Sorry Josh, this has worked for years, and was in-line with your other recommendations regarding the NC root so I hadn't seen the lines regarding extra apps. To be perfectly honest, it's odd that you apply one standard to the core app, seemingly because it doesn't take care of old files itself, and another standard to extra apps, allowing them to remain as is, and potentially allowing them to keep stale files indefinitely.

Is there a process within the app:update that ensures there are no stale files? Just reinstalling them has worked perfectly since I started doing this way back around NC10.

In any case, thanks for pointing this out, I'll adjust our upgrade process accordingly.

@joshtrichards
Copy link
Member

Is there a process within the app:update that ensures there are no stale files?

Yes.

$baseDir = OC_App::getInstallPath() . '/' . $appId;
// Remove old app with the ID if existent
OC_Helper::rmdirr($baseDir);

To be perfectly honest, it's odd that you apply one standard to the core app, seemingly because it doesn't take care of old files itself, and another standard to extra apps, allowing them to remain as is, and potentially allowing them to keep stale files indefinitely.

Well it's a little easier to have server update the apps then it is have server update itself. :-) That's why our own Updater (which can be used via the command-line, btw) for server is actually completely outside of / independent from server itself.

@joshtrichards joshtrichards closed this as not planned Won't fix, can't repro, duplicate, stale Sep 26, 2024
@oucil
Copy link
Author

oucil commented Sep 26, 2024

@joshtrichards Fair enough! Appreciate the confirmation that the files don't go stale in the extra apps, that was really my only concern. Cheers!

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: install and update needs info
Projects
None yet
Development

No branches or pull requests

2 participants