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

OCP\AppFramework\QueryException: Could not resolve OCA\BruteForceSettings\Settings\IPWhitelist! Class OCA\BruteForceSettings\Settings\IPWhitelist does not exist #6054

Closed
pr4xx opened this issue Aug 9, 2017 · 12 comments

Comments

@pr4xx
Copy link

pr4xx commented Aug 9, 2017

Steps to reproduce

  1. Fresh nextcloud 12.0.1 docker fpm
  2. Connect laptop (windows 10) client, try to sync/download all files
  3. Get error (see title)
  4. Sync stops with internal server error

Expected behaviour

Normal sync

Actual behaviour

Server gets internal error and stops

@MorrisJobke
Copy link
Member

Could you check the nextcloud.log in your data directory? And give us a list of enabled apps: occ app:list? And the content of the database table oc_appconfig would be nice.

Thanks :)

@pr4xx
Copy link
Author

pr4xx commented Aug 10, 2017

Hey, take a look:
Nextcloud log

occ app:list:

Enabled:
  - activity: 2.5.2
  - comments: 1.2.0
  - dav: 1.3.0
  - federatedfilesharing: 1.2.0
  - federation: 1.2.0
  - files: 1.7.2
  - files_pdfviewer: 1.1.1
  - files_sharing: 1.4.0
  - files_texteditor: 2.4.1
  - files_trashbin: 1.2.0
  - files_versions: 1.5.0
  - files_videoplayer: 1.1.0
  - firstrunwizard: 2.1
  - gallery: 17.0.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.0.0
  - nextcloud_announcements: 1.1
  - notifications: 2.0.0
  - oauth2: 1.0.5
  - password_policy: 1.2.2
  - provisioning_api: 1.2.0
  - serverinfo: 1.2.0
  - sharebymail: 1.2.0
  - survey_client: 1.0.0
  - systemtags: 1.2.0
  - theming: 1.3.0
  - twofactor_backupcodes: 1.1.1
  - updatenotification: 1.2.0
  - workflowengine: 1.2.0
Disabled:
  - admin_audit
  - encryption
  - files_external
  - user_external
  - user_ldap
