# Nextcloud after Platform Update System: 1755 lost admin

**URL:** <https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287>\
**Category:** Existing Apps\
**Tags:** nextcloud\
**Created:** [3 January 2023 16:37 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287 "2023-01-03T16:37:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![marxistvegan](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/marxistvegan/32/22_2.png) [@marxistvegan](https://syncloud.discourse.group/u/marxistvegan)\
**Post date:** [3 January 2023 16:37 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/1 "2023-01-03T16:37:31Z")

</div>

Hey not sure if it is completely related but i noticed that after updating to the new platform today, my nextcloud instance lost admin access

---

<div class="post-metadata">

**Author:** ![Ryan](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@Ryan](https://syncloud.discourse.group/u/Ryan)\
**Post date:** [3 January 2023 20:56 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/2 "2023-01-03T20:56:20Z")

</div>

Might be related, after upgrade I received a nextcloud configuration error message and found all external storage was now set off. Ssh showed no /data folder either, no internal or external. Looking into why now.

---

<div class="post-metadata">

**Author:** ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)\
**Post date:** [3 January 2023 23:30 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/3 "2023-01-03T23:30:34Z")

</div>

> lost admin access

Could you show output and try the workaround:

> **[Nextcloud](https://github.com/syncloud/platform/wiki/Nextcloud#fix-admin-rights)**
>
> Run popular services on your device with one click - syncloud/platform

---

<div class="post-metadata">

**Author:** ![marxistvegan](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/marxistvegan/32/22_2.png) [@marxistvegan](https://syncloud.discourse.group/u/marxistvegan)\
**Post date:** [4 January 2023 23:31 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/4 "2023-01-04T23:31:56Z")

</div>

Getting this issue

> ```auto
> 
> ```

root@syncloud:~/snap/nextcloud# snap run nextcloud.psql -c “update oc\_ldap\_group\_mapping set owncloud\_name = ‘admin’”  
could not change directory to “/root/snap/nextcloud”: Permission denied  
UPDATE 1  
root@syncloud:~/snap/nextcloud# snap run nextcloud.psql -c “update oc\_ldap\_group\_members set owncloudname = ‘admin’”  
could not change directory to “/root/snap/nextcloud”: Permission denied  
UPDATE 1

```auto

```

---

<div class="post-metadata">

**Author:** ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)\
**Post date:** [5 January 2023 07:37 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/5 "2023-01-05T07:37:59Z")

</div>

This is not an error actually, check your admin rights in Nextcloud.

Also could you run check:

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

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

```

---

<div class="post-metadata">

**Author:** ![marxistvegan](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/marxistvegan/32/22_2.png) [@marxistvegan](https://syncloud.discourse.group/u/marxistvegan)\
**Post date:** [5 January 2023 14:03 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/6 "2023-01-05T14:03:37Z")

</div>

Ok so just to be clear the commands above did not result if gaining admin access in the web interface of nextcloud which I had before the platform update

> owncloud\_name | ldap\_dn | directory\_uuid | ldap\_dn\_hash  
> ---------------±-----------------------------------------±-------------------------------------±-----------------------------------------------------------------  
> admin | cn=syncloud,ou=groups,dc=syncloud,dc=org | e9b3306a-12be-103d-877c-fbad2677ec47 | aac22646179b2b187a05c325be3431b95e39ef12a19def4ad4ea2e3aa0dc5123  
> (1 row)

and

> owncloudname | owncloudusers  
> --------------±-------------------------------  
> admin | a:1:{i:0;s:12:“marxistvegan”;}  
> (1 row)  
> root@syncloud:~#

---

<div class="post-metadata">

**Author:** ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)\
**Post date:** [5 January 2023 17:01 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/7 "2023-01-05T17:01:10Z")

</div>

Am I right you can login to nextcloud but cannot see admin features like users page?  
Can you send a screenshot?

 ![Screenshot from 2023-01-05 16-59-25](https://global.discourse-cdn.com/free1/uploads/syncloud/original/1X/428b6c205d9a17af13b91a316c8c2296a3e0885d.png)

---

<div class="post-metadata">

**Author:** ![marxistvegan](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/marxistvegan/32/22_2.png) [@marxistvegan](https://syncloud.discourse.group/u/marxistvegan)\
**Post date:** [5 January 2023 17:31 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/8 "2023-01-05T17:31:22Z")

</div>

That is correct

 ![Screenshot_20230105-123032](https://global.discourse-cdn.com/free1/uploads/syncloud/original/1X/d64f839bd755c994273930026b06bfe47d7f376e.png)

---

<div class="post-metadata">

**Author:** ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)\
**Post date:** [5 January 2023 18:35 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/9 "2023-01-05T18:35:26Z")

</div>

Can you try this command:

```auto
snap run nextcloud.occ group:adduser admin marxistvegan

```

---

<div class="post-metadata">

**Author:** ![marxistvegan](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/marxistvegan/32/22_2.png) [@marxistvegan](https://syncloud.discourse.group/u/marxistvegan)\
**Post date:** [5 January 2023 18:36 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/10 "2023-01-05T18:36:44Z")

</div>

I actually did that yesterday and nothing changed then, I am outside of my home until late tonight before I could run it again.

---

<div class="post-metadata">

**Author:** ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)\
**Post date:** [5 January 2023 18:38 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/11 "2023-01-05T18:38:20Z")

</div>

ok if that does not work send logs please.

---

<div class="post-metadata">

**Author:** ![marxistvegan](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/marxistvegan/32/22_2.png) [@marxistvegan](https://syncloud.discourse.group/u/marxistvegan)\
**Post date:** [5 January 2023 18:42 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/12 "2023-01-05T18:42:26Z")

</div>

nevermind it seemed to have been sent this time.

---

<div class="post-metadata">

**Author:** ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)\
**Post date:** [5 January 2023 22:05 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/13 "2023-01-05T22:05:52Z")

</div>

Nothing interesting in the logs, if adduser does not help I can only advise you to reinstall nextcloud.

---

<div class="post-metadata">

**Author:** ![marxistvegan](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/marxistvegan/32/22_2.png) [@marxistvegan](https://syncloud.discourse.group/u/marxistvegan)\
**Post date:** [6 January 2023 13:19 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/14 "2023-01-06T13:19:35Z")

</div>

Going to add this to see if it help before I consider reinstalling nextcloud. I created a new user in the users app and that one has admin powers. From the two commands on the db this is what I see

> owncloud\_name | ldap\_dn | directory\_uuid | ldap\_dn\_hash  
> ---------------±-----------------------------------------±-------------------------------------±-----------------------------------------------------------------  
> admin | cn=syncloud,ou=groups,dc=syncloud,dc=org | e9b3306a-12be-103d-877c-fbad2677ec47 | aac22646179b2b187a05c325be3431b95e39ef12a19def4ad4ea2e3aa0dc5123  
> stephen | cn=stephen,ou=groups,dc=syncloud,dc=org | e896dd4c-216b-103d-9a5c-0b46b46267ba | 225697ad5c367326c30452c4a53920d321e15eade16397709502b2edc2194de5  
> (2 rows)  
> (END)

> root@syncloud:~# snap run nextcloud.psql -c “select \* from oc\_ldap\_group\_members”  
> could not change directory to “/root”: Permission denied  
> owncloudname | owncloudusers  
> --------------±-------------------------------  
> admin | a:1:{i:0;s:12:“marxistvegan”;}  
> stephen | a:1:{i:0;s:7:“stephen”;}  
> (2 rows)

and the group list created a new group which I tried to add myself to but to no avail on having admin powers on the primary but i do on the new account ‘stephen’

> root@syncloud:~# snap run nextcloud.occ group:list
> 
> - admin:
> - stephen
> - marxistvegan
> 
> - stephen:
> - marxistvegan
> - stephen

---

<div class="post-metadata">

**Author:** ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)\
**Post date:** [6 January 2023 14:34 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/15 "2023-01-06T14:34:15Z")

</div>

what about:

```auto
snap run nextcloud.occ group:removeuser admin marxistvegan
snap run nextcloud.occ group:adduser admin marxistvegan

```

---

<div class="post-metadata">

**Author:** ![marxistvegan](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/marxistvegan/32/22_2.png) [@marxistvegan](https://syncloud.discourse.group/u/marxistvegan)\
**Post date:** [6 January 2023 15:19 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/16 "2023-01-06T15:19:07Z")

</div>

Did that too to no avail, wouldnt actually remove is i think part of the issue

---

<div class="post-metadata">

**Author:** ![marxistvegan](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/marxistvegan/32/22_2.png) [@marxistvegan](https://syncloud.discourse.group/u/marxistvegan)\
**Post date:** [7 January 2023 04:47 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/17 "2023-01-07T04:47:38Z")

</div>

Also wondering since i have two users at the moment what would happen if i delete the original user via Users app and recreate it, will all the nextcloud account regain all in it including calendar, contacts and deck? I know obiviously backup before but askin more technically in the way users are setup?

---

<div class="post-metadata">

**Author:** ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)\
**Post date:** [8 January 2023 18:22 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/18 "2023-01-08T18:22:22Z")

</div>

One more thing to try before you remove the original user.  
Can you rung this:

```auto
/snap/platform/current/openldap/bin/ldapsearch.sh -x -w syncloud -D "dc=syncloud,dc=org" -b "cn=syncloud,ou=groups,dc=syncloud,dc=org"

```

This will show if admin group contains your user in `memberUid` property, if not that would explain the issue.

---

<div class="post-metadata">

**Author:** ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)\
**Post date:** [8 January 2023 18:36 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/19 "2023-01-08T18:36:37Z")

</div>

I you user is not listed in `memberUid` property of `syncloud` group you can add it in Users app.

1. Users
2. Your user
3. Group membership
4. Add `<` syncloud group from available groups
5. Save

---

<div class="post-metadata">

**Author:** ![marxistvegan](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/marxistvegan/32/22_2.png) [@marxistvegan](https://syncloud.discourse.group/u/marxistvegan)\
**Post date:** [16 September 2023 15:13 UTC](https://syncloud.discourse.group/t/nextcloud-after-platform-update-system-1755-lost-admin/287/20 "2023-09-16T15:13:46Z")

</div>

Hey just want to share, I am not exactly sure when this happened but I am guessing in the last couple of months, but my main user, which lost admin powers, somehow regained it. My previous work around was to have an admin user, but now that i have regained admin I have deleted the old admin account. So good job on however this got resolved 🙂
