Open cdhermann opened 4 months ago
For LDAP remnants, see: https://docs.nextcloud.com/server/29/admin_manual/configuration_user/user_auth_ldap_cleanup.html
For LDAP remnants, see: https://docs.nextcloud.com/server/29/admin_manual/configuration_user/user_auth_ldap_cleanup.html
Thank you very much for the link, but unfortunately the ldap:show-remnants
command displays nothing:
# docker exec -ti --user www-data nextcloud-aio-nextcloud /var/www/html/occ config:app:get user_ldap ldapUserCleanupInterval
51
# docker exec -ti --user www-data nextcloud-aio-nextcloud /var/www/html/occ ldap:show-remnants
+----------------+--------------+----------+---------+------------+-------------+-----+--------+
| Nextcloud name | Display Name | LDAP UID | LDAP DN | Last Login | Detected on | Dir | Sharer |
+----------------+--------------+----------+---------+------------+-------------+-----+--------+
How do I find the records in the DB causing this error messages? Maybe deleting or updating the records triggering the message in the DB directly helps getting rid of these recurring messages for non-existing users.
Sometimes the object is referred to with an UUID, sometimes with username the user had as it existed.
{
"reqId": "Q0IhgQoDCJfqvAhVTJGs",
"level": 3,
"time": "2024-08-06T07:15:14+00:00",
"remoteAddr": "",
"user": "--",
"app": "files",
"method": "",
"url": "--",
"message": "Backends provided no user object for e8b29d14-908f-38c4-95cc-7be0743aa89c",
"userAgent": "--",
"version": "29.0.4.1",
"exception": {
"Exception": "OC\\User\\NoUserException",
"Message": "Backends provided no user object",
"Code": 0,
"Trace": [
{
"function": "getUserFolder",
"class": "OC\\Files\\Node\\Root",
"type": "->",
"args": [
"e8b29d14-908f-38c4-95cc-7be0743aa89c"
]
},
{
"file": "/var/www/html/lib/private/Files/Node/LazyFolder.php",
"line": 84,
"function": "call_user_func_array",
"args": [
[
[
"OC\\Files\\Node\\Root"
],
"getUserFolder"
],
[
"e8b29d14-908f-38c4-95cc-7be0743aa89c"
]
]
},
{
"file": "/var/www/html/lib/private/Files/Node/LazyRoot.php",
"line": 53,
"function": "__call",
"class": "OC\\Files\\Node\\LazyFolder",
"type": "->",
"args": [
"getUserFolder",
[
"e8b29d14-908f-38c4-95cc-7be0743aa89c"
]
]
},
{
"file": "/var/www/html/custom_apps/files_fulltextsearch/lib/Service/FilesService.php",
"line": 558,
"function": "getUserFolder",
"class": "OC\\Files\\Node\\LazyRoot",
"type": "->",
"args": [
"e8b29d14-908f-38c4-95cc-7be0743aa89c"
]
},
{
"file": "/var/www/html/custom_apps/files_fulltextsearch/lib/Service/FilesService.php",
"line": 577,
"function": "getFileFromId",
"class": "OCA\\Files_FullTextSearch\\Service\\FilesService",
"type": "->",
"args": [
"e8b29d14-908f-38c4-95cc-7be0743aa89c",
684249
]
},
{
"file": "/var/www/html/custom_apps/files_fulltextsearch/lib/Service/FilesService.php",
"line": 638,
"function": "getFileFromIndex",
"class": "OCA\\Files_FullTextSearch\\Service\\FilesService",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/custom_apps/files_fulltextsearch/lib/Service/FilesService.php",
"line": 706,
"function": "generateDocumentFromIndex",
"class": "OCA\\Files_FullTextSearch\\Service\\FilesService",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/custom_apps/files_fulltextsearch/lib/Provider/FilesProvider.php",
"line": 314,
"function": "updateDocument",
"class": "OCA\\Files_FullTextSearch\\Service\\FilesService",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/custom_apps/fulltextsearch/lib/Service/IndexService.php",
"line": 409,
"function": "updateDocument",
"class": "OCA\\Files_FullTextSearch\\Provider\\FilesProvider",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/custom_apps/fulltextsearch/lib/Cron/Index.php",
"line": 109,
"function": "updateDocument",
"class": "OCA\\FullTextSearch\\Service\\IndexService",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/custom_apps/fulltextsearch/lib/Cron/Index.php",
"line": 77,
"function": "liveCycle",
"class": "OCA\\FullTextSearch\\Cron\\Index",
"type": "->",
"args": []
},
{
"file": "/var/www/html/lib/public/BackgroundJob/Job.php",
"line": 80,
"function": "run",
"class": "OCA\\FullTextSearch\\Cron\\Index",
"type": "->",
"args": [
null
]
},
{
"file": "/var/www/html/lib/public/BackgroundJob/TimedJob.php",
"line": 102,
"function": "start",
"class": "OCP\\BackgroundJob\\Job",
"type": "->",
"args": [
[
"OC\\BackgroundJob\\JobList"
]
]
},
{
"file": "/var/www/html/lib/public/BackgroundJob/TimedJob.php",
"line": 92,
"function": "start",
"class": "OCP\\BackgroundJob\\TimedJob",
"type": "->",
"args": [
[
"OC\\BackgroundJob\\JobList"
]
]
},
{
"file": "/var/www/html/cron.php",
"line": 177,
"function": "execute",
"class": "OCP\\BackgroundJob\\TimedJob",
"type": "->",
"args": [
[
"OC\\BackgroundJob\\JobList"
]
]
}
],
"File": "/var/www/html/lib/private/Files/Node/Root.php",
"Line": 370,
"message": "Backends provided no user object for e8b29d14-908f-38c4-95cc-7be0743aa89c",
"exception": [],
"CustomMessage": "Backends provided no user object for e8b29d14-908f-38c4-95cc-7be0743aa89c"
},
"id": "66b1cebde62d2"
}
@joshtrichards is there any progress on this topic, or where can I follow the progress, maybe even contribute by adding information? Thanks!
Hi,
I have a similar situation, where the log is getting inundated with the "NoUserException Backends provided no user object" error message.
The user in question was an LDAP user, which was deleted from LDAP, and then deleted from Nextcloud, as per the manual https://docs.nextcloud.com/server/29/admin_manual/configuration_user/user_auth_ldap_cleanup.html.
At present the command ldap:show-remnants command displays nothing.
How can I solve this?
@roelofz & @caguiar Are you both also using the files_fulltextsearch
app? That is where OP's stack trace is coming from.
Yes I do have files_fulltextsearch app installed, and seems that is where the error is comming from.
{ "reqId": "HntkzuoMUt7Jsru8EXKo", "level": 3, "time": "2024-11-18T19:05:04+00:00", "remoteAddr": "", "user": "--", "app": "files", "method": "", "url": "--", "message": "Backends provided no user object for 1CB07EF3-6076-45EA-8498-04ADF9980029", "userAgent": "--", "version": "30.0.2.2", "exception": { "Exception": "OC\User\NoUserException", "Message": "Backends provided no user object", "Code": 0, "Trace": [ { "function": "getUserFolder", "class": "OC\Files\Node\Root", "type": "->" }, { "file": "/var/www/nextcloud/lib/private/Files/Node/LazyFolder.php", "line": 64, "function": "call_user_func_array" }, { "file": "/var/www/nextcloud/lib/private/Files/Node/LazyRoot.php", "line": 38, "function": "__call", "class": "OC\Files\Node\LazyFolder", "type": "->" }, { "file": "/var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php", "line": 558, "function": "getUserFolder", "class": "OC\Files\Node\LazyRoot", "type": "->" }, { "file": "/var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php", "line": 577, "function": "getFileFromId", "class": "OCA\Files_FullTextSearch\Service\FilesService", "type": "->" }, { "file": "/var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php", "line": 638, "function": "getFileFromIndex", "class": "OCA\Files_FullTextSearch\Service\FilesService", "type": "->" }, { "file": "/var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php", "line": 706, "function": "generateDocumentFromIndex", "class": "OCA\Files_FullTextSearch\Service\FilesService", "type": "->" }, { "file": "/var/www/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php", "line": 314, "function": "updateDocument", "class": "OCA\Files_FullTextSearch\Service\FilesService", "type": "->", "args": [ " sensitive parameters replaced " ] }, { "file": "/var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php", "line": 409, "function": "updateDocument", "class": "OCA\Files_FullTextSearch\Provider\FilesProvider", "type": "->", "args": [ " sensitive parameters replaced " ] }, { "file": "/var/www/nextcloud/apps/fulltextsearch/lib/Cron/Index.php", "line": 109, "function": "updateDocument", "class": "OCA\FullTextSearch\Service\IndexService", "type": "->", "args": [ " sensitive parameters replaced " ] }, { "file": "/var/www/nextcloud/apps/fulltextsearch/lib/Cron/Index.php", "line": 77, "function": "liveCycle", "class": "OCA\FullTextSearch\Cron\Index", "type": "->" }, { "file": "/var/www/nextcloud/lib/public/BackgroundJob/Job.php", "line": 61, "function": "run", "class": "OCA\FullTextSearch\Cron\Index", "type": "->" }, { "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php", "line": 83, "function": "start", "class": "OCP\BackgroundJob\Job", "type": "->" }, { "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php", "line": 73, "function": "start", "class": "OCP\BackgroundJob\TimedJob", "type": "->" }, { "file": "/var/www/nextcloud/cron.php", "line": 162, "function": "execute", "class": "OCP\BackgroundJob\TimedJob", "type": "->" } ], "File": "/var/www/nextcloud/lib/private/Files/Node/Root.php", "Line": 345, "message": "Backends provided no user object for 1CB07EF3-6076-45EA-8498-04ADF9980029", "exception": [], "CustomMessage": "Backends provided no user object for 1CB07EF3-6076-45EA-8498-04ADF9980029" }, "id": "673b9237ad590" }
FTS may need a similar fix as nextcloud/server#41786 made for files_versions
. Though I haven't looked at the actual code in FTS yet.
Yes I do have files_fulltextsearch app installed, and seems that is where the error is comming from.
I also have this app installed, but do not see why this app in the report stands out more then others (just being curious)? Can you show me why it stands out between the other php's?
Second, this app is not to be trusted @joshtrichards ? I mean it is not maintained by Nextcloud personnel and therefore a higher risk of incompatibilities?
Last, it was very difficult to find the source of this problem, how can I help for users simular to me, looking for answers?
Thanks both for the earlier and future responses!
Roelof
Ehh, what am I doing wrong?
`user@nas:/opt/nextcloud# ./ncocc.sh app:enable files_fulltextsearch files_fulltextsearch 30.0.0 enabled user@nas:/opt/nextcloud# ./ncocc.sh app:remove files_fulltextsearch files_fulltextsearch disabled files_fulltextsearch 30.0.0 removed user@nas:/opt/nextcloud# ./ncocc.sh app:list | grep files_fulltextsearch user@nas:/opt/nextcloud# docker restart nextcloud-aio-nextcloud nextcloud-aio-nextcloud user@nas:/opt/nextcloud# ./ncocc.sh app:list | grep files_fulltextsearch
Hi everyone, I had the same anoying issue after removing a local user (no LDAP, just a normal user). Yesterday I reset fulltextsearch and then re-indexed, and it's no longer occurring:
php occ fulltextsearch:reset
php occ fulltextsearch:index
My Nextcloud instance has 4 users, so not a lot of files. Be careful on large instances.
Unverified take: It seems we need to either:
There is already a listener for when files are deleted AFAIK. I would have expected this would catch these situations (once the user's files after account removal), but maybe not.
Reindexing now, big thanks for that, seems a logical solution, my setup is also small (but I like to think enterprise-like, so this is not the best workaround).
nextcloud/server#47896 might be relevant here.
⚠️ This issue respects the following points: ⚠️
Bug description
After enabling the LDAP backend, logging in with a user of LDAP, removing the necessary group for login in LDAP and then removing the LDAP backend from Nextcloud causes the user to stay somehow in the system which causes flooding of the log with messages like this:
How do I get rid of this non-existing user
testuser_2438
?Steps to reproduce
testuser
_<number>
postfixedExpected behavior
The really expected behaviour would be to join existing and ldap users as soon as
Internal Username
corresponds to the username and isn't UID.After having learned the LDAP backend can't do it, the expected behavior is:
Deleting users deletes them really - no matter which backend added the user.
Installation method
Official All-in-One appliance
Nextcloud Server version
29
Operating system
RHEL/CentOS
PHP engine version
PHP 8.2
Web server
Apache (supported)
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
Updated from a MINOR version (ex. 28.0.1 to 28.0.2)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response