oc_appconfig: ``` appid,configkey,configvalue activity,enabled,yes activity,installed_version,2.5.2 activity,types,filesystem backgroundjob,lastjob,51 bruteforcesettings,enabled,yes bruteforcesettings,installed_version,1.0.2 bruteforcesettings,types,"" comments,enabled,yes comments,installed_version,1.2.0 comments,types,logging core,backgroundjobs_mode,cron core,installed.bundles,"[""CoreBundle""]" core,installedat,1501975917.0096 core,lastcron,1502346602 core,lastupdateResult,[] core,lastupdatedat,1502347133 core,moveavatarsdone,yes core,oc.integritycheck.checker,[] core,previewsCleanedUp,1 core,public_files,files_sharing/public.php core,public_webdav,dav/appinfo/v1/publicwebdav.php core,scss.variables,656483ad7fa703348219056f06dd4863 core,updater.secret.created,1502119273 core,vendor,nextcloud dav,enabled,yes dav,installed_version,1.3.0 dav,types,filesystem federatedfilesharing,enabled,yes federatedfilesharing,installed_version,1.2.0 federatedfilesharing,types,"" federation,enabled,yes federation,installed_version,1.2.0 federation,types,authentication files,cronjob_scan_files,500 files,enabled,yes files,installed_version,1.7.2 files,types,filesystem files_pdfviewer,enabled,yes files_pdfviewer,installed_version,1.1.1 files_pdfviewer,ocsid,166049 files_pdfviewer,types,"" files_sharing,enabled,yes files_sharing,installed_version,1.4.0 files_sharing,types,filesystem files_texteditor,enabled,yes files_texteditor,installed_version,2.4.1 files_texteditor,ocsid,166051 files_texteditor,types,"" files_trashbin,enabled,yes files_trashbin,installed_version,1.2.0 files_trashbin,types,filesystem files_versions,enabled,yes files_versions,installed_version,1.5.0 files_versions,types,filesystem files_videoplayer,enabled,yes files_videoplayer,installed_version,1.1.0 files_videoplayer,types,"" firstrunwizard,enabled,yes firstrunwizard,installed_version,2.1 firstrunwizard,types,logging gallery,enabled,yes gallery,installed_version,17.0.0 gallery,types,"" keeweb,enabled,no keeweb,installed_version,0.4.0 keeweb,types,"" logreader,enabled,yes logreader,installed_version,2.0.0 logreader,ocsid,170871 logreader,types,"" lookup_server_connector,enabled,yes lookup_server_connector,installed_version,1.0.0 lookup_server_connector,types,authentication nextcloud_announcements,enabled,yes nextcloud_announcements,installed_version,1.1 nextcloud_announcements,pub_date,"Sat, 10 Dec 2016 00:00:00 +0100" nextcloud_announcements,types,logging notifications,enabled,yes notifications,installed_version,2.0.0 notifications,types,logging oauth2,enabled,yes oauth2,installed_version,1.0.5 oauth2,types,authentication password_policy,enabled,yes password_policy,installed_version,1.2.2 password_policy,types,"" provisioning_api,enabled,yes provisioning_api,installed_version,1.2.0 provisioning_api,types,prevent_group_restriction serverinfo,enabled,yes serverinfo,installed_version,1.2.0 serverinfo,types,"" sharebymail,enabled,yes sharebymail,installed_version,1.2.0 sharebymail,types,filesystem survey_client,enabled,yes survey_client,installed_version,1.0.0 survey_client,types,"" systemtags,enabled,yes systemtags,installed_version,1.2.0 systemtags,types,logging theming,cachebuster,1 theming,enabled,yes theming,installed_version,1.3.0 theming,types,logging theming,url,https://xxx twofactor_backupcodes,enabled,yes twofactor_backupcodes,installed_version,1.1.1 twofactor_backupcodes,types,"" updatenotification,bruteforcesettings,1.0.2 updatenotification,enabled,yes updatenotification,installed_version,1.2.0 updatenotification,types,"" updatenotification,update_check_errors,0 workflowengine,enabled,yes workflowengine,installed_version,1.2.0 workflowengine,types,filesystem ```

@MorrisJobke
Copy link
Member

Fresh nextcloud 12.0.1 docker fpm

This needs to be something else. In 12.0.1 this is not a problem, because we catch this exception:

} catch (QueryException $e) {

Where did you fetched the container from? I just checked it and this could not be caused with this stack trace by the container, because it contains the failsafe:

$ docker run -ti nextcloud:12.0.1-fpm bash
# tail -n 15 /var/www/html/lib/private/Settings/Manager.php 
		foreach ($dbRows as $row) {
			if (!isset($settings[$row['priority']])) {
				$settings[$row['priority']] = [];
			}
			try {
				$settings[$row['priority']][] = $this->query($row['class']);
			} catch (QueryException $e) {
				// skip
			}
		}

		ksort($settings);
		return $settings;
	}
}

@pr4xx
Copy link
Author

pr4xx commented Aug 10, 2017

I set up the nextcloud installation with the official docker image a few days ago when it was at version 12.0.0. Then I got an update notification and pulled the new image and did a docker-compose down/up. Then the upgrade page appeared and the upgrade succeded.

@MorrisJobke
Copy link
Member

This then seems to be a problem with the docker image. Please report it in that repo: https://github.com/nextcloud/docker - cc @tilosp

@pr4xx
Copy link
Author

pr4xx commented Aug 10, 2017

Well when I do the command you provided in my container tail -n 15 /var/www/html/lib/private/Settings/Manager.php, I get the same output. So the catch is there.

@vaclavhorejsi
Copy link

Hi, i dont think so, that this bug is only in docker image. I am using non docker version 12.0.0 updated recently to 12.0.1 and after that update I have this bug in log file.

So for me this is not closed.

OCP\AppFramework\QueryException: Could not resolve OCA\BruteForceSettings\Settings\IPWhitelist! Class OCA\BruteForceSettings\Settings\IPWhitelist does not exist/var/www/lib/private/AppFramework/Utility/SimpleContainer.php - line 117: OC\AppFramework\Utility\SimpleContainer->resolve('OCA\BruteForceS...')/var/www/lib/private/ServerContainer.php - line 132: OC\AppFramework\Utility\SimpleContainer->query('OCA\BruteForceS...')/var/www/lib/private/Settings/Manager.php - line 261: OC\ServerContainer->query('OCA\BruteForceS...')/var/www/lib/private/Settings/Manager.php - line 352: OC\Settings\Manager->query('OCA\BruteForceS...')/var/www/settings/Controller/AdminSettingsController.php - line 138: OC\Settings\Manager->getAdminSettings('security')/var/www/settings/Controller/AdminSettingsController.php - line 72: OC\Settings\Controller\AdminSettingsController->getNavigationParameters('logging')[internal function] OC\Settings\Controller\AdminSettingsController->index('logging')/var/www/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array)/var/www/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OC\Settings\Controller\AdminSettingsController), 'index')/var/www/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OC\Settings\Controller\AdminSettingsController), 'index')/var/www/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main('OC\Settings\Con...', 'index', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)[internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)/var/www/lib/private/Route/Router.php - line 299: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)/var/www/lib/base.php - line 1004: OC\Route\Router->match('/settings/admin...')/var/www/index.php - line 48: OC handleRequest(){main}
--

@danimo
Copy link
Contributor

danimo commented Aug 12, 2017

Absolutely not a Docker problem:

/srv/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php - line 117: OC\AppFramework\Utility\SimpleContainer->resolve('OCA\\BruteForceS...')
/srv/nextcloud/lib/private/ServerContainer.php - line 132: OC\AppFramework\Utility\SimpleContainer->query('OCA\\BruteForceS...')
/srv/nextcloud/lib/private/Settings/Manager.php - line 261: OC\ServerContainer->query('OCA\\BruteForceS...')
/srv/nextcloud/lib/private/Settings/Manager.php - line 352: OC\Settings\Manager->query('OCA\\BruteForceS...')
/srv/nextcloud/settings/Controller/AdminSettingsController.php - line 138: OC\Settings\Manager->getAdminSettings('security')
/srv/nextcloud/settings/Controller/AdminSettingsController.php - line 72: OC\Settings\Controller\AdminSettingsController->getNavigationParameters('externalstorage...')
[internal function] OC\Settings\Controller\AdminSettingsController->index('externalstorage...')
/srv/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array)
/srv/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OC\Settings\Controller\AdminSettingsController), 'index')
/srv/nextcloud/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OC\Settings\Controller\AdminSettingsController), 'index')
/srv/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main('OC\\Settings\\Con...', 'index', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
[internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
/srv/nextcloud/lib/private/Route/Router.php - line 299: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
/srv/nextcloud/lib/base.php - line 1000: OC\Route\Router->match('/settings/admin...')
/srv/nextcloud/index.php - line 40: OC handleRequest()
{main}

@danimo
Copy link
Contributor

danimo commented Aug 12, 2017

/srv/nextcloud/lib/private/Settings/Manager.php - line 352: OC\Settings\Manager->query('OCA\\BruteForceS...')

contains the failsafe, BUT

/srv/nextcloud/lib/private/Settings/Manager.php - line 261: OC\ServerContainer->query('OCA\\BruteForceS...')

does the logging:

try {
        return \OC::$server->query($className);
} catch (QueryException $e) {
        $this->log->logException($e);
        throw $e;
}

Caught too often, I'd say :)

@LukasReschke
Copy link
Member

Nice to see you, @danimo 😉

@FunkyM
Copy link

FunkyM commented Aug 16, 2017

The "oc_admin_settings" table has an entry for class "OCA\BruteForceSettings\Settings\IPWhitelist" in section "security", probably added from a previous install of the BruteForce app. As the corresponding class is only available if the BruteForce app is installed, this currently causes the exception to be triggered repeatingly as long as the app is not installed again.

@MorrisJobke
Copy link
Member

Got it - it is the fallback. It first tries to look it up in the server container and then in the application container.

Duplicate of #5067

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

No branches or pull requests

7 participants