Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with new 3.0.0 release #39

Closed
a-schild opened this issue Feb 18, 2023 · 3 comments
Closed

Error with new 3.0.0 release #39

a-schild opened this issue Feb 18, 2023 · 3 comments

Comments

@a-schild
Copy link
Contributor

Got the new version up and running, but upon issuing the test request with my login it throws this error

ldap_1  | 2023-02-18T14:53:45.076Z [DEBUG] root logger - Debug mode enabled, expect lots of output!
ldap_1  | 2023-02-18T14:53:45.088Z [DEBUG] root logger - ChurchTools-LDAP-Wrapper listening @ ldap://0.0.0.0:1389
ldap_1  | 2023-02-18T14:53:50.428Z [DEBUG] churchtools - Admin bind DN: cn=root, ou=users, o=churchtools
ldap_1  | 2023-02-18T14:53:50.428Z [DEBUG] churchtools - Admin bind successful
ldap_1  | 2023-02-18T14:53:50.436Z [DEBUG] churchtools - SEARCH base object: o=churchtools scope: sub
ldap_1  | 2023-02-18T14:53:50.437Z [DEBUG] churchtools - Filter: (&(&(objectclass=ctperson))(|(cn=*andre*)(mail=*andre*)))
ldap_1  | 2023-02-18T14:53:50.438Z [DEBUG] churchtools - Search for users and groups combined
ldap_1  | 2023-02-18T14:53:50.445Z [DEBUG] churchtools - Wait on Promise for cache key "rawData".
ldap_1  | 2023-02-18T14:53:50.445Z [DEBUG] churchtools - Wait on Promise for cache key "users".
ldap_1  | 2023-02-18T14:53:50.446Z [DEBUG] churchtools - Returning pending Promise for cache key "rawData".
ldap_1  | 2023-02-18T14:53:50.446Z [DEBUG] churchtools - Wait on Promise for cache key "rawData".
ldap_1  | 2023-02-18T14:53:50.447Z [DEBUG] churchtools - Wait on Promise for cache key "groups".
ldap_1  | 2023-02-18T14:53:50.775Z [DEBUG] churchtools - fetchGroupTypes done
ldap_1  | 2023-02-18T14:53:50.963Z [DEBUG] churchtools - fetchMemberships done
ldap_1  | 2023-02-18T14:53:51.221Z [DEBUG] churchtools - fetchGroups done
ldap_1  | 2023-02-18T14:53:51.540Z [DEBUG] churchtools - Admin bind DN: cn=root, ou=users, o=churchtools
ldap_1  | 2023-02-18T14:53:51.540Z [DEBUG] churchtools - Admin bind successful
ldap_1  | 2023-02-18T14:53:51.543Z [DEBUG] churchtools - SEARCH base object: cn=cvon wartburg, ou=users, o=churchtools scope: base
ldap_1  | 2023-02-18T14:53:51.543Z [DEBUG] churchtools - Filter: (objectclass=*)
ldap_1  | 2023-02-18T14:53:51.544Z [DEBUG] churchtools - Search for users
ldap_1  | 2023-02-18T14:53:51.544Z [DEBUG] churchtools - Returning pending Promise for cache key "users".
ldap_1  | 2023-02-18T14:53:51.544Z [DEBUG] churchtools - Wait on Promise for cache key "users".
ldap_1  | 2023-02-18T14:53:52.377Z [DEBUG] churchtools - fetchPersons done
ldap_1  | 2023-02-18T14:53:52.380Z [DEBUG] churchtools - Store cache entry for cache key "rawData".
ldap_1  | 2023-02-18T14:53:52.382Z [DEBUG] churchtools - Updated users: 61
ldap_1  | 2023-02-18T14:53:52.383Z [DEBUG] churchtools - Updated groups: 178
ldap_1  | 2023-02-18T14:53:52.384Z [DEBUG] churchtools - Store cache entry for cache key "users".
ldap_1  | 2023-02-18T14:53:52.384Z [DEBUG] churchtools - Store cache entry for cache key "groups".
ldap_1  | 2023-02-18T14:53:52.387Z [DEBUG] churchtools - MatchUser: cn=cvon wartburg,ou=users,o=churchtools
ldap_1  | file:///app/ctldap.js:637
ldap_1  |   const tv = helpers.getAttrValue(target, this.attribute, strictAttrCase);
ldap_1  |                                                ^
ldap_1  |
ldap_1  | TypeError: Cannot read properties of undefined (reading 'attribute')
ldap_1  |     at ldap.filters.SubstringFilter.matches (file:///app/ctldap.js:637:48)
ldap_1  |     at OrFilter.matches (/app/node_modules/ldapjs/node_modules/ldap-filter/lib/or_filter.js:49:25)
ldap_1  |     at AndFilter.matches (/app/node_modules/ldapjs/node_modules/ldap-filter/lib/and_filter.js:54:26)
ldap_1  |     at file:///app/ctldap.js:481:81
ldap_1  |     at Array.forEach (<anonymous>)
ldap_1  |     at file:///app/ctldap.js:480:11
ldap_1  |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
ldap_1  |
ldap_1  | Node.js v18.14.1

@milux
Copy link
Owner

milux commented Feb 20, 2023

This is seemingly related to changes I made analogous to churchtools#4.
Interesting... Could you console.log() the attributes and the this context when this error is thrown?

@milux
Copy link
Owner

milux commented Feb 20, 2023

Ah, found the reason! I was a bit stupid. 😆
Arrow functions make it impossible to override the this context, so now its always the parent object of ctldap.js. 🤦
Fix to follow soon.

@milux
Copy link
Owner

milux commented Feb 20, 2023

Should be fixed with 3.0.1 now.

@milux milux closed this as completed Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants