Annoying email in each 15 minutes

Steps to reproduce

  1. I don’t know what has been changed since I started to receive this email
  2. I receive an email in each 15 minutes with the subject: Cron www-data@server /usr/bin/php /path/to/your/owncloud/occ system:cron

Expected behaviour

Email shouldn’t be sent

Actual behaviour

I receive an unnecessary email in each 15 minutes

Server configuration

Operating system:
Linux server 5.4.0-47-generic #51~18.04.1-Ubuntu SMP Sat Sep 5 14:35:50 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Web server:
nginx version: nginx/1.14.0 (Ubuntu)

Database:
mysql Ver 14.14 Distrib 5.7.31, for Linux (x86_64) using EditLine wrapper

PHP version:
PHP 7.2.24-0ubuntu0.18.04.6 (cli) (built: May 26 2020 13:09:11) ( NTS )

ownCloud version: (see ownCloud admin page)
ownCloud 10.5.0 (stable)

Updated from an older ownCloud or fresh install:
No update, no fresh install, I don’t know what happened

Where did you install ownCloud from:

Signing status (ownCloud 9.0 and above):
No errors have been found.

The content of config/config.php:
https://pastebin.pl/view/050f7429

List of activated apps:
Enabled:

  • activity: 2.5.3
  • comments: 0.3.0
  • configreport: 0.2.0
  • dav: 0.6.0
  • federatedfilesharing: 0.5.0
  • federation: 0.1.0
  • files: 1.5.2
  • files_external: 0.7.1
  • files_mediaviewer: 1.0.3
  • files_pdfviewer: 0.11.2
  • files_sharing: 0.13.0
  • files_texteditor: 2.3.0
  • files_trashbin: 0.9.1
  • files_versions: 1.3.0
  • firstrunwizard: 1.2.0
  • market: 0.6.0
  • notifications: 0.5.2
  • provisioning_api: 0.5.0
  • systemtags: 0.3.0
  • templateeditor: 0.4.0
  • updatenotification: 0.2.1
    Disabled:
  • admin_audit
  • announcementcenter
  • customgroups
  • encryption
  • enterprise_key
  • external
  • files_antivirus
  • files_classifier
  • files_external_dropbox
  • files_external_ftp
  • files_ldap_home
  • firewall
  • guests
  • oauth2
  • password_policy
  • ransomware_protection
  • sharepoint
  • systemtags_management
  • theme-enterprise
  • twofactor_totp
  • user_external
  • user_ldap
  • user_shibboleth
  • windows_network_drive
  • wopi
  • workflow

Are you using external storage, if yes which one: local/smb/sftp/…
No

Are you using encryption: yes/no
No

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/…
No

Client configuration

Browser:
Chrome

Operating system:
Windows 10

Logs

Web server error log

2020/09/21 09:43:29 [warn] 1012#1012: “ssl_stapling” ignored, host not found in OCSP responder “zerossl.ocsp.sectigo.com” in the certificate “/etc/ssl/nginx/owncloud_certificate.crt”
2020/09/21 09:43:29 [warn] 1104#1104: “ssl_stapling” ignored, host not found in OCSP responder “zerossl.ocsp.sectigo.com” in the certificate “/etc/ssl/nginx/owncloud_certificate.crt”
2020/09/21 22:35:51 [warn] 1015#1015: “ssl_stapling” ignored, host not found in OCSP responder “zerossl.ocsp.sectigo.com” in the certificate “/etc/ssl/nginx/owncloud_certificate.crt”
2020/09/21 22:35:51 [warn] 1097#1097: “ssl_stapling” ignored, host not found in OCSP responder “zerossl.ocsp.sectigo.com” in the certificate “/etc/ssl/nginx/owncloud_certificate.crt”

ownCloud log (data/owncloud.log)

