Core Apps Check Code returns "App is not compliant"

apps
core

#1

Steps to reproduce

1.Upgraded the owncloud server from the command line

$ sudo -u www-data php occ upgrade

2. Checked all the apps

$ sudo -u www-data php occ app:check-code dav

Expected behaviour

Owncloud's web interface comes and you sign in like normal.

Actual behaviour

Browser gives ERR_TOO_MANY_REDIRECTS.

command line shows:

$ sudo -u www-data php occ app:check-code dav
ownCloud is in maintenance mode - no app have been loaded

Analysing /var/www/owncloud/apps/dav/appinfo/v1/webdav.php
 1 errors
    line   31: OC_Util - Static method of private class must not be called
Analysing /var/www/owncloud/apps/dav/appinfo/v1/publicwebdav.php
 3 errors
    line   32: OC_App - Static method of private class must not be called
    line   34: OC_Util - Static method of private class must not be called
    line   78: OC_Util - Static method of private class must not be called
Analysing /var/www/owncloud/apps/dav/appinfo/Migrations/Version20170202213905.php
 1 errors
    line   87: OC_Util - Static method of private class must not be called
Analysing /var/www/owncloud/apps/dav/appinfo/v2/remote.php
 1 errors
    line   27: OC_Util - Static method of private class must not be called
Analysing /var/www/owncloud/apps/dav/lib/Command/CleanupChunks.php
 2 errors
    line   62: OC_Util - Static method of private class must not be called
    line   63: OC_Util - Static method of private class must not be called
Analysing /var/www/owncloud/apps/dav/lib/Connector/Sabre/Directory.php
 2 errors
    line  260: == - is discouraged
    line  356: OC_Helper - Static method of private class must not be called
Analysing /var/www/owncloud/apps/dav/lib/Connector/Sabre/Node.php
 1 errors
    line  238: OC_Util - Static method of private class must not be called
Analysing /var/www/owncloud/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php
 1 errors
    line  113: OC_User - Static method of private class must not be called
Analysing /var/www/owncloud/apps/dav/lib/Connector/Sabre/ObjectTree.php
 2 errors
    line   81: == - is discouraged
    line   81: == - is discouraged
Analysing /var/www/owncloud/apps/dav/lib/Connector/Sabre/CorsPlugin.php
 2 errors
    line   88: OC_Response - Static method of private class must not be called
    line  105: OC_Response - Static method of private class must not be called
Analysing /var/www/owncloud/apps/dav/lib/Connector/Sabre/Auth.php
 5 errors
    line  119: OC_Util - Static method of private class must not be called
    line  123: OC_Util - Static method of private class must not be called
    line  126: OC_Util - Static method of private class must not be called
    line  225: OC_User - Static method of private class must not be called
    line  232: OC_Util - Static method of private class must not be called
Analysing /var/www/owncloud/apps/dav/lib/Connector/Sabre/File.php
 9 errors
    line  159: OC_Helper - Static method of private class must not be called
    line  179: != - is discouraged
    line  293: OC_Hook - Static method of private class must not be called
    line  303: OC_Hook - Static method of private class must not be called
    line  313: OC_Hook - Static method of private class must not be called
    line  334: OC_Hook - Static method of private class must not be called
    line  338: OC_Hook - Static method of private class must not be called
    line  342: OC_Hook - Static method of private class must not be called
    line  460: != - is discouraged
Analysing /var/www/owncloud/apps/dav/lib/Connector/Sabre/AutorenamePlugin.php
 1 errors
    line   91: OC_Helper - Static method of private class must not be called
Analysing /var/www/owncloud/apps/dav/lib/Connector/PublicAuth.php
 1 errors
    line   93: OC_User - Static method of private class must not be called
Analysing /var/www/owncloud/apps/dav/lib/AppInfo/PluginManager.php
 1 errors
    line  106: OC_App - Static method of private class must not be called
Analysing /var/www/owncloud/apps/dav/lib/DAV/Sharing/Backend.php
 1 errors
    line  173: == - is discouraged
Analysing /var/www/owncloud/apps/dav/lib/CardDAV/CardDavBackend.php
 2 errors
    line  949: == - is discouraged
    line  949: == - is discouraged
Analysing /var/www/owncloud/apps/dav/lib/CalDAV/CalDavBackend.php
 1 errors
    line  979: == - is discouraged
Analysing /var/www/owncloud/apps/dav/lib/Files/BrowserErrorPagePlugin.php
 2 errors
    line   26: OC_Template - private class must not be imported with a use statement
    line   94: OC_Template - private class must not be instantiated
App is not compliant

Server configuration

Operating System: Ubuntu 16.04.4 LTS

Web Server: Apache/2.4.18 (Ubuntu)

Databse: MySQL

PHP Version: PHP 7.0

Owncloud Version: 10.0.7.2

Updated owncloud from a previous install

{
    "system": {
        "updatechecker": false,
        "instanceid": "oc4d25ut7vy4",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
           "***REMOVED SENSITIVE VALUE***",
           "***REMOVED SENSITIVE VALUE***",   
           "***REMOVED SENSITIVE VALUE***",  
           "***REMOVED SENSITIVE VALUE***",
        ],
        "datadirectory": "\/var\/www\/owncloud\/data-iscsi",
        "overwritewebroot": "\/owncloud",
        "overwrite.cli.url": "https:\/\/share.ultratek.com",
        "dbtype": "mysql",
        "version": "10.0.7.2",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "maintenance": true,
        "theme": "",
        "loglevel": "3",
        "htaccess.RewriteBase": "\/",
        "filelocking.enabled": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated apps:

Enabled:
  - comments: 0.3.0
  - dav: 0.3.2
  - external: 1.2
  - federatedfilesharing: 0.3.1
  - federation: 0.1.0
  - files: 1.5.1
  - files_external: 0.7.1
  - files_sharing: 0.10.1
  - files_videoplayer: 0.9.8
  - notifications: 0.3.2
  - theme-example: 1.0.0
Disabled:
  - configreport
  - encryption
  - files_trashbin
  - files_versions
  - firstrunwizard
  - market
  - provisioning_api
  - systemtags
  - templateeditor
  - updatenotification
  - user_external

Using an iscsi drive as storage

No Encryption

Client configuration

Browser: Chrome

Operating system:

Logs

Web server error log

The webserver does not have any erorr logs.

Owncloud Log

ownlcloud log is also not saying anything

#2

I don't think that the app check is related to the redirect issue and i think that this in your config.php

"htaccess.RewriteBase": "\/",

isn't matching this:

"overwritewebroot": "\/owncloud",

Maybe you can find some notes about both and how to configure those on the documentation available at https://doc.owncloud.org/server/latest/admin_manual/ ?


#3

the thing is we had that same config.php configuration working perfectly fine which leads me to believe that that part is not the issue. Also if i put the server in maintenance mode it comes up just fine.

The issue seems to be related to the apps. But it is the core apps that are failing.


#4

I just have run the following command on my ownCloud 10.0.7 instance which is showing the same output like yours (only in a different order):

./occ app:check-code dav


#5

well it is not only that app ... the files sharing app

$sudo -u www-data php occ app:check-code files_sharing
ownCloud is in maintenance mode - no app have been loaded

Analysing /var/www/owncloud/apps/files_sharing/ajax/external.php
 12 errors
    line   29: OCP\JSON - Static method of deprecated class must not be called
    line   30: OCP\JSON - Static method of deprecated class must not be called
    line   31: OCP\JSON - Static method of deprecated class must not be called
    line   40: OCP\JSON - Static method of deprecated class must not be called
    line   52: OCP\Util::isValidFileName - Method of deprecated class must not be called
    line   53: OCP\JSON - Static method of deprecated class must not be called
    line   60: OCP\JSON - Static method of deprecated class must not be called
    line   85: OCP\JSON - Static method of deprecated class must not be called
    line  106: OCP\JSON - Static method of deprecated class must not be called
    line  121: OCP\JSON - Static method of deprecated class must not be called
    line  141: OCP\JSON - Static method of deprecated class must not be called
    line  148: OCP\JSON - Static method of deprecated class must not be called
Analysing /var/www/owncloud/apps/files_sharing/ajax/publicpreview.php
 21 errors
    line   31: OCP\JSON - Static method of deprecated class must not be called
    line   33: OC_User - Static method of private class must not be called
    line   43: OC_Response - Static method of private class must not be called
    line   43: OC_Response - Constant of  class must not not be fetched
    line   52: OC_Response - Static method of private class must not be called
    line   52: OC_Response - Constant of  class must not not be fetched
    line   59: OC_Response - Static method of private class must not be called
    line   59: OC_Response - Constant of  class must not not be fetched
    line   64: OCP\JSON - Static method of deprecated class must not be called
    line   70: OC_Response - Constant of  class must not not be fetched
    line   70: OC_Response - Static method of private class must not be called
    line   80: OC_Response - Static method of private class must not be called
    line   80: OC_Response - Constant of  class must not not be fetched
    line   95: OC_Response - Static method of private class must not be called
    line   95: OC_Response - Constant of  class must not not be fetched
    line  114: OC_Response - Static method of private class must not be called
    line  114: OC_Response - Constant of  class must not not be fetched
    line  117: OC_Response - Static method of private class must not be called
    line  117: OC_Response - Constant of  class must not not be fetched
    line  120: OC_Response - Static method of private class must not be called
    line  120: OC_Response - Constant of  class must not not be fetched
Analysing /var/www/owncloud/apps/files_sharing/ajax/shareinfo.php
 4 errors
    line   32: OCP\JSON - Static method of deprecated class must not be called
    line   35: OC_Response - Static method of private class must not be called
    line   43: OC_Response - Static method of private class must not be called
    line  108: OCP\JSON - Static method of deprecated class must not be called
Analysing /var/www/owncloud/apps/files_sharing/lib/Helper.php
 19 errors
    line   55: OC_User - Static method of private class must not be called
    line   59: OC_Response - Static method of private class must not be called
    line   65: OC_Response - Static method of private class must not be called
    line   73: OCP\JSON - Static method of deprecated class must not be called
    line   74: OC_Util - Static method of private class must not be called
    line   75: OC_Util - Static method of private class must not be called
    line   82: OC_Response - Static method of private class must not be called
    line   83: OCP\JSON - Static method of deprecated class must not be called
    line   89: OC_Response - Static method of private class must not be called
    line   90: OCP\JSON - Static method of deprecated class must not be called
    line   96: OC_Response - Static method of private class must not be called
    line   97: OCP\JSON - Static method of deprecated class must not be called
    line  125: == - is discouraged
    line  173: != - is discouraged
    line  173: User::getUser - Method of deprecated class must not be called
    line  197: OCP\DB - Static method of deprecated class must not be called
    line  221: User::getUser - Method of deprecated class must not be called
    line  224: != - is discouraged
    line  224: User::getUser - Method of deprecated class must not be called
Analysing /var/www/owncloud/apps/files_sharing/lib/Updater.php
 3 errors
    line   98: OCP\User::getUser - Method of deprecated class must not be called
    line   99: OCP\User::getUser - Method of deprecated class must not be called
    line  102: OCP\User::getUser - Method of deprecated class must not be called
Analysing /var/www/owncloud/apps/files_sharing/lib/ShareBackend/Folder.php
 6 errors
    line   52: OCP\User::getDisplayName - Method of deprecated class must not be called
    line   53: OCP\User::getDisplayName - Method of deprecated class must not be called
    line   73: OCP\DB - Static method of deprecated class must not be called
    line   84: OCP\DB - Static method of deprecated class must not be called
    line   93: OCP\DB - Static method of deprecated class must not be called
    line  100: == - is discouraged
Analysing /var/www/owncloud/apps/files_sharing/lib/ShareBackend/File.php
 5 errors
    line  124: == - is discouraged
    line  134: == - is discouraged
    line  157: == - is discouraged
    line  163: == - is discouraged
    line  208: OCP\DB - Static method of deprecated class must not be called
Analysing /var/www/owncloud/apps/files_sharing/lib/Cache.php
 1 errors
    line   86: OC_User - Static method of private class must not be called
Analysing /var/www/owncloud/apps/files_sharing/lib/Controllers/ShareController.php
 10 errors
    line   36: OC_Files - private class must not be imported with a use statement
    line   37: OC_Util - private class must not be imported with a use statement
    line  218: OC_Hook - Static method of private class must not be called
    line  251: OC_User - Static method of private class must not be called
    line  378: OC_User - Static method of private class must not be called
    line  478: OC_Util - Static method of private class must not be called
    line  479: OC_Util - Static method of private class must not be called
    line  496: == - is discouraged
    line  509: OC_Files - Static method of private class must not be called
    line  514: OC_Files - Static method of private class must not be called
Analysing /var/www/owncloud/apps/files_sharing/lib/API/Remote.php
 8 errors
    line   44: OC_User - Static method of private class must not be called
    line   63: OC_User - Static method of private class must not be called
    line   89: OC_User - Static method of private class must not be called
    line  107: OC_User - Static method of private class must not be called
    line  132: OC_User - Static method of private class must not be called
    line  155: OC_User - Static method of private class must not be called
    line  181: OC_User - Static method of private class must not be called
    line  190: OC_User - Static method of private class must not be called
Analysing /var/www/owncloud/apps/files_sharing/lib/External/Manager.php
 1 errors
    line  212: OC_Hook - Static method of private class must not be called
Analysing /var/www/owncloud/apps/files_sharing/public.php
 1 errors
    line   31: OC_Response - Static method of private class must not be called
Analysing /var/www/owncloud/apps/files_sharing/templates/public.php
 1 errors
    line   84: == - is discouraged
Deprecated file found: /var/www/owncloud/apps/files_sharing/appinfo/update.php - please use repair steps
App is not compliant

as well as files_external

$sudo -u www-data php occ app:check-code files_external
ownCloud is in maintenance mode - no app have been loaded

Analysing /var/www/owncloud/apps/files_external/ajax/oauth2.php
 10 errors
    line   29: OC_App - Static method of private class must not be called
    line   32: OCP\JSON - Static method of deprecated class must not be called
    line   33: OCP\JSON - Static method of deprecated class must not be called
    line   34: OCP\JSON - Static method of deprecated class must not be called
    line   48: == - is discouraged
    line   51: OCP\JSON - Static method of deprecated class must not be called
    line   55: OCP\JSON - Static method of deprecated class must not be called
    line   59: == - is discouraged
    line   62: OCP\JSON - Static method of deprecated class must not be called
    line   66: OCP\JSON - Static method of deprecated class must not be called
Analysing /var/www/owncloud/apps/files_external/ajax/applicable.php
 4 errors
    line   24: OCP\JSON - Static method of deprecated class must not be called
    line   25: OCP\JSON - Static method of deprecated class must not be called
    line   27: OCP\JSON - Static method of deprecated class must not be called
    line   54: OCP\JSON - Static method of deprecated class must not be called
Analysing /var/www/owncloud/apps/files_external/lib/Command/Import.php
 2 errors
    line  153: == - is discouraged
    line  154: == - is discouraged
Analysing /var/www/owncloud/apps/files_external/lib/Lib/Storage/AmazonS3.php
 15 errors
    line   39: OC_App - Static method of private class must not be called
    line  196: OCP\Util::logException - Method of deprecated class must not be called
    line  255: OCP\Util::logException - Method of deprecated class must not be called
    line  291: OCP\Util::logException - Method of deprecated class must not be called
    line  322: OCP\Util::logException - Method of deprecated class must not be called
    line  342: OCP\Util::logException - Method of deprecated class must not be called
    line  363: OCP\Util::logException - Method of deprecated class must not be called
    line  376: OCP\Files::tmpFile - Method of deprecated class must not be called
    line  386: OCP\Util::logException - Method of deprecated class must not be called
    line  408: OCP\Files::tmpFile - Method of deprecated class must not be called
    line  459: OCP\Util::logException - Method of deprecated class must not be called
    line  479: OCP\Util::logException - Method of deprecated class must not be called
    line  493: OCP\Util::logException - Method of deprecated class must not be called
    line  598: OCP\Util::logException - Method of deprecated class must not be called
    line  623: OCP\Util::logException - Method of deprecated class must not be called
Analysing /var/www/owncloud/apps/files_external/lib/Lib/Storage/OwnCloud.php
 2 errors
    line   42: == - is discouraged
    line   45: == - is discouraged
Analysing /var/www/owncloud/apps/files_external/lib/Lib/Storage/SMB.php
 3 errors
    line   90: != - is discouraged
    line   93: != - is discouraged
    line  640: OC_Helper - Static method of private class must not be called
Analysing /var/www/owncloud/apps/files_external/lib/Lib/Storage/Google.php
 2 errors
    line   42: OC_App - Static method of private class must not be called
    line  497: OCP\Files::tmpFile - Method of deprecated class must not be called
Analysing /var/www/owncloud/apps/files_external/lib/Lib/Storage/Swift.php
 3 errors
    line  406: OCP\Files::tmpFile - Method of deprecated class must not be called
    line  434: != - is discouraged
    line  642: != - is discouraged
Analysing /var/www/owncloud/apps/files_external/lib/Lib/Storage/SFTP.php
 8 errors
    line  105: != - is discouraged
    line  109: != - is discouraged
    line  131: != - is discouraged
    line  251: == - is discouraged
    line  303: != - is discouraged
    line  303: != - is discouraged
    line  319: == - is discouraged
    line  323: == - is discouraged
Analysing /var/www/owncloud/apps/files_external/templates/settings.php
 4 errors
    line   58: != - is discouraged
    line  103: == - is discouraged
    line  138: == - is discouraged
    line  141: != - is discouraged
App is not compliant

#6

I will try and mess around with the apache config and the web overwrite but I did not think this was the issue. Any other possible ideas?


#7

I just have my console still open and rechecked both apps as well which are showing the same errors as well.


#9

I think you could follow the suggestion / idea about the ownCloud documentation above. For this i did the following search:

https://doc.owncloud.org/server/latest/admin_manual/search.html?q=RewriteBase

and found the following:

https://doc.owncloud.org/server/latest/admin_manual/configuration/server/index_php_less_urls.html?highlight=rewritebase

This has two notes:

  1. The rewrite setup is changed during an ownCloud update which seems to be matching your seen issue
  2. A note about failed access to ownCloud if the options are not configured correctly

Based on the available notes in the documentation you probably need to have a different configuration based on how you're accessing ownCloud.

  1. When accessing via https://example.com

'overwrite.cli.url' => 'https://example.com',
'htaccess.RewriteBase' => '/',
'overwritewebroot' => '',

  1. When accessing via https://example.com/owncloud

'overwrite.cli.url' => 'https://example.com/owncloud',
'htaccess.RewriteBase' => '/owncloud',
'overwritewebroot' => '/owncloud',

I had picked up the overwritewebroot example from the following documentation:

https://doc.owncloud.org/server/latest/admin_manual/configuration/server/config_sample_php_parameters.html?highlight=overwritewebroot#proxy-configurations


#10

According to the documentation it seems that you also need to run "occ maintenance:update:htaccess" when changing the settings.


#11

Okay yes https://doc.owncloud.org/server/latest/admin_manual/configuration/server/index_php_less_urls.html?highlight=rewritebase

solved it for me thank you so much!!!


#12

so now that the URL writes are working correctly I see that some of the apps are crashing the site but now I can just disable them and the site comes backup.

To be exact the market and email template editor crash the site.

So again thank you!