External storage with session credentials is not accessible without a
user session, hence background jobs and CLI commands can't work with
them. The previously unhandled exception causes logged errors in the
nextcloud log. This patch catches the specific exception and logs it as
warnings. So for a production instance the error won't spam their logs
for this non-recoverable and technically unsolvable error if the minimum
log level is set to the default of 3 (error).
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Properly expire ext storage versions
System-wide external storages have no real owner so the current user is
used as owner. However when running cron.php there is no current user,
so no expiry can be done.
This fix adds an user argument to the expire() function to tell for
which user to expire files. This information is anyway always available
now through the expire command job.
* Move version expire setupFS into the expire function
* Add comment about not tearing down in version Storage::expire()
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>