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

New system:cron is generating output when everything is fine #36298

Closed
Faldrian opened this issue Oct 18, 2019 · 13 comments · Fixed by #36304
Closed

New system:cron is generating output when everything is fine #36298

Faldrian opened this issue Oct 18, 2019 · 13 comments · Fixed by #36304
Assignees

Comments

@Faldrian
Copy link

Faldrian commented Oct 18, 2019

Steps to reproduce

  1. Update Owncloud to 10.3
  2. Wait until server executes cron via crontab

Expected behaviour

I should only receive e-mail / notification when a cron could not run or some error happened. If everything was fine, no output should be generated by the cronjob, so nothing is reported by my server.

Actual behaviour

From 10.3 on there is a progress bar that is updated 14 times, generating output.
This progress bar is no error / warning information and should not be output when running as cron job.

Server configuration

Operating system: CentOS 6

Web server: Apache

Database: MySQL

PHP version: 7.2.23

ownCloud version: 10.3

Updated from an older ownCloud or fresh install: Updated from 10.2.something

Where did you install ownCloud from: originally downloaded tar file and extracted.

@Kaelber
Copy link

Kaelber commented Oct 21, 2019

In my case, after installing of v10.3 the cron.php doesn´t run when I schedule a start over system cron. If I copy the cron.php from v10.2.1 it runs as before.

@DeepDiver1975
Copy link
Member

In my case, after installing of v10.3 the cron.php doesn´t run when I schedule a start over system cron. If I copy the cron.php from v10.2.1 it runs as before.

We are moving away from cron.php - please use occ system:cron ...

@DeepDiver1975
Copy link
Member

From 10.3 on there is a progress bar that is updated 14 times, generating output.
This progress bar is no error / warning information and should not be output when running as cron job.

We shall change this .. agreed

@DeepDiver1975 DeepDiver1975 self-assigned this Oct 21, 2019
@Kaelber
Copy link

Kaelber commented Oct 21, 2019

I don´t understand in the right way, because I use the system cron to start the cron.php each 10 minutes with the follow line:

root /bin/su -s /bin/sh -c "/usr/local/bin/php72 -f /volume1/web/owncloud/cron.php" http

Its on a Synology. I don´t understand, what is changed and what I have to modify.

@Kaelber
Copy link

Kaelber commented Oct 21, 2019

So I think, I have to use

root /bin/su -s /bin/sh -c "/usr/local/bin/php72 -f /volume1/web/owncloud/occ system:cron" http

instead of the old command?

@Faldrian
Copy link
Author

The system:cron is also generating a newline https://github.com/owncloud/core/blob/v10.3.0/core/Command/System/Cron.php#L137, this has to be removed as well (for cron execution at least).

@Kaelber
yes, that is what I did and it works

@DeepDiver1975
Copy link
Member

The system:cron is also generating a newline https://github.com/owncloud/core/blob/v10.3.0/core/Command/System/Cron.php#L137, this has to be removed as well (for cron execution at least).

see #36304 - feel free to test ...

@Kaelber
Copy link

Kaelber commented Oct 21, 2019

Thanks a lot, it runs ....

@Faldrian
Copy link
Author

Faldrian commented Oct 21, 2019

@DeepDiver1975 Thanks! Will test this evening. :)

@hub-o-matic
Copy link

I have the same issue as mentioned by Faldrian (with 16 progress bar lines), but also a notice beforehand saying:

The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php

I can’t install that extension because I am running owncloud on a shared host. The cron job is working fine, though. Maybe that notice could be turned off as well?
I tried to add --no-warnings with no success. (I am not experienced with command line stuff, so maybe that’s the reason it didn’t work …?)

@gagan0123
Copy link

Try adding -q as parameter, it quiets the output, and cron runs as expected
Here's my crontab

*  *  *  *  * /usr/bin/php7.3 -f /home/owncloud/somedomainname/htdocs/occ system:cron -q

and this is working fine.

@hub-o-matic
Copy link

Try adding -q as parameter, it quiets the output, and cron runs as expected
Here's my crontab

It only removes the progress bar from the notice but doesn’t mute the notice itself. At least in my case.

@illpillow
Copy link

If anyone is interested in a solution that only filters out the message stated by hub-o-matic (PHP notice about PNCTL), you may want to try the following:
php occ system:cron | grep -v PCNTL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants