owncloud/server:10.13.4 - possible Table Prefix Chaos?
Closed this issue · 1 comments
Steps to reproduce
- Install the Full Text Search Plugin (latest version)
- Run as described in the docs the command in the container
./occ search:index:fillSecondary ... - Quite a lot of exception occur saying that the table xyz cannot be found.
Expected behaviour
the command runs without any problems and actualy enables the full text search for the given account
Actual behaviour
Exceptions occur. Here it seems like that at some point in the history of the application, the tables got a prefix "oc_", but this code still uses the old data model names, therefore it cant find the tables. i already tried to change the table names in the php code, adding the oc_ prefix, but there were quite a lot of them, and after that, i got another execption which might not have anything to do with this problem saying "Your data directory is invalid Please check that the data directory contains a file ".ocdata" in its root".
Server configuration
Operating system:
Raspberry PI 5 - Docker
Web server:
Defined by the Docker image
Database:
MariaDB 10.11.6 (docker)
PHP version:
Defined by the docker image
ownCloud version: (see ownCloud admin page)
10.13.4
Updated from an older ownCloud or fresh install:
Updated from an older version, sorry dont remember which version cause i migrated from an old raspberry to the new one and lost my old docker-compose.yml
Where did you install ownCloud from:
docker hub
Signing status (ownCloud 9.0 and above):
not sure what this is
Login as admin user into your ownCloud and access
http://example.com/index.php/settings/integrity/failed
paste the results into https://gist.github.com/ and puth the link here.
No errors have been found.
The content of config/config.php:
not touched, original from the docker container
Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.
or
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder
*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.
List of activated apps:
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.
Are you using external storage, if yes which one: no
Are you using encryption: no (SSL termination done by an nginx)
Are you using an external user-backend, if yes which one: no
Client configuration
Browser:
not relevant
Operating system:
not relevant
Logs
Web server error log
Insert your webserver log here
ownCloud log (data/owncloud.log)
www-data@16624a8fc0ee:~/owncloud$ ./occ search:index:rebuild RelevanceV2 printer
An unhandled exception has been thrown:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.appconfig' doesn't exist in /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:141
Stack trace:
#0 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(141): PDO->query()
#1 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOQueryImplementation.php(38): Doctrine\DBAL\Driver\PDOConnection->doQuery()
#2 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1309): Doctrine\DBAL\Driver\PDOConnection->query()
#3 /var/www/owncloud/lib/private/DB/Connection.php(191): Doctrine\DBAL\Connection->executeQuery()
#4 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(212): OC\DB\Connection->executeQuery()
#5 /var/www/owncloud/lib/private/DB/QueryBuilder/QueryBuilder.php(141): Doctrine\DBAL\Query\QueryBuilder->execute()
#6 /var/www/owncloud/lib/private/AppConfig.php(312): OC\DB\QueryBuilder\QueryBuilder->execute()
#7 /var/www/owncloud/lib/private/AppConfig.php(80): OC\AppConfig->loadConfigValues()
#8 /var/www/owncloud/lib/private/AppConfig.php(289): OC\AppConfig->getApps()
#9 /var/www/owncloud/lib/private/App/AppManager.php(133): OC\AppConfig->getValues()
#10 /var/www/owncloud/lib/private/App/AppManager.php(154): OC\App\AppManager->getInstalledAppsValues()
#11 /var/www/owncloud/lib/private/legacy/app.php(352): OC\App\AppManager->getInstalledApps()
#12 /var/www/owncloud/lib/private/legacy/app.php(108): OC_App::getEnabledApps()
#13 /var/www/owncloud/lib/kernel.php(591): OC_App::loadApps()
#14 /var/www/owncloud/lib/kernel.php(1059): OC::init()
#15 /var/www/owncloud/lib/base.php(27): require_once('/var/www/ownclo...')
#16 /var/www/owncloud/console.php(52): require_once('/var/www/ownclo...')
#17 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')
#18 {main}
After fixing the table name in the AppConfig.php, calling the same command again:
An unhandled exception has been thrown:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.jobs' doesn't exist in /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117
Stack trace:
#0 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(117): PDOStatement->execute()
#1 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1304): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /var/www/owncloud/lib/private/DB/Connection.php(191): Doctrine\DBAL\Connection->executeQuery()
#3 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(212): OC\DB\Connection->executeQuery()
#4 /var/www/owncloud/lib/private/DB/QueryBuilder/QueryBuilder.php(141): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/owncloud/lib/private/BackgroundJob/JobList.php(143): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/owncloud/lib/private/BackgroundJob/JobList.php(64): OC\BackgroundJob\JobList->has()
#7 /var/www/owncloud/apps/search_elastic/lib/AppInfo/Application.php(128): OC\BackgroundJob\JobList->add()
#8 /var/www/owncloud/apps/search_elastic/appinfo/app.php(30): OCA\Search_Elastic\AppInfo\Application->init()
#9 /var/www/owncloud/lib/private/legacy/app.php(253): require_once('/var/www/ownclo...')
#10 /var/www/owncloud/lib/private/legacy/app.php(192): OC_App::requireAppFile()
#11 /var/www/owncloud/lib/private/legacy/app.php(125): OC_App::loadApp()
#12 /var/www/owncloud/lib/private/Console/Application.php(103): OC_App::loadApps()
#13 /var/www/owncloud/console.php(93): OC\Console\Application->loadCommands()
#14 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')
#15 {main}
After fixing that, another table cannot be found (table owncloud.preferences (called by AllConfig.php:410)
and after fixing that, i ended up with an exception 'Your data directory is invalid' as mentioned above.
Browser log
not relevant
www-data@16624a8fc0ee:~/owncloud$ ./occ search:index:rebuild RelevanceV2 printer
don' run ./occ but occ
occ is a command which properly loads env vars.