[SOLVED] User Vanished / [RESOLU] Utilisateur disparu

YunoHost: 11.2.5
Access : SSH or webadmin
nextcloud: 27.1.2
No recent modification done

Hello,

A nextcloud user cannot be accessed. The message after the connection failure is ‘User disabled’.
The account is not visible from the nextcloud administration interface.
It is visible from the yunohost administration interface.
It is visible in the users table in the nextcloud database.
The user’s files are still present in the data space.
Luckily it’s not an admin user.

Do you know how I can reactivate this user?
Or how to recreate it without losing the files and sharing links?

Thank you for your help.

Bonjour,

Un utilisateur nextcloud n’est pas accessible. Le message après l’échec de la connexion est ‘Utilisateur désactivé’.
Il n’est pas visible depuis l’interface d’administration de nextcloud.
Il est visible depuis l’interface d’administration de yunohost.
Il est visible dans la table users de la base de données nextcloud.
Les fichiers de l’utilisateur sont toujours présents dans l’espace data.
Par chance ce n’est pas un utilisateur admin.

Savez-vous comment je pourrais réactiver cet utilisateur ?
Ou comment le recréer sans perdre les fichiers et liens de partage ?
Merci pour votre aide.

Bonne journée

Hi Youst,

Welcome to the forums!

You could try this command,

sudo -u www-data php occ user:enable [username]

which I found on the Nextcloud forum.

Let us know if it worked for you!

1 Like

Thank you for your reply and suggestion.

I had to go has root otherwise I had an error :
Sorry, user username is not allowed to execute ‘/usr/bin/php8.0 occ user:enable username’ as www-data on domain.

This is what I got:

sudo -u www-data /usr/bin/php8.0 occ user:enable username

An 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/www/nextcloud/lib/private/DB/Connection.php:140
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1531): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1029): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(262): Doctrine\DBAL\Connection->executeQuery()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery()
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/nextcloud/lib/private/AppConfig.php(418): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/nextcloud/lib/private/AppConfig.php(184): OC\AppConfig->loadConfigValues()
#7 /var/www/nextcloud/lib/private/AppConfig.php(374): OC\AppConfig->getApps()
#8 /var/www/nextcloud/lib/private/legacy/OC_App.php(803): OC\AppConfig->getValues()
#9 /var/www/nextcloud/lib/private/Server.php(736): OC_App::getAppVersions()
#10 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC{closure}()
#11 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#12 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#13 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#14 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#15 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(193): OC\AppFramework\Utility\SimpleContainer->get()
#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#17 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#18 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#19 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#20 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#21 /var/www/nextcloud/lib/private/Server.php(1130): OC\AppFramework\Utility\SimpleContainer->get()
#22 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC{closure}()
#23 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#24 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#25 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#26 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#27 /var/www/nextcloud/lib/private/Server.php(2088): OC\AppFramework\Utility\SimpleContainer->get()
#28 /var/www/nextcloud/lib/private/Files/View.php(107): OC\Server->getLockingProvider()
#29 /var/www/nextcloud/lib/private/Server.php(470): OC\Files\View->__construct()
#30 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC{closure}()
#31 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#32 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#33 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#34 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#35 /var/www/nextcloud/lib/private/Server.php(1490): OC\AppFramework\Utility\SimpleContainer->get()
#36 /var/www/nextcloud/lib/base.php(635): OC\Server->boot()
#37 /var/www/nextcloud/lib/base.php(1196): OC::init()
#38 /var/www/nextcloud/console.php(48): require_once(‘…’)
#39 /var/www/nextcloud/occ(11): require_once(‘…’)
#40 {main}root@domain:/var/www/nextcloud# exit

This does not sound like good news.

I have no problem accessing nextcloud with other users.

Strange.

I’m open to any suggestion.

Best,

Sounds just like we need to call a specific php version rather than the default one

Lets run grep phpversion /etc/yunohost/apps/nextcloud/settings.yml to identify which php version is using nextcloud

Then (as root)

/usr/bin/phpX.Y occ user:enable username

(replacing X.Y with the php version)

You were right, it was not the good php version.

Here is the message with :
sudo -u www-data /usr/bin/php8.2 occ user:enable username

An unhandled exception has been thrown:
OCP\HintException: [0]: Memcache OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

Does it help ?

Best,

Try with:

/usr/bin/phpX.Y --define apc.enable_cli=1 occ user:enable username

This is the answer I got:
Cannot write into “config” directory!
This can usually be fixed by giving the web server write access to the config directory.

But, if you prefer to keep config.php file read only, set the option “config_is_read_only” to true in it.
See Configuration Parameters — Nextcloud latest Administration Manual latest documentation

BUT it gave me the idear to verify who was the owner of the file.
It’s note www-data but nextcloud.
So I changed the command to :

sudo -u nextcloud /usr/bin/php8.2 --define apc.enable_cli=1 occ user:enable username

and the message was: The specified user is enabled

It worked !

Thank you all very much for your help !

Have a nice evening.

2 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.