Occ version expiry does not work



I'm trying to perform version expiry from the command line:

$ sudo -u www-data php occ versions:expire

But I get this:

No expiry configured.

even though my config.php contains:

'versions_retention_obligation' => 'auto',

What am I missing?

$ sudo -u www-data php occ -V
ownCloud version 9.1.3


Hi @bovender

This looks like a bug when only 'auto' is written.

A workaround now could be using some paramethers like '15,180' or '15,365'

I already reported to engineering .

adding both parameters works works, '15,60' and '15,90'

root@snoopy3:~# occ versions:expire
   60 [============================]
root@snoopy3:~# occ trashbin:expire
   60 [============================]

Best regards,
Carlos Damken


Thanks. Now I get "<username> is not a valid user any more" errors. The user name that is mentioned is not listed in my LDAP directory, and I cannot seem to get around this error (e.g. by first attempting to remove or disable the non-existing user).

Anyway, issuing

$ sudo -u www-data php occ versions:expire <my_main_user_name>

causes the command to complete successfully. Interestingly, the version expiry and subsequent cleaning up of the trash bin does not free any space... Even though I have been using Owncloud heavily for a few years now.

But thanks anyway!


OK, nevermind the error message ... is not a valid user anymore. There was a leftover LDAP user mapping from very long time ago when I first installed OwnCloud on the server.

In case anyone else arrives here: To fix the error, I deleted all entries for this LDAP user (which did not exist any more in the LDAP directory) in the database tables oc_preferences and oc_ldap_user_mapping. This is a MySQL database, so I used the search feature of phpMyAdmin for this.


Removing a user should be done with the remnants, otherwise are some tables that you didn't clean (for example oc_storages)

Probably because the cron job was already cleaning many of the old files.