owncloud / owncloud/core

rmdir logs errors when upgrading an app

Open
#37,144 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type:Bug
Dominant language
PHP
Stars
8.8k
Forks
2.1k
Avg merge
20h 7m
Merged PRs (30d)
41

Description

Steps to reproduce
  1. Upgrading an app from MarketPlace, in particular activity
  2. Upgrade runs fine, but errors are logged

Note: Nothing was logged when upgrading mediaviewer...

Expected behaviour

No errors should be logged

Actual behaviour

Error / Warning gets logged in owncloud log

Server configuration

Operating system: Ubuntu 18.04

Web server: nginx

Database: MariaDB 10.4

PHP version: 7.3

ownCloud version: 10.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": "ocbdscdhwdo8",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "xxxx"
        ],
        "datadirectory": "xxxx\/data",
        "overwrite.cli.url": "https:\/\/xxxx",
        "dbtype": "mysql",
        "version": "10.4.0.4",
        "dbname": "xxxx",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "filelocking.enabled": "true",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "\/var\/run\/redis\/redis-server.sock",
            "port": 0,
            "timeout": 0,
            "dbindex": 0
        },
        "filesystem_check_changes": 1,
        "excluded_directories": [
            ".snapshot",
            "~snapshot"
        ],
        "upgrade.automatic-app-update": true,
        "quota_include_external_storage": false,
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "tls",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpauthtype": "LOGIN",
        "apps_paths": [
            {
                "path": "xxxx\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "xxxx\/apps-external",
                "url": "\/apps-external",
                "writable": true
            }
        ],
        "maintenance": false,
        "loglevel": 2,
        "theme": "",
        "show_server_hostname": false,
        "log_rotate_size": "20971520"
    }
}

List of activated apps:

Enabled:
  - activity: 2.5.3
  - comments: 0.3.0
  - configreport: 0.2.0
  - dav: 0.5.0
  - federatedfilesharing: 0.5.0
  - federation: 0.1.0
  - files: 1.5.2
  - files_clipboard: 1.0.2
  - files_external: 0.7.1
  - files_external_dropbox: 1.2.0
  - files_external_ftp: 0.2.1
  - files_mediaviewer: 1.0.2
  - files_pdfviewer: 0.11.1
  - files_sharing: 0.12.0
  - files_texteditor: 2.3.0
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - firstrunwizard: 1.2.0
  - market: 0.5.0
  - notifications: 0.5.0
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - updatenotification: 0.2.1
Disabled:
  - encryption
  - external
  - user_external

Are you using external storage, if yes which one: local/smb/ftp/db/gd

Are you using encryption: no

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

Client configuration

Browser: Opera

Operating system: W10x64

Logs
Web server error log
No related logs entries
ownCloud log (data/owncloud.log)
{"reqId":"wozYhy7HknHWdWY704Ko","level":3,"time":"2020-03-20T07:26:19+00:00","remoteAddr":"10.168.90.1","user":"xxxx","app":"PHP","method":"POST","url":"\/apps\/market\/apps\/activity\/update","message":"rmdir(xxxx\/apps-external\/activity): Directory not empty at xxxx\/lib\/private\/legacy\/helper.php#220"}

Same for folder: \/activity\/l10n, \/activity\/js, \/activity\/img, \/activity\/css

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at lib/private/legacy/helper.php#220 and follow the Market app activity update path that removes the activity app directory and its subdirectories. Reproduce an app upgrade and verify that the upgrade completes without rmdir warnings for activity or its l10n, js, img, and css directories.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.