Problem with cron.php


#1

Steps to reproduce

  1. I run the following command and cron still does not work
    crontab -u www-data -e
          • / usr / bin / php -f /path/to/your/owncloud/cron.php
  1. I try to do it manually but it does not work either
    sudo -u www-data php -f /var/www/owncloud/cron.php

“PHP Warning: require_once(): open_basedir restriction in effect. File(/var/www/owncloud/lib/base.php) is not within the allowed path(s): (/dev/urandom) in /var/www/owncloud/cron.php on line 36
PHP Warning: require_once(/var/www/owncloud/lib/base.php): failed to open stream: Operation not permitted in /var/www/owncloud/cron.php on line 36
PHP Fatal error: require_once(): Failed opening required ‘/var/www/owncloud/lib/base.php’ (include_path=’.:/usr/share/pear’) in /var/www/owncloud/cron.php on line 36”

  1. Executing this command I also get the same error
    su -s /bin/bash -c ‘/usr/bin/php -f /var/www/owncloud/cron.php’ www-data

PHP Warning: require_once(): open_basedir restriction in effect. File(/var/www/owncloud/lib/base.php) is not within the allowed path(s): (/dev/urandom) in /var/www/owncloud/cron.php on line 36
PHP Warning: require_once(/var/www/owncloud/lib/base.php): failed to open stream: Operation not permitted in /var/www/owncloud/cron.php on line 36
PHP Fatal error: require_once(): Failed opening required ‘/var/www/owncloud/lib/base.php’ (include_path=’.:/usr/share/pear’) in /var/www/owncloud/cron.php on line 36

Expected behaviour

I was expecting cron to work

Actual behaviour

it still does not work cron

Server configuration

Operating system: Debian GNU/Linux 9

Web server: Apache2

Database: MYSQL

PHP version: 0.7

ownCloud version: 10.0.8

Updated from an older ownCloud or fresh install: NO

Where did you install ownCloud from: The server terminal debian

Signing status (ownCloud 9.0 and above):

https://gist.github.com/asir214/1edc41e5e2b36c744528de543d8fefae

The content of config/config.php:

<?php
$CONFIG = array (
  'updatechecker' => false,
  'instanceid' => 'oc4knmolaxdj',
  'passwordsalt' => '****************',
  'secret' => '*****************',
  'trusted_domains' => 
  array (
    0 => '192.168.55.215',
  ),
  'datadirectory' => '/var/www/owncloud/data',
  'overwrite.cli.url' => 'http://192.168.55.215/owncloud',
  'dbtype' => 'mysql',
  'version' => '10.0.8.5',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_sistemas2',
  'dbpassword' => '***********************',
  'logtimezone' => 'UTC',
  'installed' => true,
  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'ldapIgnoreNamingRules' => false,
  'debug' => false,
  'loglevel' => 0,
  'enable_previews' => false,
  'logtimezone' => 'Europe/Madrid',
);

List of activated apps:

PHP Warning:  require_once(): open_basedir restriction in effect. File(/var/www/owncloud/console.php) is not within the allowed path(s): (/dev/urandom) in /var/www/owncloud/occ on line 11
PHP Warning:  require_once(/var/www/owncloud/console.php): failed to open stream: Operation not permitted in /var/www/owncloud/occ on line 11
PHP Fatal error:  require_once(): Failed opening required '/var/www/owncloud/console.php' (include_path='.:/usr/share/pear') in /var/www/owncloud/occ on line 11

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

Are you using encryption: no

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

LDAP configuration (delete this part if not used)

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your ownCloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