{“reqId”:“QytADjV00CzWDVOuk4cF”,“level”:3,“time”:“2020-08-28T20:46:15+00:00”,“remoteAddr”:“84.236.21.83”,“user”:"–",“app”:“no app in context”,“method”:“GET”,“url”:"/s/Sut5vCikYwaQAUP/download?path=%2F&files=VID_20200828_161233927.mp4",“message”:“Exception: {“Exception”:“RuntimeException”,“Message”:“Connection lost. Status: 1”,“Code”:0,“Trace”:”#0 \/mnt\/documents\/www\/owncloud\/lib\/private\/Files\/View.php(509): OC\\Files\\View->checkConnectionStatus()\n#1 \/mnt\/documents\/www\/owncloud\/lib\/private\/legacy\/files.php(295): OC\\Files\\View->readfilePart(’\/Photos\/Ovis ba…’, ‘0’, 441101790)\n#2 \/mnt\/documents\/www\/owncloud\/lib\/private\/legacy\/files.php(114): OC_Files::getSingleFile(Object(OC\\Files\\View), ‘\/Photos\/Ovis ba…’, ‘VID_20200828_16…’, Array)\n#3 \/mnt\/documents\/www\/owncloud\/apps\/files_sharing\/lib\/Controllers\/ShareController.php(536): OC_Files::get(’\/Photos\/Ovis ba…’, ‘VID_20200828_16…’, Array)\n#4 \/mnt\/documents\/www\/owncloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(153): OCA\\Files_Sharing\\Controllers\\ShareController->downloadShare(‘Sut5vCikYwaQAUP’, ‘VID_20200828_16…’, ‘\/’, ‘’)\n#5 \/mnt\/documents\/www\/owncloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(85): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\Files_Sharing\\Controllers\\ShareController), ‘downloadShare’)\n#6 \/mnt\/documents\/www\/owncloud\/lib\/private\/AppFramework\/App.php(100): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\Files_Sharing\\Controllers\\ShareController), ‘downloadShare’)\n#7 \/mnt\/documents\/www\/owncloud\/lib\/public\/AppFramework\/App.php(132): OC\\AppFramework\\App::main(‘ShareController’, ‘downloadShare’, Object(OC\\AppFramework\\DependencyInjection\\DIContainer))\n#8 \/mnt\/documents\/www\/owncloud\/core\/routes.php(120): OCP\\AppFramework\\App->dispatch(‘ShareController’, ‘downloadShare’)\n#9 \/mnt\/documents\/www\/owncloud\/lib\/private\/Route\/Router.php(342): OC\\Route\\Router->{closure}(*** sensitive parameters replaced )\n#10 \/mnt\/documents\/www\/owncloud\/lib\/base.php(916): OC\\Route\\Router->match(’\/s\/Sut5vCikYwaQ…’)\n#11 \/mnt\/documents\/www\/owncloud\/index.php(54): OC::handleRequest()\n#12 {main}",“File”:"\/mnt\/documents\/www\/owncloud\/lib\/private\/Files\/View.php",“Line”:2276}"}
{“reqId”:“SBuOhkaUiFZBJbPx2RoD”,“level”:3,“time”:“2020-08-28T20:46:17+00:00”,“remoteAddr”:“84.236.21.83”,“user”:"–",“app”:“no app in context”,“method”:“GET”,“url”:"/s/Sut5vCikYwaQAUP/download?path=%2F&files=VID_20200828_161409934.mp4",“message”:“Exception: {“Exception”:“RuntimeException”,“Message”:“Connection lost. Status: 1”,“Code”:0,“Trace”:”#0 \/mnt\/documents\/www\/owncloud\/lib\/private\/Files\/View.php(509): OC\\Files\\View->checkConnectionStatus()\n#1 \/mnt\/documents\/www\/owncloud\/lib\/private\/legacy\/files.php(295): OC\\Files\\View->readfilePart(’\/Photos\/Ovis ba…’, ‘0’, 834608334)\n#2 \/mnt\/documents\/www\/owncloud\/lib\/private\/legacy\/files.php(114): OC_Files::getSingleFile(Object(OC\\Files\\View), ‘\/Photos\/Ovis ba…’, ‘VID_20200828_16…’, Array)\n#3 \/mnt\/documents\/www\/owncloud\/apps\/files_sharing\/lib\/Controllers\/ShareController.php(536): OC_Files::get(’\/Photos\/Ovis ba…’, ‘VID_20200828_16…’, Array)\n#4 \/mnt\/documents\/www\/owncloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(153): OCA\\Files_Sharing\\Controllers\\ShareController->downloadShare(‘Sut5vCikYwaQAUP’, ‘VID_20200828_16…’, ‘\/’, ‘’)\n#5 \/mnt\/documents\/www\/owncloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(85): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\Files_Sharing\\Controllers\\ShareController), ‘downloadShare’)\n#6 \/mnt\/documents\/www\/owncloud\/lib\/private\/AppFramework\/App.php(100): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\Files_Sharing\\Controllers\\ShareController), ‘downloadShare’)\n#7 \/mnt\/documents\/www\/owncloud\/lib\/public\/AppFramework\/App.php(132): OC\\AppFramework\\App::main(‘ShareController’, ‘downloadShare’, Object(OC\\AppFramework\\DependencyInjection\\DIContainer))\n#8 \/mnt\/documents\/www\/owncloud\/core\/routes.php(120): OCP\\AppFramework\\App->dispatch(‘ShareController’, ‘downloadShare’)\n#9 \/mnt\/documents\/www\/owncloud\/lib\/private\/Route\/Router.php(342): OC\\Route\\Router->{closure}(
sensitive parameters replaced )\n#10 \/mnt\/documents\/www\/owncloud\/lib\/base.php(916): OC\\Route\\Router->match(’\/s\/Sut5vCikYwaQ…’)\n#11 \/mnt\/documents\/www\/owncloud\/index.php(54): OC::handleRequest()\n#12 {main}",“File”:"\/mnt\/documents\/www\/owncloud\/lib\/private\/Files\/View.php",“Line”:2276}"}
{“reqId”:“IBp9Tf13CBNFdkHs2pIA”,“level”:3,“time”:“2020-08-28T20:46:28+00:00”,“remoteAddr”:“84.236.21.83”,“user”:"–",“app”:“no app in context”,“method”:“GET”,“url”:"/s/Sut5vCikYwaQAUP/download?path=%2F&files=VID_20200828_162942758.mp4",“message”:“Exception: {“Exception”:“RuntimeException”,“Message”:“Connection lost. Status: 1”,“Code”:0,“Trace”:”#0 \/mnt\/documents\/www\/owncloud\/lib\/private\/Files\/View.php(509): OC\\Files\\View->checkConnectionStatus()\n#1 \/mnt\/documents\/www\/owncloud\/lib\/private\/legacy\/files.php(295): OC\\Files\\View->readfilePart(’\/Photos\/Ovis ba…’, ‘0’, 815255163)\n#2 \/mnt\/documents\/www\/owncloud\/lib\/private\/legacy\/files.php(114): OC_Files::getSingleFile(Object(OC\\Files\\View), ‘\/Photos\/Ovis ba…’, ‘VID_20200828_16…’, Array)\n#3 \/mnt\/documents\/www\/owncloud\/apps\/files_sharing\/lib\/Controllers\/ShareController.php(536): OC_Files::get(’\/Photos\/Ovis ba…’, ‘VID_20200828_16…’, Array)\n#4 \/mnt\/documents\/www\/owncloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(153): OCA\\Files_Sharing\\Controllers\\ShareController->downloadShare(‘Sut5vCikYwaQAUP’, ‘VID_20200828_16…’, ‘\/’, ‘’)\n#5 \/mnt\/documents\/www\/owncloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(85): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\Files_Sharing\\Controllers\\ShareController), ‘downloadShare’)\n#6 \/mnt\/documents\/www\/owncloud\/lib\/private\/AppFramework\/App.php(100): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\Files_Sharing\\Controllers\\ShareController), ‘downloadShare’)\n#7 \/mnt\/documents\/www\/owncloud\/lib\/public\/AppFramework\/App.php(132): OC\\AppFramework\\App::main(‘ShareController’, ‘downloadShare’, Object(OC\\AppFramework\\DependencyInjection\\DIContainer))\n#8 \/mnt\/documents\/www\/owncloud\/core\/routes.php(120): OCP\\AppFramework\\App->dispatch(‘ShareController’, ‘downloadShare’)\n#9 \/mnt\/documents\/www\/owncloud\/lib\/private\/Route\/Router.php(342): OC\\Route\\Router->{closure}(
sensitive parameters replaced ***)\n#10 \/mnt\/documents\/www\/owncloud\/lib\/base.php(916): OC\\Route\\Router->match(’\/s\/Sut5vCikYwaQ…’)\n#11 \/mnt\/documents\/www\/owncloud\/index.php(54): OC::handleRequest()\n#12 {main}",“File”:"\/mnt\/documents\/www\/owncloud\/lib\/private\/Files\/View.php",“Line”:2276}"}

Browser log

Insert your browser log here, this could for example include:

Hey,

i think this is a classical administrative task you can solve by redirecting the cron output to a file like e.g.:

* * * * * /usr/bin/php -f /var/www/owncloud/occ system:cron >> /var/log/php-cron.log 2>> /var/log/php-cron.error.log

Hi, thanks for the hint. Well, I have already removed the cron config yesterday but it keeps sending the mail. That was the reason I turned to the community because I ran out of ideas. I have also switched the mechanism from cron to Ajax in admin page, but didn’t help either. I have no idea left what mechanism sends this email. But I don’t want to turn off email sending completely if it’s possible to fix this issue somehow.

Hey,

i think the system cron tool is sending out these mails (which i think means that you haven’t fully removed the cron config).

From what i have read Ajax cron is discouraged because it is slow and only running if some one is browsing the Web GUI of ownCloud.

Personally i would try to configure the existing cron with my suggestion and the mails should disappear.

1 Like

Alternatively to tom42’s suggestion you could add
MAILTO=""
to the first line of your crontab file, this should supress email sending for this job at all

bdevay
I have already removed the cron config yesterday but it keeps sending the mail.

Is it possible you are running multiple cron jobs? Try to find out by

  • searching /etc/cron*
  • calling sudo crontab -u root -l
  • calling sudo crontab -u www-data -l
1 Like

How about the contents of such a mail? Could you post it also?

Hi, this is the only content, nothing else:
“Could not open input file: /path/to/your/owncloud/occ”
I didn’t make any change in the text, so the path is exactly what I copied.

Here is the content of the /etc/cron.d:

drwxr-xr-x 2 root root 4096 szept 22 15:05 ./
drwxr-xr-x 151 root root 12288 szept 21 22:34 …/
-rw-r–r-- 1 root root 285 máj 29 2017 anacron
-rw-r–r-- 1 root root 176 szept 22 15:05 owncloud
-rw-r–r-- 1 root root 712 jan 18 2018 php
-rw-r–r-- 1 root root 102 nov 16 2017 .placeholder
-rw-r–r-- 1 root root 190 febr 26 2020 popularity-contest
-rw-r–r-- 1 root root 396 dec 23 2017 sysstat
-rw-r–r-- 1 root root 52 szept 21 23:24 upsilon

This was the original content of the owncloud file (I’ve changed it according to Tom42’s suggestion):

# crontab -u www-data -e
*/15 * * * * php -f /var/www/owncloud/cron.php

cron.daily, cron.hourly, etc. don’t contain any related entry.

This is the content of the crontab:

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don’t have to run the `crontab’
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
*/5 * * * * root /usr/bin/duckdns.sh >/dev/null 2>&1

And here is the result of the suggested commands (surprise!):

root@server:/etc/cron.d# sudo crontab -u root -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use ‘*’ in these fields (for ‘any’).#
# Notice that tasks will be started based on the cron’s system
# daemon’s notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
@reboot kodi --standalone
root@server:/etc/cron.d# sudo crontab -u www-data -l
*/15 * * * * /usr/bin/php /path/to/your/owncloud/occ system:cron

It seems that you’re right. There should be a cron job defined somewhere. How to locate and fix it?

I’d rather fix the www-data crontab and set the correct path to occ

Your crontab:

*/15 * * * * /usr/bin/php /path/to/your/owncloud/occ system:cron

My crontab reads:

*/15 * * * * /var/www/owncloud/occ system:cron

2 Likes

Oh my god, I learned something new again this day. There is a folder: /var/spool/cron/crontabs
Here, there are some user specific crontabs and the one, which belongs to the www-data user, contained the invalid path.
I need 15 minutes to check if changing the line from

*/15 * * * * /usr/bin/php /path/to/your/owncloud/occ system:corn

to

*/15 * * * * /usr/bin/php /var/www/owncloud/occ system:cron

will help but I have no doubt.

Thanks for everyone. I’m not sure which answer should be marked as the solution because everyone had an added value but cortho’s questions led me to find the root cause so that might be the best hint.

1 Like

/var/spool/cron/crontab is the directory where crontab -e is saving the files (on a per user basis), so this is the same

Actually alfredb lead to the solution - a wrong path to occ in your crontab - since he requested the contents of the cron mails :slight_smile:

2 Likes