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

Old file versions not removed #3145

Closed
alexw1991 opened this issue Jan 18, 2017 · 7 comments
Closed

Old file versions not removed #3145

alexw1991 opened this issue Jan 18, 2017 · 7 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap feature: versions

Comments

@alexw1991
Copy link

alexw1991 commented Jan 18, 2017

Steps to reproduce

  1. Setup a user with a quota set (50GB)
  2. Setup the client (I'm using Windows) to upload files that are changed often
  3. After a few months the total storage space used by this user is 175GB, of which the files_versions folder is 133GB. Some are over 1 month old, despite the settings in the config file.

Expected behaviour

As I understand it my configuration should remove files after 31 days, or at the worst case when they are using more than 50% of the users quota.

Actual behaviour

Old versions are left on the server and not deleted.

Server configuration

Operating system: CentOS 7 64bit

Web server: Apache 2.4 with PHP7.0

Database: MySQL 5.6

PHP version: PHP7.0

Nextcloud version: 11.0.0

Updated from an older Nextcloud/ownCloud or fresh install: Updated from older OwnCloud installation

Where did you install Nextcloud from: NextCloud.com

Signing status:

Signing status

Results

  • core
    • EXTRA_FILE
      • error_log

List of activated apps:

App list

Enabled:

  • activity: 2.4.1
  • comments: 1.1.0
  • dav: 1.1.1
  • external: true
  • federatedfilesharing: 1.1.1
  • federation: 1.1.1
  • files: 1.6.1
  • files_accesscontrol: 1.1.2
  • files_automatedtagging: 1.1.1
  • files_pdfviewer: 1.0.1
  • files_retention: 1.0.1
  • files_sharing: 1.1.1
  • files_texteditor: 2.2
  • files_trashbin: 1.1.0
  • files_versions: 1.4.0
  • files_videoplayer: 1.0.0
  • firstrunwizard: 2.0
  • gallery: 16.0.0
  • logreader: 2.0.0
  • lookup_server_connector: 1.0.0
  • nextcloud_announcements: 1.0
  • notifications: 1.0.1
  • password_policy: 1.1.0
  • provisioning_api: 1.1.0
  • serverinfo: 1.1.1
  • sharebymail: 1.0.1
  • survey_client: 0.1.5
  • systemtags: 1.1.3
  • templateeditor: 0.2
  • theming: 1.1.1
  • twofactor_backupcodes: 1.0.0
  • updatenotification: 1.1.1
  • workflowengine: 1.1.1
    Disabled:
  • admin_audit
  • encryption
  • files_external
  • rainloop
  • user_external
  • user_ldap
  • user_saml

The content of config/config.php:

Config report
$CONFIG = array (
  'instanceid' => 'HIDDEN',
  'passwordsalt' => 'HIDDEN',
  'secret' => 'HIDDEN',
  'trusted_domains' => 
  array (
    0 => 'HIDDEN',
  ),
  'datadirectory' => '/home/backup/OwnCloud_Data',
  'overwrite.cli.url' => 'HIDDEN',
  'dbtype' => 'mysql',
  'version' => '11.0.0.10',
  'dbname' => 'HIDDEN',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'HIDDEN',
  'dbpassword' => 'HIDDEN',
  'logtimezone' => 'UTC',
  'installed' => true,
  'maintenance' => false,
  'remember_login_cookie_lifetime' => 300,
  'session_lifetime' => 300,
  'session_keepalive' => true,
  'loglevel' => 2,
  'theme' => '',
  'trashbin_retention_obligation' => 30,
  'mail_from_address' => 'monitoring',
  'mail_smtpmode' => 'php',
  'mail_domain' => 'HIDDEN',
  'singleuser' => false,
  'versions_retention_obligation' => '30, 31',
  'skeletondirectory' => '',
  'check_for_working_htaccess' => true,
  'check_for_working_webdav' => true,
  'activity_expire_days' => 90,

Are you using external storage, if yes which one: local/smb/sftp/...
NFS Share mounted at system level. Nothing configured on external storage app

Are you using encryption: NO

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

Client configuration

Browser: Chrome 55.0.2883.87

Operating system: Windows 10 64bit

Logs

Web server error log

Web server error log [11-Jan-2017 10:36:48 UTC] PHP Fatal error: Uncaught Error: Access to undeclared static property: OC\Files\Filesystem::$normalizedPathCache in /home/backup/public_html/lib/private/Files/Filesystem.php:806 Stack trace: #0 /home/backup/public_html/lib/private/Files/View.php(2018): OC\Files\Filesystem::normalizePath('/achievingclari...') #1 /home/backup/public_html/lib/private/Files/View.php(1156): OC\Files\View->unlockFile('/SERVER/Shared/...', 1) #2 [internal function]: OC\Files\View->OC\Files\{closure}() #3 /home/backup/public_html/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure)) #4 [internal function]: Icewind\Streams\CallbackWrapper->stream_close() #5 {main} thrown in /home/backup/public_html/lib/private/Files/Filesystem.php on line 806

Nextcloud log (data/nextcloud.log)

Nextcloud log

Browser log

Browser log
@nickvergessen
Copy link
Member

'trashbin_retention_obligation' => 30,

This is not really a valid value. Try the value you also have on your versions_retention_obligation:

'trashbin_retention_obligation' => '30, 31',

@nickvergessen
Copy link
Member

Ah, this is about versions. Well then the place to check is if the cron runs without issues, you have system cron on (not ajax cron).

And then there is Uncaught Error: Access to undeclared static property: OC\Files\Filesystem::$normalizedPathCache, this issues is dealt with in #1166

@alexw1991
Copy link
Author

Thanks for the reply. I've updated the config file as requested and the system still hasn't deleted the old versions. The cron is running every 15 minutes and according to NextCloud this is running successfully. We are not using the AJAX cron.

@MorrisJobke
Copy link
Member

@schiessle @icewind1991 Mind to have a look if this is still working and if there are (integration) tests for this use case (deletion of old files versions when quota is reached) available? Thanks

@MorrisJobke MorrisJobke added 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed needs info labels Jan 24, 2017
@MorrisJobke
Copy link
Member

Ping

@fvdnabee
Copy link

fvdnabee commented Aug 8, 2017

Are you sure the cron job is running successfully? I've noticed that the indicator reports the cron exec times from before I switched to system cron. For system cron you should manually install the cron job as mentioned here.

Alternatively you can also run the cron job manually (this should free up some space at least), e.g. : sudo -u www-data php -f /var/www/nextcloud/cron.php (note this can take a long time to complete).

@MorrisJobke
Copy link
Member

Just tested and it works here. Make sure that the cron job is properly executed. See the linked documentation above for details. Also check your administrators page for details which cron is set up and if it was executed properly.

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 feature: versions
Projects
None yet
Development

No branches or pull requests

4 participants