Cannot read properties of undefined (reading 'toLowerCase')
-
Hi,
does anyone know what this error message mean?
"Cannot read properties of undefined (reading 'toLowerCase')"
I am struggeling with setting up the connection to my Windows LDAP Server
Thx,
Lukas -
-
during the sync process to fetch user and groups from my Windows AD
Here is a Log-File from the last sync i tried
2024-10-22T11:56:42.621Z box:taskworker Starting task 48. Logs are at /home/yellowtent/platformdata/logs/tasks/48.log
2024-10-22T11:56:42.675Z box:tasks update 48: {"percent":10,"message":"Starting ldap user sync"}
2024-10-22T11:56:42.952Z box:externalldap syncUsers: Found 21 users
2024-10-22T11:56:42.954Z box:taskworker Task took 0.41 seconds
2024-10-22T11:56:42.954Z box:tasks setCompleted - 48: {"result":null,"error":{"stack":"TypeError: Cannot read properties of undefined (reading 'toLowerCase')\n at translateUser (/home/yellowtent/box/src/externalldap.js:49:54)\n at syncUsers (/home/yellowtent/box/src/externalldap.js:355:24)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async sync (/home/yellowtent/box/src/externalldap.js:509:5)","message":"Cannot read properties of undefined (reading 'toLowerCase')"}}
2024-10-22T11:56:42.954Z box:tasks update 48: {"percent":100,"result":null,"error":{"stack":"TypeError: Cannot read properties of undefined (reading 'toLowerCase')\n at translateUser (/home/yellowtent/box/src/externalldap.js:49:54)\n at syncUsers (/home/yellowtent/box/src/externalldap.js:355:24)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async sync (/home/yellowtent/box/src/externalldap.js:509:5)","message":"Cannot read properties of undefined (reading 'toLowerCase')"}}
TypeError: Cannot read properties of undefined (reading 'toLowerCase')
at translateUser (/home/yellowtent/box/src/externalldap.js:49:54)
at syncUsers (/home/yellowtent/box/src/externalldap.js:355:24)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async sync (/home/yellowtent/box/src/externalldap.js:509:5) -
So the crash happens at https://git.cloudron.io/cloudron/box/-/blob/master/src/externalldap.js?ref_type=heads#L49 we will provide a fix to have a better error message, but generally this will not "fix" the issue.
Looks like some LDAP object from your LDAP server is returning a user record without a username field.
Could this be the issue? -