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

updateapp.php not working correctly with news app #24453

Closed
paroj opened this Issue May 5, 2016 · 11 comments

Comments

Projects
None yet
6 participants
@paroj

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

Database:

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

Logs

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/

picofeed
@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost 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

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

@BernhardPosselt

This comment has been minimized.

Show comment
Hide comment
@BernhardPosselt

BernhardPosselt May 6, 2016

Contributor

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

Contributor

BernhardPosselt commented May 6, 2016

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

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost 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?

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

This comment has been minimized.

Show comment
Hide comment
@paroj

paroj May 12, 2016

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

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

@PVince81

This comment has been minimized.

Show comment
Hide comment
@PVince81
Member

PVince81 commented Jun 23, 2016

@VicDeo

This comment has been minimized.

Show comment
Hide comment
@VicDeo

VicDeo Jun 23, 2016

Member

yep. This will unlink target and not symlink itself.
https://github.com/owncloud/core/blob/stable9/lib/private/helper.php#L227

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
Member

VicDeo commented Jun 23, 2016

yep. This will unlink target and not symlink itself.
https://github.com/owncloud/core/blob/stable9/lib/private/helper.php#L227

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

This comment has been minimized.

Show comment
Hide comment
@VicDeo

VicDeo Jun 23, 2016

Member

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

Member

VicDeo commented Jun 23, 2016

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

@PVince81

This comment has been minimized.

Show comment
Hide comment
@PVince81

PVince81 Jul 4, 2016

Member

Fix is here #25255

Member

PVince81 commented Jul 4, 2016

Fix is here #25255

@PVince81 PVince81 closed this Jul 4, 2016

@Pazu

This comment has been minimized.

Show comment
Hide comment
@Pazu

Pazu 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

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

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Nov 8, 2016

@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

ghost commented Nov 8, 2016

@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

This comment has been minimized.

Show comment
Hide comment
@VicDeo

VicDeo Nov 8, 2016

Member

@Pazu you can create a dedicated tmp for your owncloud, e.g. /home/foo/tmp and tempdirectory in config.php to use it:
https://github.com/owncloud/core/blob/stable9.1/config/config.sample.php#L1093

Member

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:
https://github.com/owncloud/core/blob/stable9.1/config/config.sample.php#L1093

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