Root org unit not accessible

The maintenance app is not opening, and the error message from console is this one:

caught (in promise) {“organisationUnits”:}{“httpStatus”:“Bad Request”,“httpStatusCode”:400,“status”:“ERROR”,“message”:“Entity org.hisp.dhis.user.User with identifier value 5604235 does not exist (through reference chain: org.hisp.dhis.organisationunit.OrganisationUnit["users"])”}

Any hit how to troubleshoot this?

getting same arror on Org unit API

Looks like your db is no more coherent
Did you delete some data through sql ?
Are you logged in as admin ?

It looks like the user 5604235 is still referenced by orgUnits
Can you check that the table usermembership doesn’t contains a record for that user :

select * from usermembership where userinfoid = 5604235

SELECT 0

What is strange, normally you need to have the constraints to prevent such incoherence

\d usermembership
+--------------------+--------+-----------+
| Column             | Type   | Modifiers |
|--------------------+--------+-----------|
| userinfoid         | bigint |  not null |
| organisationunitid | bigint |  not null |
+--------------------+--------+-----------+
Indexes:
    "usermembership_pkey" PRIMARY KEY, btree (userinfoid, organisationunitid)
Foreign-key constraints:
    "fk_userinfo_organisationunitid" FOREIGN KEY (organisationunitid) REFERENCES organisationunit(organisationunitid)
    "fk_usermembership_userinfoid" FOREIGN KEY (userinfoid) REFERENCES userinfo(userinfoid)

Hi Stephan,
I am logged as superuser , but not admin as user.
May be someone did some query on backend, I m not sure, I m given a copy to troubleshoot only.
I did run the query but did not find the specific user in any table. In case you found any other idea, let me know.
I can how ever access maintenance app by assigning the user to other Org unit for capture other than root.
Thank you.

if someone deleted the user via sql I would restart the instance.

the user info is something heavily cached so perhaps the java process isn’t aware of the deletion.

I think there’s an option without restarting in the data administration page.