{"reqId":"XfhVJLOXLm7DAwRDgkKw","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"core","method":"POST","url":"\/index.php\/login?user=maider","message":"Login failed: 'maider' (Remote IP: '192.168.50.180')"}
{"reqId":"ze7G7OyqkPnsxNgEge22","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/login?user=maider","message":"Configuration Error (prefix ): No LDAP Login Filter given!"}
{"reqId":"ze7G7OyqkPnsxNgEge22","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/login?user=maider","message":"Configuration Error (prefix ): login filter does not contain %uid place holder."}
{"reqId":"ze7G7OyqkPnsxNgEge22","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/login?user=maider","message":"Configuration Error (prefix ): No LDAP Login Filter given!"}
{"reqId":"ze7G7OyqkPnsxNgEge22","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/login?user=maider","message":"Configuration Error (prefix ): login filter does not contain %uid place holder."}
{"reqId":"ze7G7OyqkPnsxNgEge22","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/login?user=maider","message":"Configuration Error (prefix s01): No LDAP Host given!"}
{"reqId":"ze7G7OyqkPnsxNgEge22","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/login?user=maider","message":"Configuration Error (prefix s01): No LDAP Login Filter given!"}
{"reqId":"ze7G7OyqkPnsxNgEge22","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/login?user=maider","message":"Configuration Error (prefix s01): login filter does not contain %uid place holder."}
{"reqId":"ze7G7OyqkPnsxNgEge22","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/login?user=maider","message":"Configuration Error (prefix s01): No LDAP Host given!"}
{"reqId":"ze7G7OyqkPnsxNgEge22","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/login?user=maider","message":"Configuration Error (prefix s01): No LDAP Login Filter given!"}
{"reqId":"ze7G7OyqkPnsxNgEge22","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/login?user=maider","message":"Configuration Error (prefix s01): login filter does not contain %uid place holder."}
{"reqId":"ze7G7OyqkPnsxNgEge22","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/login?user=maider","message":"Configuration Error (prefix ): No LDAP Login Filter given!"}
{"reqId":"ze7G7OyqkPnsxNgEge22","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/login?user=maider","message":"Configuration Error (prefix ): login filter does not contain %uid place holder."}
{"reqId":"ze7G7OyqkPnsxNgEge22","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/login?user=maider","message":"Configuration Error (prefix s01): No LDAP Host given!"}
{"reqId":"ze7G7OyqkPnsxNgEge22","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/login?user=maider","message":"Configuration Error (prefix s01): No LDAP Login Filter given!"}
{"reqId":"ze7G7OyqkPnsxNgEge22","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/login?user=maider","message":"Configuration Error (prefix s01): login filter does not contain %uid place holder."}
{"reqId":"MqCmTzzt5SCLOURRggFG","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=f21fc98a37aaed336e9efdbd9ad0ee75","message":"Configuration Error (prefix ): No LDAP Login Filter given!"}
{"reqId":"MqCmTzzt5SCLOURRggFG","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=f21fc98a37aaed336e9efdbd9ad0ee75","message":"Configuration Error (prefix ): login filter does not contain %uid place holder."}
{"reqId":"MqCmTzzt5SCLOURRggFG","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=f21fc98a37aaed336e9efdbd9ad0ee75","message":"Configuration Error (prefix ): No LDAP Login Filter given!"}
{"reqId":"MqCmTzzt5SCLOURRggFG","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=f21fc98a37aaed336e9efdbd9ad0ee75","message":"Configuration Error (prefix ): login filter does not contain %uid place holder."}
{"reqId":"MqCmTzzt5SCLOURRggFG","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=f21fc98a37aaed336e9efdbd9ad0ee75","message":"Configuration Error (prefix s01): No LDAP Host given!"}
{"reqId":"MqCmTzzt5SCLOURRggFG","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=f21fc98a37aaed336e9efdbd9ad0ee75","message":"Configuration Error (prefix s01): No LDAP Login Filter given!"}
{"reqId":"MqCmTzzt5SCLOURRggFG","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=f21fc98a37aaed336e9efdbd9ad0ee75","message":"Configuration Error (prefix s01): login filter does not contain %uid place holder."}
{"reqId":"MqCmTzzt5SCLOURRggFG","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=f21fc98a37aaed336e9efdbd9ad0ee75","message":"Configuration Error (prefix s01): No LDAP Host given!"}
{"reqId":"MqCmTzzt5SCLOURRggFG","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=f21fc98a37aaed336e9efdbd9ad0ee75","message":"Configuration Error (prefix s01): No LDAP Login Filter given!"}
{"reqId":"MqCmTzzt5SCLOURRggFG","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=f21fc98a37aaed336e9efdbd9ad0ee75","message":"Configuration Error (prefix s01): login filter does not contain %uid place holder."}
{"reqId":"MqCmTzzt5SCLOURRggFG","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=f21fc98a37aaed336e9efdbd9ad0ee75","message":"Configuration Error (prefix ): No LDAP Login Filter given!"}
{"reqId":"MqCmTzzt5SCLOURRggFG","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=f21fc98a37aaed336e9efdbd9ad0ee75","message":"Configuration Error (prefix ): login filter does not contain %uid place holder."}
{"reqId":"MqCmTzzt5SCLOURRggFG","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=f21fc98a37aaed336e9efdbd9ad0ee75","message":"Configuration Error (prefix s01): No LDAP Host given!"}
{"reqId":"MqCmTzzt5SCLOURRggFG","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=f21fc98a37aaed336e9efdbd9ad0ee75","message":"Configuration Error (prefix s01): No LDAP Login Filter given!"}
{"reqId":"MqCmTzzt5SCLOURRggFG","level":2,"time":"2018-06-07T17:15:03+02:00","remoteAddr":"192.168.50.180","user":"--","app":"user_ldap","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=f21fc98a37aaed336e9efdbd9ad0ee75","message":"Configuration Error (prefix s01): login filter does not contain %uid place holder."}
{"reqId":"JJ8tGg0Z4PKPjYj1yZ1B","level":2,"time":"2018-06-08T17:53:45+02:00","remoteAddr":"192.168.50.141","user":"--","app":"core","method":"POST","url":"\/index.php\/login","message":"Login failed: 'daniel' (Remote IP: '192.168.50.141')"}
{"reqId":"oU5AqYY9JfPgGMPm93QN","level":3,"time":"2018-06-08T17:53:50+02:00","remoteAddr":"192.168.50.141","user":"--","app":"core","method":"POST","url":"\/index.php\/lostpassword\/email","message":"Could not send reset email because User does not exist. User: daniel"}
{"reqId":"zPbKx2vSE3r9AAI0cKCJ","level":1,"time":"2018-06-11T09:21:31+02:00","remoteAddr":"192.168.50.141","user":"sistemas","app":"no app in context","method":"POST","url":"\/index.php\/settings\/users\/users","message":"Creating new account with UID daniel and backend OC\\User\\Database"}
{"reqId":"zPbKx2vSE3r9AAI0cKCJ","level":3,"time":"2018-06-11T09:21:31+02:00","remoteAddr":"192.168.50.141","user":"sistemas","app":"no app in context","method":"POST","url":"\/index.php\/settings\/users\/users","message":"User backend OC\\User\\Database is returning home: \/var\/www\/owncloud\/data\/daniel for user: daniel which differs from existing value: "}
{"reqId":"zPbKx2vSE3r9AAI0cKCJ","level":0,"time":"2018-06-11T09:21:31+02:00","remoteAddr":"192.168.50.141","user":"sistemas","app":"OC\\User\\SyncService","method":"POST","url":"\/index.php\/settings\/users\/users","message":"Setting home for <daniel> to <\/var\/www\/owncloud\/data\/daniel>"}
{"reqId":"zPbKx2vSE3r9AAI0cKCJ","level":0,"time":"2018-06-11T09:21:31+02:00","remoteAddr":"192.168.50.141","user":"sistemas","app":"OC\\User\\SyncService","method":"POST","url":"\/index.php\/settings\/users\/users","message":"Setting displayName for <daniel> to <daniel>"}

Browser log

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

a) The javascript console log
b) The network log 
c) ...

#2

https://doc.owncloud.org/server/latest/admin_manual/installation/installation_wizard.html#post-installation-steps-label

Looks like your file permissions have some problems. Try link that I sent.
Also your owncloud.log is complaining about non-configured user_ldap app configuration.


#3

The problem was that I uncommented the line containing this ““open_basedir”” in the php.ini file.
I have commented again and everything is going well :smile: