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

unlink() in /files_versions/lib/versions.php gets wrong filepath -> file versions above 50 are not deleted #3279

Closed
ghost opened this issue May 8, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented May 8, 2013

Expected behaviour

Versions above DEFAULTMAXVERSIONS=50 should expire / be deleted

Actual behaviour

Versions above DEFAULTMAXVERSIONS=50 won't expire/deleted. It seems that the /files_versions/lib/versions.php on line 260 gets the wrong path to the file to expire passed. (See logfile snipped)

Steps to reproduce

  1. Create 50 versions of a file
  2. Create another version of the file to exceed the DEFAULTMAXVERSIONS of 50
  3. Have a look at the PHP error log

Server configuration

Operating system: Debian Squeeze

Web server: NginX 1.4.1

Database: MariaDB 5.5.30

PHP version: 5.4.14

ownCloud version: 4.5.10

Logs

Web server error log

[08-May-2013 12:00:46 UTC] PHP Warning: unlink(/var/www/owncloud/data/xxx/files_versions/xxx/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources.v/var/www/owncloud/data/xxx/files_versions/xxx/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources.v1364899663): No such file or directory in /var/www/owncloud/apps/files_versions/lib/versions.php on line 260
[08-May-2013 12:00:46 UTC] PHP Warning: unlink(/var/www/owncloud/data/xxx/files_versions/xxx/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources.v/var/www/owncloud/data/xxx/files_versions/xxx/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources.v1364904083): No such file or directory in /var/www/owncloud/apps/files_versions/lib/versions.php on line 260
[08-May-2013 12:00:46 UTC] PHP Warning: unlink(/var/www/owncloud/data/xxx/files_versions/xxx/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources.v/var/www/owncloud/data/xxx/files_versions/xxx/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources.v1364905693): No such file or directory in /var/www/owncloud/apps/files_versions/lib/versions.php on line 260

@ghost
Copy link
Author

ghost commented May 17, 2013

Made some research about this:

At my tests $versionsName is always the original filename like:

/var/www/data/test/files_versions/test.txt

and $de is always the original filename with the version string appended like:

/var/www/data/test/files_versions/test.txt.v1368778304

in apps/files_versions/lib/versions.php on line 260.

This is causing a wrong path to the file to delete in unlink() like reported above and should be fixed with the PR.

schiessle added a commit that referenced this issue Jun 17, 2013
Fixed deleting old file versions #3279
@schiessle
Copy link
Contributor

fixed in stable45 branch, will be released with the next bug-fix release

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

No branches or pull requests

1 participant