Webcron returns 400 status - cron fails to remove old files

You can add this

“remoteAddr”: “XXX.XXX.XX.XXX”,

as trusted, or preferably its name, that you can find with:

nslookup XXX.XXX.XX.XXX

OK, just did that, now on 10.0.10 - can’t really tell any difference.
But now I have even more stuff on the file system…

Is it safe to delete old checkpoints (./data/updater-data/ckeckpoint/, not the latest) and old download .zip files (./data/updater-data/download/)?

Yes, you can delete them to save disk space. Downgrading isn’t supported anyway.


Any update on the webcron issue?

Well, it’s still not working… :-
I now started to manually remove old file versions by creating copies of the files and renaming them… =8-o

Edit: To be more precise:

  • Old file versions still are not deleted

  • Despite having ‘cron_log’ => true, in my config.php, I do not see any cron-related log entries in owncloud.log - even if I manually open www.mydomain.de/owncloud/cron.php and get {“status”:“success”} as return value

  • For some reason, calling cron.php from the 1&1 cron manager seems to be working now, at least it reports {“status”:“success”}

Having some more output from the entire cron thing would really help…

You have to adjust the log level.

OK, the picture evolves.

  1. In the admin > General settings, I switched to ‘Cron > Webcron’ and set log to ‘Warnings, Errors, Fatal Issues’

  2. I manually ran www.mydomain.de/owncloud/cron.php by opening that URL in a web browser. This took several seconds and returned {“status”:“success”}

  3. In the log file, I now find a 176 entries of “not found while trying to get owner” similar to this:

{"reqId":"W9Lwh1KlUo0AAC2BQ1wAAABJ","level":3,"time":"2018-10-26T12:46:45+02:00","remoteAddr":"XXX.XXX.XXX.XXX","user":"--","app":"no app in context","method":"GET","url":"\/owncloud\/cron.php","message":"Exception: {\"Exception\":\"OCP\\\\Files\\\\NotFoundException\",\"Message\":\"\\\/files_trashbin\\\/files\\\/file.docx.d1540232740 not found while trying to get owner\",\"Code\":0,\"Trace\":\"#0 \\\/mainfolder\\\/group\\\/username\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Filesystem.php(961): OC\\\\Files\\\\View->getOwner('\\\/files_trashbin...')\\n#1 \\\/mainfolder\\\/group\\\/username\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Preview.php(1311): OC\\\\Files\\\\Filesystem::getOwner('\\\/files_trashbin...')\\n#2 \\\/mainfolder\\\/group\\\/username\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/legacy\\\/hook.php(105): OC\\\\Preview::post_delete(Array)\\n#3 \\\/mainfolder\\\/group\\\/username\\\/htdocs\\\/owncloud\\\/apps\\\/files_trashbin\\\/lib\\\/Trashbin.php(633): OC_Hook::emit('\\\\\\\\OCP\\\\\\\\Trashbin', 'delete', Array)\\n#4 \\\/mainfolder\\\/group\\\/username\\\/htdocs\\\/owncloud\\\/apps\\\/files_trashbin\\\/lib\\\/Trashbin.php(666): OCA\\\\Files_Trashbin\\\\Trashbin::emitTrashbinPostDelete('\\\/files_trashbin...')\\n#5 \\\/mainfolder\\\/group\\\/username\\\/htdocs\\\/owncloud\\\/apps\\\/files_trashbin\\\/lib\\\/Trashbin.php(836): OCA\\\\Files_Trashbin\\\\Trashbin::delete('file...', 'ocuser', '1540232740')\\n#6 \\\/mainfolder\\\/group\\\/username\\\/htdocs\\\/owncloud\\\/apps\\\/files_trashbin\\\/lib\\\/Trashbin.php(756): OCA\\\\Files_Trashbin\\\\Trashbin::deleteExpiredFiles(Array, 'ocuser')\\n#7 \\\/mainfolder\\\/group\\\/username\\\/htdocs\\\/owncloud\\\/apps\\\/files_trashbin\\\/lib\\\/Command\\\/Expire.php(56): OCA\\\\Files_Trashbin\\\\Trashbin::expire('ocuser')\\n#8 \\\/mainfolder\\\/group\\\/username\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Command\\\/CommandJob.php(34): OCA\\\\Files_Trashbin\\\\Command\\\\Expire->handle()\\n#9 \\\/mainfolder\\\/group\\\/username\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/BackgroundJob\\\/Job.php(57): OC\\\\Command\\\\CommandJob->run('O:33:\\\"OCA\\\\\\\\Files...')\\n#10 \\\/mainfolder\\\/group\\\/username\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/BackgroundJob\\\/QueuedJob.php(42): OC\\\\BackgroundJob\\\\Job->execute(Object(OC\\\\BackgroundJob\\\\JobList), Object(OC\\\\Log))\\n#11 \\\/mainfolder\\\/group\\\/username\\\/htdocs\\\/owncloud\\\/cron.php(142): OC\\\\BackgroundJob\\\\QueuedJob->execute(Object(OC\\\\BackgroundJob\\\\JobList), Object(OC\\\\Log))\\n#12 {main}\",\"File\":\"\\\/mainfolder\\\/group\\\/username\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/Files\\\/View.php\",\"Line\":1717}"}

