我最近开始使用 Nextcloud 在由提供商托管的 Ubuntu 机器上托管自己的云。昨天我想更改配置,但发现管理员帐户已被阻止,因为我启用了最多三次尝试,直到用户被阻止。
现在,我正在尝试找到一种方法来解除对管理员帐户的阻止。我尝试通过 SSH 访问我的服务器,然后尝试运行 occ 脚本来解除对管理员帐户的阻止,但是我似乎无法正确访问该文件。我正在运行 Ubuntu 18.04.5 LTS:
sudo -u www-data php /var/lib/docker/volumes/nextcloud/_data/occ
Could not open input file: /var/lib/docker/volumes/nextcloud/_data/occ
/var/lib/docker/volumes/nextcloud/_data# ./occ user:enable admin
n unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /var/lib/docker/volumes/nextcloud/_data/lib/private/DB/Connection.php:85
Stack trace:
#0 /var/lib/docker/volumes/nextcloud/_data/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()
#1 /var/lib/docker/volumes/nextcloud/_data/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/lib/docker/volumes/nextcloud/_data/lib/private/DB/Connection.php(226): Doctrine\DBAL\Connection->executeQuery()
#3 /var/lib/docker/volumes/nextcloud/_data/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery()
#4 /var/lib/docker/volumes/nextcloud/_data/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppConfig.php(345): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppConfig.php(110): OC\AppConfig->loadConfigValues()
#7 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppConfig.php(301): OC\AppConfig->getApps()
#8 /var/lib/docker/volumes/nextcloud/_data/lib/private/legacy/OC_App.php(957): OC\AppConfig->getValues()
#9 /var/lib/docker/volumes/nextcloud/_data/lib/private/Server.php(682): OC_App::getAppVersions()
#10 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}()
#11 /var/lib/docker/volumes/nextcloud/_data/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#12 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet()
#13 /var/lib/docker/volumes/nextcloud/_data/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query()
#14 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#15 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppFramework/Utility/SimpleContainer.php(177): OC\AppFramework\Utility\SimpleContainer->get()
#16 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#17 /var/lib/docker/volumes/nextcloud/_data/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#18 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet()
#19 /var/lib/docker/volumes/nextcloud/_data/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query()
#20 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#21 /var/lib/docker/volumes/nextcloud/_data/lib/private/Server.php(1031): OC\AppFramework\Utility\SimpleContainer->get()
#22 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}()
#23 /var/lib/docker/volumes/nextcloud/_data/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#24 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet()
#25 /var/lib/docker/volumes/nextcloud/_data/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query()
#26 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#27 /var/lib/docker/volumes/nextcloud/_data/lib/private/Server.php(1990): OC\AppFramework\Utility\SimpleContainer->get()
#28 /var/lib/docker/volumes/nextcloud/_data/lib/private/Files/View.php(119): OC\Server->getLockingProvider()
#29 /var/lib/docker/volumes/nextcloud/_data/lib/private/Server.php(430): OC\Files\View->__construct()
#30 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}()
#31 /var/lib/docker/volumes/nextcloud/_data/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#32 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet()
#33 /var/lib/docker/volumes/nextcloud/_data/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query()
#34 /var/lib/docker/volumes/nextcloud/_data/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#35 /var/lib/docker/volumes/nextcloud/_data/lib/private/Server.php(1353): OC\AppFramework\Utility\SimpleContainer->get()
#36 /var/lib/docker/volumes/nextcloud/_data/lib/base.php(588): OC\Server->boot()
#37 /var/lib/docker/volumes/nextcloud/_data/lib/base.php(1076): OC::init()
#38 /var/lib/docker/volumes/nextcloud/_data/console.php(49): require_once('/var/lib/docker...')
#39 /var/lib/docker/volumes/nextcloud/_data/occ(11): require_once('/var/lib/docker...')
有人知道我现在可以尝试什么吗?
答案1
运行“docker exec -u 33 nextcloud ./occ user:enable admin”就成功了!