Can't login to nextcloud any more

Hi I’ve changed my user password on syncloud and now I can’t login to Nextcloud any more. It also says that there have been too many login requests from my site (after I tried to login for some times)
All information I found on the internet to reset the brute force protection does not work (can’t reset password via occ, can’t access databases, …)

Changing password via occ does also not work :frowning:

root@odroid-xu3and4:~# snap run nextcloud.occ user:resetpassword admin
Enter a new password: 
Confirm the new password: 
Error while resetting password!

Can you help?
peter

Resetting brute-force-protection with

snap run nextcloud.occ security:bruteforce:reset 192.168.1.100

did work… but I can’t change the password and can’t login. The user is listed with

snap run nextcloud.occ user:info admin

But

snap run nextcloud.occ group:list

does not show the user in the admin group

Problem seems to be solved now
I reinstalled nextcloud with

snap remove nextcloud
snap install nextcloud

Yes this does not work as Nextcloud as all other apps are storing user credentials in LDAP database (Users app).

snap run nextcloud.occ security:bruteforce:reset 192.168.1.100

Probably it would work if it was done first, I guess occ reset password broke it

Did you change password because it was too many login requests or it was too many requests after you changed the password?

I changed the password in the user-App because I was afraid of an activation request my syncloud-device showed me (was afraid of an password attack - in combination with this email that my 30-day trial period expires). So I did a complete activation process and had to enter a (new?) password. Afterwards I changed the main password on the device and also the root account (to get a better security-feeling)

Thanks for your reply! Regards
Peter

Problem is not solved yet :frowning:
The other users (like backup) do not exist after I reinstalled nextcloud. And the user seems not to be admin any more (I can’t configure nextcloud - e.g. contacts).
I tried:

snap run nextcloud.occ files:scan  --all

but I get an error:

An unhandled exception has been thrown:
TypeError: OC\Files\Cache\Scanner::scanChildren(): Argument #6 ($oldSize) must be of type int, float given, called in /snap/nextcloud/711/nextcloud/lib/private/Files/Cache/Scanner.php on line 347 and defined in /snap/nextcloud/711/nextcloud/lib/private/Files/Cache/Scanner.php:391
Stack trace: [...]

Any idea what I can do?

What kind of device do you have? arm32 or not?

Hi Boris,
it’s an arm32 (armv7l)
Regards
Peter

Ok, looks like the last Nextcloud version supported on arm32 was 26, so I will have to revert arm32 to 26.

Sounds like a plan - what can I do / what do I have to do?

just reverted the version, but Nextcloud does not support downgrading so you have to remove it and install again.
Hopefully that will help to index your files if that worked before.

Hi Boris - I did reinstall nextcloud to 706 - that worked, but I have only one user in nextcloud and it is not an admin user (I can’t add apps or users in nextcloud)
My old nextcloud users existed only in nextcloud (did I miss to make a backup before reinstalling?)
But what is still weird, is that I can not add users or add ons

OK, I am not sure why but very rarely it happens, usually after upgrades, ldap group mapping is really strange in Nextcloud.

Can you run these commands and show the out put?

Check

snap run nextcloud.psql -c "select * from oc_ldap_group_mapping"

snap run nextcloud.psql -c "select * from oc_ldap_group_members"

Show groups:

snap run nextcloud.occ group:list

Make all admins

snap run nextcloud.psql -c "update oc_ldap_group_mapping set owncloud_name = 'admin'"

snap run nextcloud.psql -c "update oc_ldap_group_members set owncloudname = 'admin'"

from here: Nextcloud · syncloud/platform Wiki · GitHub

Sure:

snap run nextcloud.psql -c "select * from oc_ldap_group_mapping"
 owncloud_name |                 ldap_dn                  |            directory_uuid            |                           ldap_dn_hash                           
---------------+------------------------------------------+--------------------------------------+------------------------------------------------------------------
 admin         | cn=syncloud,ou=groups,dc=syncloud,dc=org | c29aa6c4-d501-103d-9627-378f776f14c1 | aac22646179b2b187a05c325be3431b95e39ef12a19def4ad4ea2e3aa0dc5123
(1 row)
snap run nextcloud.psql -c "select * from oc_ldap_group_members"
 owncloudname |     owncloudusers      
--------------+------------------------
 admin        | a:1:{i:0;s:5:"peter";}

snap run nextcloud.occ group:list
  - admin:
    - peter

The last two commands answered UPDATE 1

After this I logged in to nextcloud and still have no admin privileges, although every table seems to be “all right”


I hope I gave every information needed

Is peter the user device was activated with or later created in Syncloud Users app?

Can you run this:

snap run nextcloud.occ user:info peter

Did you create any group or user inside nextcloud (not using Syncloud Users app) after the install?
Also try removing nextcloud and installing fresh to see if that changes anything.

Hi Boris,
peter is the main user of the Syncloud device, the first I installed and the only one I managed with the Users-App. All the other users have been created in Nextcloud (e.g. a backup user or family members).
So I think my problem with these additional users is: I did not make a backup :frowning: (am I right?!)
Is there a better way to remove and install nextcloud as via

snap remove nextcloud
snap install nextcloud

That was what I did at least twice already, but I can do it again. I even did it this way for downgrading (as you recommended)

The command user:info produced the following output:

  - user_id: peter
  - display_name: peter
  - email: ***********
  - cloud_id: peter@http://localhost
  - enabled: true
  - groups:
  - quota: none
  - storage:
    - free: 729513984
    - used: 19944789256
    - total: 20674303240
    - relative: 96.47
    - quota: -3
  - last_seen: 2023-08-27T10:53:43+00:00
  - user_directory: /opt/disk/internal/nextcloud/peter
  - backend: LDAP

Thanks für you support!
Peter

Ok, this user has no admin group still.
Yes, can you run this:

snap run nextcloud.occ group:adduser admin peter

Then again this:

snap run nextcloud.occ user:info peter

done:

root@odroid-xu3and4:~# snap run nextcloud.occ group:adduser admin peter
root@odroid-xu3and4:~# snap run nextcloud.occ user:info peter  
  - user_id: peter
  - display_name: peter
  - email: ******
  - cloud_id: peter@http://localhost
  - enabled: true
  - groups:
  - quota: none
  - storage:
    - free: 729346048
    - used: 19944789256
    - total: 20674135304
    - relative: 96.47
    - quota: -3
  - last_seen: 2023-08-27T11:37:19+00:00
  - user_directory: /opt/disk/internal/nextcloud/peter
  - backend: LDAP

Something is wrong :slight_smile:

Can you try:

  1. Reinstall and check by running the command and also logging into the UI.
  2. If that does not help try re-activating the device to the same domain (Settings - Activation) and then reinstalling nextcloud. That will reset syncloud users (ldap).