Looks like something got out of sync between the main files and their versions?!

Edit: Re-running the same thing does not produce any further log output. Maybe it considers the tasks completed? Either way, the old file versions still remain on the file system in ./data/ocuser/file_versions

Edit2: Just to re-iterate, I have these settings in config.php:

  'versions_retention_obligation' => '1,2',
  'trashbin_retention_obligation' => '1,2',
  'activity_expire_days' => 10,

but I have file versions that have a last modified date of 2017

Do you see cron in syslog

root@vorman:/home/pi# tail /var/log/syslog
Oct 26 07:00:01 vorman CRON[25198]: (www-data) CMD (/usr/bin/php -f /var/www/html/owncloud/cron.php)
Oct 26 07:01:29 vorman systemd[1]: Starting Daily apt download activities…
Oct 26 07:01:48 vorman systemd[1]: Started Daily apt download activities.
Oct 26 07:01:48 vorman systemd[1]: apt-daily.timer: Adding 47min 26.771105s random time.
Oct 26 07:01:48 vorman systemd[1]: apt-daily.timer: Adding 1h 5min 28.710847s random time.
Oct 26 07:09:00 vorman systemd[1]: Starting Clean php session files…
Oct 26 07:09:01 vorman systemd[1]: Started Clean php session files.
Oct 26 07:09:01 vorman CRON[25457]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Oct 26 07:17:01 vorman CRON[25516]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Oct 26 07:24:05 vorman systemd[1]: Started Session c35 of user pi.

He is on a hosted owncloud, no syslog I assume.

1 Like


now with 29 (or 30 after mine) posts i think the thread is already hard to follow. Maybe the issue about the log entries about files should be moved to a new thread or maybe there are already existing threads discussing the same available when searching the forums?

Is there any rule to stop or split discussion after 30 posts? So what?:roll_eyes:

Since I am not sure how these issues are related, it’s a bit hard for me to decide when to branch into a new thread. The overarching issue I have is that my owncloud instance is filling up with unwanted files and the mechanisms for getting rid of them seem not to be working.

But you are correct that the topic has now shifted from a webcron issue to a general cron issue (and ultimately an old file versions issue).

Edit: Is is better to have many short threads that are somewhat interrelated or one long one with all aspects? I could edit the title if that helps?


i think you’re long enough around at this community that you might know posts like “i have the same issue” of new users just because they have found some words within the topic title or some posted errors. :slightly_smiling_face:

From my experience its always better to have different issues (the initial one was about not able running webcron) split into smaller topics. After such much posts in this thread i don’t think that any readers can follow whats the current status, which things where already solved and which where the solution.

The best example is that it seems you even had to ask the status of the webcron issue a few post above:

To me this clearly shows that its not even clear which issue now gets tackled.

Just my 2 cents on this topic, even if i contributing to mess this topic even more. :grinning:

1 Like

FYI, I just started a new thread on the primary issue of old file versions and trash files not being deleted (despite webcron apparently working now).



nice and thanks. I think it would be great if you could do an additional post here with a short summary how you got the webcron to work. This post could be uses then to mark the thread as “solved” so further readers are immediately seeing your solution instead of requiring to find it within the 30+ posts.

1 Like

I would - if I understood what exactly the solution was. I tried a whole range of things, and for some reason it now seems to work - although the main goal of getting rid of old files is still not achieved, so maybe it only looks like cron is working now, while it really is not.

One thing I can summarize from all this: better/more verbose reporting of cron errors would be beneficial.

Also: In between, I did a very time-consuming manual cleanup process, by creating a copy of every file with a version history (so the new copy did not have a history), deleting the original file and renaming the new file to the name of the original. I had to do this in order to free up space, as all the other efforts did not work. But I did not do this for every single file (only the largest ones and those with the most versions), so I can still tell that cron does not clean up properly. Also new versions are starting to accumulate again.

1 Like


nice and thanks for the summary. I think if you have suggestion the ownCloud development team is probably happy about any feedback / suggestions. From what i know this team can be reached via https://github.com/owncloud/core/issues