Occ not working after Update to 10.3

Hello,

yesterday I updated to ownCloud 10.3. Since then my server, that is hosting the ownCloud and where I also installed the cronjob, is sending me following error message by mail every 15 minutes (every time it tries to run the cronjob):
Please use ./occ system:cron
sh: ./occ: No such file or directory

Unfortunately I have not been able to find a solution despite a long search. The file exists, but my guess was that it is related to the rights. chmod +x occ did not bring any improvement…

Do you have any ideas what I could do? Many thanks for your help!
Tobi

Server configuration

Operating system: CentOS

Web server: Apache 2.2

Database: MySQL

PHP version: 7.0.33

ownCloud version: 10.3.

Updated from an older ownCloud or fresh install: Updated

Where did you install ownCloud from: Updater

Hello,

could you read this doc and try to use the “correct” syntax ?
For example

sudo -u www-data php occ

Btw be careful PHP7.0 will be dropped by the end of the year, I advise you to upgrade soon.

EDIT: have also a look at that.

2 Likes

Hello,

thank you very much for your quick answer. It was then new occ Comand in the crontab. I should have looked in the doc instead of clicking through the forums. Thanks also for the note about PHP. Then I will try to switch to the current version soon

1 Like

@To34

you’re welcome :wink:
Could you set the thread as solved ?
Thanks.
Cheers !

2 Likes

I had the same, even the ownCloud manual was not descriptive enough for me to figure it out. A simple line with a example config (just as shown here) should do the trick. As I fixed it within 1 minute after reading this thread. And it took me an hour troubleshooting :slight_smile:

2 Likes

Hey @DannyCarlton,

i think there is a serious misunderstanding here.

If i’m understanding this topic correctly there are so many different possibilities to run the occ command line tool depending on the environment but every possibility leads to run it with the permissions of the “owner” of ownCloud (in the example given by @cs35 www-data).

Using sudo is far from being “horrible programming” because i think it is exactly doing what is required:

Running the occ command as the www-data user, see also: https://doc.owncloud.com/server/10.5/admin_manual/configuration/server/occ_command.html#run-occ-as-your-http-user

This is also required for other tools, a quite widely used tool is PostgreSQL on Debian where you need to either switch to the postgres user via sudo or run the psql command as the root user in the name of the postgres user via su.

All in all i think you are also free to change to this user with other means like using su or directly logging in with this user via SSH and similar as long as you’re running the command as the correct user.

As a package running on a server, the owner should never, ever be required to manipulate the server at the terminal level, especially as the super user. It should be installable from the web and manageable from the web. A server level program is quite a different thing from an installable web package. I’ve created installable web packages and I used Wordpress and phpBB as my guideline for how involved an owner would need to be with the server. I’m finding a lot of bugs creeping into owncloud and this is one of the more worrisome ones. If this can’t be solve through the web interface, then it is bad programming.

Hey,

if you think this is bad programming and if you have suggestions to not do “bad programming” maybe then i think you could discuss this with the ownCloud people at https://github.com/owncloud/core/issues :slight_smile:

But AFAIK cron doesn’t need to be running on at all on command line, you could still use the other cron methods which doesn’t require command line access. From what i know these are not that good / performant like the cron command line but could still fit for your use case.

Related to the mentioned phpBB previously i think the same would be required if you are using the command line tool of phpBB:

https://area51.phpbb.com/docs/dev/3.2.x/cli/getting_started.html

I think this would require running sudo or similar on the command line as well.

Sorry, forgot to mention that i personally don’t have any problem if a web application is providing optional command line tools and i don’t share the opinion that a web application needs to be running purely from the web interface just because it is a web application.

There seems to be other very popular projects like phpBB, Piwik/Matomo and Roundcube providing such a command line interface similar to the one of ownCloud so i think there could be a reason for it?

But i must admin that i’m just a non-expert (stupid?) user and don’t have much knowledge around this topic. :frowning:

I’ve used phpBB as well as Piwik/Matomo and never had to use command line interface. There’s a difference between allowing it and requiring it. In this case it seems a bug has appeared in which command line at root level, is required.

Oh, and thanks to whoever flagged this as off topic, when I am addressing the very problem mentioned by the original poster. Way to censor guys.I guess that’s the way to cover flaws and bugs, just censor anyone who points them out.

Hey,

i don’t think that running ./occ system:cron is absolutely mandatory to run this on command line.

As previously mentioned i had read in the past this is purely optional and you still can use the default AJAX cron variant but need to accept it’s drawback:

https://doc.owncloud.com/server/admin_manual/configuration/server/background_jobs_configuration.html#ajax

Yes, the main drawback would be having to visit the site at least once a day to trigger the AJAX cron. A serious flaw. But it the ajax cron works without requiring system root access, why would the regular cron require it?

Hey,

i don’t think that the regular cron require root access:

Personally on my own ownCloud installation i have e.g. added the regular cron to the crontab of the www-data user so that the regular cron is running as the required HTTP user.

This seems to be the recommended way in the ownCloud documentation as well:

https://doc.owncloud.com/server/admin_manual/configuration/server/background_jobs_configuration.html#cron

That’s the whole point of this post. The cron is requiring root level systems access, thus the need for sudo.

Hey,

i still think that cron isn’t requiring root level system access as long as you have access permissions for the HTTP user (e.g. via the shared hosting panel, direct SSH access to the HTTP use and similar).

Obviously the user just registered to revive an old thread and to complain about the system architecture with uneducated guesses.

Insulting the developers with wrong assumptions and speaking of “web packages” and “server level programs” speaks a clear language to me.

Don’t feed the troll.

2 Likes