core icon indicating copy to clipboard operation
core copied to clipboard

CRON : php -f owncloud/cron.php never completes. app":"PHP","message":"Undefined index: all at apps/files_versions/lib/storage.php#732

Open olivierche opened this issue 10 years ago • 6 comments

Steps to reproduce

  1. Try to manually launch OC CRON as root : /usr/bin/sudo -u apache php -f /var/www/html/owncloud/cron.php or in /etc/crontab : */15 * * * * apache /usr/bin/php -f /var/www/html/owncloud/cron.php >> /var/log/cron_owncloud.log 2>&1

Expected behaviour

Cron tasks should complete

Actual behaviour

php -f /var/www/html/owncloud/cron.php never completes. When launching the cron.php there's error log in owncloud.log concerning apps/files_versions :

{"reqId":"qkwGwP04aFGHMA099lq/","remoteAddr":"","app":"PHP","message":"Undefined index: all at /var/www/html/owncloud/apps/files_versions/lib/storage.php#732","level":3,"time":"2016-03-16T07:49:37+00:00"} {"reqId":"qkwGwP04aFGHMA099lq/","remoteAddr":"","app":"PHP","message":"Undefined index: by_file at /var/www/html/owncloud/apps/files_versions/lib/storage.php#734","level":3,"time":"2016-03-16T07:49:37+00:00"} {"reqId":"qkwGwP04aFGHMA099lq/","remoteAddr":"","app":"PHP","message":"Invalid argument supplied for foreach() at /var/www/html/owncloud/apps/files_versions/lib/storage.php#734","level":3,"time":"2016-03-16T07:49:37+00:00"} {"reqId":"qkwGwP04aFGHMA099lq/","remoteAddr":"","app":"PHP","message":"ksort() expects parameter 1 to be array, null given at /var/www/html/owncloud/apps/files_versions/lib/storage.php#757","level":3,"time":"2016-03-16T07:49:37+00:00"} {"reqId":"qkwGwP04aFGHMA099lq/","remoteAddr":"","app":"PHP","message":"reset() expects parameter 1 to be array, null given at /var/www/html/owncloud/apps/files_versions/lib/storage.php#758","level":3,"time":"2016-03-16T07:49:37+00:00"}

Server configuration

Operating system: CentOS Linux release 7.2.1511 (Core)

Web server: Apache httpd-2.4.6-40.el7.centos.x86_64

Database: mariadb-server-5.5.44

PHP version: php-5.4.16-36.el7_1.x86_64

ownCloud version: (see ownCloud admin page) : owncloud-files-9.0.0-1.1.noarch from isv_ownCloud_community repo (baseurl=http://download.opensuse.org/repositories/isv:/ownCloud:/community/CentOS_CentOS-7/ )

Updated from an older ownCloud or fresh install: upgrade from 8 to 9 with yum update (community repositorie)

Where did you install ownCloud from: http://download.opensuse.org/repositories/isv:/ownCloud:/community/CentOS_CentOS-7/

Signing status (ownCloud 9.0 and above): ownCloud 9.0.0 (stable)

No errors have been found.

List of activated apps:

 sudo -u apache php /var/www/html/owncloud/occ app:list
Enabled:
  - activity: 2.2.1
  - comments: 0.2
  - dav: 0.1.5
  - federatedfilesharing: 0.1.0
  - federation: 0.0.4
  - files: 1.4.4
  - files_pdfviewer: 0.8
  - files_sharing: 0.9.1
  - files_texteditor: 2.1
  - files_trashbin: 0.8.0
  - files_versions: 1.2.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - gallery: 14.5.0
  - notifications: 0.2.3
  - provisioning_api: 0.4.1
  - systemtags: 0.2
  - templateeditor: 0.1
  - updatenotification: 0.1.0
  - user_ldap: 0.8.0
Disabled:
  - encryption
  - external
  - files_external
  - user_external

The content of config/config.php:



{
    "system": {
        "instanceid": "MANUALLY REMOVED SENSITIVE VALUE",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "MANUALLY  REMOVED SENSITIVE VALUE"
        ],
        "datadirectory": "\/data\/dataowncloud\/",
        "overwrite.cli.url": "MANUALLY  REMOVED SENSITIVE VALUE/owncloud",
        "dbtype": "mysql",
        "version": "9.0.0.19",
        "dbname": "ownclouddb",
        "dbhost": "db3-prod.agrocampus-ouest.fr",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "Europe\/Paris",
        "installed": true,
        "ldapIgnoreNamingRules": false,
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "cron_log": true,
        "trashbin_retention_obligation": 7,
        "memcache.local": "\\OC\\Memcache\\APC",
        "default_language": "fr",
        "updatechecker": false
    }
}

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/... LDAP

LDAP configuration (delete this part if not used)



sudo -u apache php /var/www/html/owncloud/occ ldap:show-config
+-------------------------------+-------------------------------------------------------------------------------------------------------+
| Configuration                 |                                                                                                       |
+-------------------------------+-------------------------------------------------------------------------------------------------------+
| hasMemberOfFilterSupport      |                                                                                                       |
| hasPagedResultSupport         |                                                                                                       |
| homeFolderNamingRule          |                                                                                                       |
| lastJpegPhotoLookup           | 0                                                                                                     |
| ldapAgentName                 |  cn=owncloud,ou=gestion,dc=my-org,dc=fr                                                     |
| ldapAgentPassword             | ***                                                                                                   |
| ldapAttributesForGroupSearch  |                                                                                                       |
| ldapAttributesForUserSearch   |                                                                                                       |
| ldapBackupHost                |                                                                                                       |
| ldapBackupPort                |                                                                                                       |
| ldapBase                      | dc=my-org,dc=fr                                                                             |
| ldapBaseGroups                | ou=groups,dc=my-org,dc=fr                                                                   |
| ldapBaseUsers                 | ou=people,dc=my-org,dc=fr                                                                   |
| ldapCacheTTL                  | 600                                                                                                   |
| ldapConfigurationActive       | 1                                                                                                     |
| ldapDynamicGroupMemberURL     |                                                                                                       |
| ldapEmailAttribute            | mail                                                                                                  |
| ldapExperiencedAdmin          | 0                                                                                                     |
| ldapExpertUUIDGroupAttr       |                                                                                                       |
| ldapExpertUUIDUserAttr        | uid                                                                                                   |
| ldapExpertUsernameAttr        |                                                                                                       |
| ldapGroupDisplayName          | cn                                                                                                    |
| ldapGroupFilter               | (&(|(objectclass=posixGroup)))                                                                        |
| ldapGroupFilterGroups         |                                                                                                       |
| ldapGroupFilterMode           | 0                                                                                                     |
| ldapGroupFilterObjectclass    | posixGroup                                                                                            |
| ldapGroupMemberAssocAttr      | memberUid                                                                                             |
| ldapHost                      | ldaps://ldap2.my-org.fr                                                                     |
| ldapIgnoreNamingRules         |                                                                                                       |
| ldapLoginFilter               | (&(objectclass=posixAccount)(|(eduPersonAffiliation=member)(eduPersonAffiliation=student))(uid=%uid)) |
| ldapLoginFilterAttributes     |                                                                                                       |
| ldapLoginFilterEmail          | 0                                                                                                     |
| ldapLoginFilterMode           | 1                                                                                                     |
| ldapLoginFilterUsername       | 1                                                                                                     |
| ldapNestedGroups              | 0                                                                                                     |
| ldapOverrideMainServer        |                                                                                                       |
| ldapPagingSize                | 500                                                                                                   |
| ldapPort                      | 636                                                                                                   |
| ldapQuotaAttribute            |                                                                                                       |
| ldapQuotaDefault              |                                                                                                       |
| ldapTLS                       | 0                                                                                                     |
| ldapUserDisplayName           | displayname                                                                                           |
| ldapUserDisplayName2          |                                                                                                       |
| ldapUserFilter                | (&(objectclass=posixAccount)(|(eduPersonAffiliation=member)(eduPersonAffiliation=student)))           |
| ldapUserFilterGroups          |                                                                                                       |
| ldapUserFilterMode            | 1                                                                                                     |
| ldapUserFilterObjectclass     | posixAccount                                                                                          |
| ldapUuidGroupAttribute        | auto                                                                                                  |
| ldapUuidUserAttribute         | auto                                                                                                  |
| turnOffCertCheck              | 0                                                                                                     |
| useMemberOfToDetectMembership | 1                                                                                                     |
+-------------------------------+-------------------------------------------------------------------------------------------------------+

Client configuration

Browser: Firefox 45

Operating system: : Ubunut 14.04

Logs

Web server error log

No web server error log

ownCloud log (data/owncloud.log)

{"reqId":"qkwGwP04aFGHMA099lq\/","remoteAddr":"","app":"PHP","message":"Undefined index: all at \/var\/www\/html\/owncloud\/apps\/files_versions\/lib\/storage.php#732","level":3,"time":"2016-03-16T07:49:37+00:00"}
{"reqId":"qkwGwP04aFGHMA099lq\/","remoteAddr":"","app":"PHP","message":"Undefined index: by_file at \/var\/www\/html\/owncloud\/apps\/files_versions\/lib\/storage.php#734","level":3,"time":"2016-03-16T07:49:37+00:00"}
{"reqId":"qkwGwP04aFGHMA099lq\/","remoteAddr":"","app":"PHP","message":"Invalid argument supplied for foreach() at \/var\/www\/html\/owncloud\/apps\/files_versions\/lib\/storage.php#734","level":3,"time":"2016-03-16T07:49:37+00:00"}
{"reqId":"qkwGwP04aFGHMA099lq\/","remoteAddr":"","app":"PHP","message":"ksort() expects parameter 1 to be array, null given at \/var\/www\/html\/owncloud\/apps\/files_versions\/lib\/storage.php#757","level":3,"time":"2016-03-16T07:49:37+00:00"}
{"reqId":"qkwGwP04aFGHMA099lq\/","remoteAddr":"","app":"PHP","message":"reset() expects parameter 1 to be array, null given at \/var\/www\/html\/owncloud\/apps\/files_versions\/lib\/storage.php#758","level":3,"time":"2016-03-16T07:49:37+00:00"}

olivierche avatar Mar 16 '16 08:03 olivierche

Got the same error messages in my logfile and too many versions of a file (over total quota of user even). OC Version 8.2.1.4

fireba11 avatar Mar 18 '16 15:03 fireba11

As i'm on a test server i deleted all files_versions and files_trashbin with :

sudo -u apache php /var/www/html/owncloud/occ versions:cleanup sudo -u apache php /var/www/html/owncloud/occ trashbin:cleanup

then : /usr/bin/sudo -u apache php /var/www/html/owncloud/occ files:scan --all

After that i've reactivated the /etc/crontab : */15 * * * * apache /usr/bin/php -f /var/www/html/owncloud/cron.php >> /var/log/cron_owncloud.log 2>&1

The cron produce

{"reqId":"WxSp7sUu7UYYfde6M8iZ","remoteAddr":"","app":"PHP","message":"Undefined index: all at /var/www/html/owncloud/apps/files_versions/lib/storage.php#732","level":3,"time":"2016-03-23T15:48:17+00:00"} {"reqId":"WxSp7sUu7UYYfde6M8iZ","remoteAddr":"","app":"PHP","message":"Undefined index: by_file at /var/www/html/owncloud/apps/files_versions/lib/storage.php#734","level":3,"time":"2016-03-23T15:48:17+00:00"} {"reqId":"WxSp7sUu7UYYfde6M8iZ","remoteAddr":"","app":"PHP","message":"Invalid argument supplied for foreach() at /var/www/html/owncloud/apps/files_versions/lib/storage.php#734","level":3,"time":"2016-03-23T15:48:17+00:00"} {"reqId":"WxSp7sUu7UYYfde6M8iZ","remoteAddr":"","app":"PHP","message":"ksort() expects parameter 1 to be array, null given at /var/www/html/owncloud/apps/files_versions/lib/storage.php#757","level":3,"time":"2016-03-23T15:48:17+00:00"} {"reqId":"WxSp7sUu7UYYfde6M8iZ","remoteAddr":"","app":"PHP","message":"reset() expects parameter 1 to be array, null given at /var/www/html/owncloud/apps/files_versions/lib/storage.php#758","level":3,"time":"2016-03-23T15:48:17+00:00"}

and

{"reqId":"WxSp7sUu7UYYfde6M8iZ","remoteAddr":"","app":"core","message":"Error while running background job (class: OCA\Activity\BackgroundJob\EmailNotification, arguments: ): {"Exception":"Exception","Message":"Session has been closed - no further changes to the session are allowed","Code":0,"Trace":"#0 \/var\/www\/html\/owncloud\/lib\/private\/session\/memory.php(49): OC\Session\Memory->validateSession()\n#1 \/var\/www\/html\/owncloud\/lib\/private\/security\/csrf\/tokenstorage\/sessionstorage.php(63): OC\Session\Memory->set('requesttoken', '0cgP0VIer+p7nlv...')\n#2 \/var\/www\/html\/owncloud\/lib\/private\/security\/csrf\/csrftokenmanager.php(57):

then terminate successfully.

At the next run, cron run without error in owncloud.log

olivierche avatar Mar 23 '16 16:03 olivierche

Similar situation here, after upgrading to 7.0.4+dfsg-4~deb8u1 suddenly cron.php consumed all my main memory (~1.5 GiB). I disabled image preview and image apps and let it continue. Finally, it finished after half a day or so. I hope this was not the regular case.

fungs avatar May 19 '16 17:05 fungs

Got it resolved after running the ooc bin cleanup and files cleanup and running the cronjob manually 2 or 3 times. Now the cron version works, webcron did not ... Not quite sure what the actual cause was but it works now.

fireba11 avatar May 19 '16 19:05 fireba11

Of course, I meant version update to 8.1.8-12.1 on Debian using official packages.

It seems it was my fault turning on the OwnBackup which seems to trigger regular DB backups via cron.php. This can apparently be too much for some machines and doesn't allow to configure the schedule...

fungs avatar May 20 '16 08:05 fungs

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Aug 04 '19 02:08 lock[bot]