Skip to content

Conversation

@spacefreak86
Copy link

Config checks were removed when moving to IBootstrap:
f6bcde7 (Move to IBootstrap initialization and remove the deprecated appinfo/app.php, 2025-04-10)

Due to the missing checks, the Nextcloud log is flooded with error messages (SQL errors) if the configuration is incomplete. This is also if either only the user or group backend is used.

Config checks were removed when moving to IBootstrap:
f6bcde7 (Move to IBootstrap initialization and remove the deprecated appinfo/app.php, 2025-04-10)

Due to the missing checks, the Nextcloud log is flooded with error messages (SQL errors) if
the configuration is incomplete. This is also if either only the user or group backend is used.
@tobybryans
Copy link

I think this (no config checks before using backends) also prevents the app from working if it is not set up, as the DB queries happen even if there is no set up at all. As a result, you get the following error when you install the app for the first time:

TypeError: OC\\DB\\ConnectionFactory::getConnection(): Argument #1 ($type) must be of type string, null given, called in [...]/nextcloud/apps/user_sql/lib/Query/DataQuery.php on line 166 at [...]/nextcloud/lib/private/DB/ConnectionFactory.php#107

I solved it by adding the following as the top of Query/DataQuery.php -> queryEntity and queryEntities functions:

        if ( !isset( $this->properties[DB::DRIVER] ) ) {
            return false;
        }

This is obviously hacky, but it fixes it as it prevents the app from attempting to send queries to the database if there is no Database driver set up. I am not a modern PHP coder or a NC code expert, your solution looks better to me @spacefreak86!

@cweiske
Copy link

cweiske commented Nov 26, 2025

This patch here works for us.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants