updateapp.php not working correctly with news app #24453

paroj opened this Issue May 5, 2016 · 11 comments


None yet

6 participants

paroj commented May 5, 2016

Steps to reproduce

  1. update the news app using the owncloud updater
  2. check the log

Expected behaviour

Temporary files correctly deleted

Actual behaviour

Temporary files not correctly deleted

Server configuration

Operating system: Ubuntu 14.04

Web server: Apache


PHP version: 7.0.5

ownCloud version: 9.0.2

Updated from an older ownCloud or fresh install: updated from 8

Where did you install ownCloud from: debian repository

Signing status (ownCloud 9.0 and above):

No errors have been found.

Are you using encryption: no


ownCloud log (data/owncloud.log)

{"reqId":"qrODXNeGf59YH0Hh67UI","remoteAddr":"192.168.178.xx","app":"PHP","message":"unlink(): No such file or directory at \/var\/www\/owncloud\/lib\/private\/helper.php#227","level":3,"time":"2016-05-05T16:36:50+02:00","method":"POST","url":"\/index.php\/settings\/ajax\/updateapp.php","user":"me"}
{"reqId":"qrODXNeGf59YH0Hh67UI","remoteAddr":"192.168.178.xx","app":"PHP","message":"rmdir(\/tmp\/oc_tmp_56egK8-folder\/news\/vendor\/bin): Directory not empty at \/var\/www\/owncloud\/lib\/private\/helper.php#225","level":3,"time":"2016-05-05T16:36:50+02:00","method":"POST","url":"\/index.php\/settings\/ajax\/updateapp.php","user":"me"}
{"reqId":"qrODXNeGf59YH0Hh67UI","remoteAddr":"192.168.178.xx","app":"PHP","message":"rmdir(\/tmp\/oc_tmp_56egK8-folder\/news\/vendor): Directory not empty at \/var\/www\/owncloud\/lib\/private\/helper.php#225","level":3,"time":"2016-05-05T16:36:50+02:00","method":"POST","url":"\/index.php\/settings\/ajax\/updateapp.php","user":"me"}
{"reqId":"qrODXNeGf59YH0Hh67UI","remoteAddr":"192.168.178.xx","app":"PHP","message":"rmdir(\/tmp\/oc_tmp_56egK8-folder\/news): Directory not empty at \/var\/www\/owncloud\/lib\/private\/helper.php#225","level":3,"time":"2016-05-05T16:36:50+02:00","method":"POST","url":"\/index.php\/settings\/ajax\/updateapp.php","user":"me"}
{"reqId":"qrODXNeGf59YH0Hh67UI","remoteAddr":"192.168.178.xx","app":"PHP","message":"rmdir(\/tmp\/oc_tmp_56egK8-folder): Directory not empty at \/var\/www\/owncloud\/lib\/private\/helper.php#231","level":3,"time":"2016-05-05T16:36:50+02:00","method":"POST","url":"\/index.php\/settings\/ajax\/updateapp.php","user":"me"}

ls /tmp/oc_tmp_56egK8-folder/news/vendor/bin/

ghost commented May 5, 2016

Have noticed the same in the past but completely forgot to report it here. It seems this is caused because the vendor/bin/picofeed is a symlink to vendor/fguillot/picofeed/picofeed

@dbeniamine dbeniamine referenced this issue in owncloud/news May 6, 2016

Rmdir directory not empty #990


I guess the install/update script does not remove symlinks proplery

@BernhardPosselt BernhardPosselt added the bug label May 6, 2016
@DeepDiver1975 DeepDiver1975 added this to the 9.1-current milestone May 6, 2016
ghost commented May 12, 2016

@paroj Btw. are you able to update the news app via the GUI at all? I'm still having the issue described in #18391 so just wondering if you're also facing the same issue?

paroj commented May 12, 2016

the update itself succeeds - I just have to remove the /tmp/oc_tmp_56egK8-folder/news/vendor/bin/ folder manually afterwards

VicDeo commented Jun 23, 2016 edited

yep. This will unlink target and not symlink itself.

So there will be two notices:

  • while unlinking non-existing target. it is already unlinked due to $fileInfo->getRealPath(). But it depends on the order of filesystem items iterator returns so happens from time to time.
  • while rmdir on symlink parent directory

just as per #24478

Error PHP rmdir(/tmp/oc_tmp_0oiTQP-folder/news/vendor/bin): Directory not empty at /var/www/owncloud/lib/private/helper.php#225 2016-05-04T18:15:01+00:00
Error PHP unlink(): No such file or directory at /var/www/owncloud/lib/private/helper.php#227 2016-05-04T18:15:01+00:00
VicDeo commented Jun 23, 2016

@PVince81 should be fixed in master with #24899
Backport changes in helper.php only?

PVince81 commented Jul 4, 2016

Fix is here #25255

@PVince81 PVince81 closed this Jul 4, 2016
Pazu commented Nov 8, 2016

Sorry to post in an old issue, but I've seen these messages in my log for a long time and still see them after upgrading to 9.1.1. Shouldn't these be gone as of 9.1 if this is fixed?

rmdir(/tmp/oc_tmp_XS146u-folder): Operation not permitted at /home/foo/public_html/lib/private/legacy/helper.php#218

According to my shared hosting provider:

the RM errors are not related to anything with ownCloud. you dont have access to TMP and its not needed for ownCloud

ghost commented Nov 8, 2016 edited

@Pazu I think this is unrelated to this issue here. The issue discussed here was about the symlink which wasn't removed correctly caused the posted error in the initial report.

Your issue / error is different and is caused by your environment setting the /tmp folder as a temp directory for PHP. where ownCloud has no access to. For further support please use https://central.owncloud.org

VicDeo commented Nov 8, 2016

@Pazu you can create a dedicated tmp for your owncloud, e.g. /home/foo/tmp and tempdirectory in config.php to use it:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment