App code signing: "Base table or view not found"

Hi,

I’m trying to sign an app. When running

./occ integrity:sign-app \
--privateKey=/mnt/data/apps/mycoolapp.key \
--certificate=/mnt/data/apps/mycoolapp.crt \
--path=/mnt/data/apps/mycoolapp

it breaks and throws:

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:104
Stack trace:
#0 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(104): PDO->query('SELECT * FROM `...')
#1 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(852): Doctrine\DBAL\Driver\PDOConnection->query('SELECT * FROM `...')
#2 /var/www/owncloud/lib/private/DB/Connection.php(187): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#3 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(206): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
#4 /var/www/owncloud/lib/private/DB/QueryBuilder/QueryBuilder.php(141): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/owncloud/lib/private/AppConfig.php(301): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/owncloud/lib/private/AppConfig.php(80): OC\AppConfig->loadConfigValues()
#7 /var/www/owncloud/lib/private/AppConfig.php(278): OC\AppConfig->getApps()
#8 /var/www/owncloud/lib/private/legacy/app.php(947): OC\AppConfig->getValues(false, 'installed_versi...')
#9 /var/www/owncloud/lib/private/Server.php(437): OC_App::getAppVersions()
#10 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
#11 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(108): Pimple\Container->offsetGet('MemCacheFactory')
#12 /var/www/owncloud/lib/private/ServerContainer.php(86): OC\AppFramework\Utility\SimpleContainer->query('MemCacheFactory')
#13 /var/www/owncloud/lib/private/Server.php(1198): OC\ServerContainer->query('MemCacheFactory')
#14 /var/www/owncloud/lib/private/Server.php(596): OC\Server->getMemCacheFactory()
#15 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
#16 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(108): Pimple\Container->offsetGet('AppManager')
#17 /var/www/owncloud/lib/private/ServerContainer.php(86): OC\AppFramework\Utility\SimpleContainer->query('AppManager')
#18 /var/www/owncloud/lib/private/Server.php(1414): OC\ServerContainer->query('AppManager')
#19 /var/www/owncloud/lib/private/legacy/app.php(343): OC\Server->getAppManager()
#20 /var/www/owncloud/lib/private/legacy/app.php(107): OC_App::getEnabledApps()
#21 /var/www/owncloud/lib/base.php(577): OC_App::loadApps(Array)
#22 /var/www/owncloud/lib/base.php(994): OC::init()
#23 /var/www/owncloud/console.php(64): require_once('/var/www/ownclo...')
#24 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')
#25 {main}

Next Doctrine\DBAL\Driver\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:106
Stack trace:
#0 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(852): Doctrine\DBAL\Driver\PDOConnection->query('SELECT * FROM `...')
#1 /var/www/owncloud/lib/private/DB/Connection.php(187): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#2 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(206): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
#3 /var/www/owncloud/lib/private/DB/QueryBuilder/QueryBuilder.php(141): Doctrine\DBAL\Query\QueryBuilder->execute()
#4 /var/www/owncloud/lib/private/AppConfig.php(301): OC\DB\QueryBuilder\QueryBuilder->execute()
#5 /var/www/owncloud/lib/private/AppConfig.php(80): OC\AppConfig->loadConfigValues()
#6 /var/www/owncloud/lib/private/AppConfig.php(278): OC\AppConfig->getApps()
#7 /var/www/owncloud/lib/private/legacy/app.php(947): OC\AppConfig->getValues(false, 'installed_versi...')
#8 /var/www/owncloud/lib/private/Server.php(437): OC_App::getAppVersions()
#9 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
#10 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(108): Pimple\Container->offsetGet('MemCacheFactory')
#11 /var/www/owncloud/lib/private/ServerContainer.php(86): OC\AppFramework\Utility\SimpleContainer->query('MemCacheFactory')
#12 /var/www/owncloud/lib/private/Server.php(1198): OC\ServerContainer->query('MemCacheFactory')
#13 /var/www/owncloud/lib/private/Server.php(596): OC\Server->getMemCacheFactory()
#14 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
#15 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(108): Pimple\Container->offsetGet('AppManager')
#16 /var/www/owncloud/lib/private/ServerContainer.php(86): OC\AppFramework\Utility\SimpleContainer->query('AppManager')
#17 /var/www/owncloud/lib/private/Server.php(1414): OC\ServerContainer->query('AppManager')
#18 /var/www/owncloud/lib/private/legacy/app.php(343): OC\Server->getAppManager()
#19 /var/www/owncloud/lib/private/legacy/app.php(107): OC_App::getEnabledApps()
#20 /var/www/owncloud/lib/base.php(577): OC_App::loadApps(Array)
#21 /var/www/owncloud/lib/base.php(994): OC::init()
#22 /var/www/owncloud/console.php(64): require_once('/var/www/ownclo...')
#23 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')
#24 {main}

Next Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing 'SELECT * FROM `appconfig`':

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/AbstractMySQLDriver.php:53
Stack trace:
#0 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(128): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
#1 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(855): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'SELECT * FROM `...', Array)
#2 /var/www/owncloud/lib/private/DB/Connection.php(187): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#3 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(206): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
#4 /var/www/owncloud/lib/private/DB/QueryBuilder/QueryBuilder.php(141): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/owncloud/lib/private/AppConfig.php(301): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/owncloud/lib/private/AppConfig.php(80): OC\AppConfig->loadConfigValues()
#7 /var/www/owncloud/lib/private/AppConfig.php(278): OC\AppConfig->getApps()
#8 /var/www/owncloud/lib/private/legacy/app.php(947): OC\AppConfig->getValues(false, 'installed_versi...')
#9 /var/www/owncloud/lib/private/Server.php(437): OC_App::getAppVersions()
#10 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
#11 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(108): Pimple\Container->offsetGet('MemCacheFactory')
#12 /var/www/owncloud/lib/private/ServerContainer.php(86): OC\AppFramework\Utility\SimpleContainer->query('MemCacheFactory')
#13 /var/www/owncloud/lib/private/Server.php(1198): OC\ServerContainer->query('MemCacheFactory')
#14 /var/www/owncloud/lib/private/Server.php(596): OC\Server->getMemCacheFactory()
#15 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
#16 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(108): Pimple\Container->offsetGet('AppManager')
#17 /var/www/owncloud/lib/private/ServerContainer.php(86): OC\AppFramework\Utility\SimpleContainer->query('AppManager')
#18 /var/www/owncloud/lib/private/Server.php(1414): OC\ServerContainer->query('AppManager')
#19 /var/www/owncloud/lib/private/legacy/app.php(343): OC\Server->getAppManager()
#20 /var/www/owncloud/lib/private/legacy/app.php(107): OC_App::getEnabledApps()
#21 /var/www/owncloud/lib/base.php(577): OC_App::loadApps(Array)
#22 /var/www/owncloud/lib/base.php(994): OC::init()
#23 /var/www/owncloud/console.php(64): require_once('/var/www/ownclo...')
#24 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')
#25 {main}

Tried also (without the leading ./ )

occ integrity:sign-app \
--privateKey=/mnt/data/apps/mycoolapp.key \
--certificate=/mnt/data/apps/mycoolapp.crt \
--path=/mnt/data/apps/mycoolapp

Runs through but the signature can’t be verified (Integrity check error)

I’m a little lost how to proceed to get my app signed.
I followed https://doc.owncloud.org/server/developer_manual/app/advanced/code_signing.html

Running ownCloud 10.2.0.5 dockerized

Thanks in advance

This is indeed very strange. In my signing process, the file config.php is temporarily moved away. Thus during the app signing, there cannot be any db-access.

1 Like

after further investigation it seems that the database is messed up. Any idea how I reset the whole database to factory defaults? I don’t need a backup

@OC-Florian

https://forum.owncloud.org/viewtopic.php?t=32640

2 Likes

Thanks. I wiped the whole database and reinstalled but the error persists. I nuked all docker containers and reinstalled, error persists.