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

empty email attribute in LDAP causes exception #201

Closed
AndyH010493 opened this issue May 23, 2017 · 15 comments
Closed

empty email attribute in LDAP causes exception #201

AndyH010493 opened this issue May 23, 2017 · 15 comments
Assignees
Labels
Milestone

Comments

@AndyH010493
Copy link

Hello,

I am importing my users but am getting the below error. Would you be able to provide some insight on this please?

2017-05-23 12:31:05 31914 ERROR main - Unhandled exception
Traceback (most recent call last):
File "/home/adobesync/.pex/install/user_sync-2.1-py2-none-any.whl.5b02240d49b48000b66132a75942ae8ff00ba845/user_sync-2.1-py2-none-any.whl/user_sync/app.py", line 345, in main
begin_work(config_loader)
File "/home/adobesync/.pex/install/user_sync-2.1-py2-none-any.whl.5b02240d49b48000b66132a75942ae8ff00ba845/user_sync-2.1-py2-none-any.whl/user_sync/app.py", line 203, in begin_work
rule_processor.run(directory_groups, directory_connector, umapi_connectors)
File "/home/adobesync/.pex/install/user_sync-2.1-py2-none-any.whl.5b02240d49b48000b66132a75942ae8ff00ba845/user_sync-2.1-py2-none-any.whl/user_sync/rules.py", line 147, in run
self.read_desired_user_groups(directory_groups, directory_connector)
File "/home/adobesync/.pex/install/user_sync-2.1-py2-none-any.whl.5b02240d49b48000b66132a75942ae8ff00ba845/user_sync-2.1-py2-none-any.whl/user_sync/rules.py", line 293, in read_desired_user_groups
if not self.is_selected_user_key(user_key):
File "/home/adobesync/.pex/install/user_sync-2.1-py2-none-any.whl.5b02240d49b48000b66132a75942ae8ff00ba845/user_sync-2.1-py2-none-any.whl/user_sync/rules.py", line 406, in is_selected_user_key
username = self.get_username_from_user_key(user_key)
File "/home/adobesync/.pex/install/user_sync-2.1-py2-none-any.whl.5b02240d49b48000b66132a75942ae8ff00ba845/user_sync-2.1-py2-none-any.whl/user_sync/rules.py", line 901, in get_username_from_user_key
return self.parse_user_key(user_key)[1]
File "/home/adobesync/.pex/install/user_sync-2.1-py2-none-any.whl.5b02240d49b48000b66132a75942ae8ff00ba845/user_sync-2.1-py2-none-any.whl/user_sync/rules.py", line 898, in parse_user_key
return user_key.split(',')
AttributeError: 'NoneType' object has no attribute 'split'
2017-05-23 12:31:05 31914 INFO main - ========== End Run (User Sync version: 2.1) (Total time: 0:00:01)

Thanks
Andy

@adobeDan
Copy link
Contributor

What's apparently happening here is that, when your directory is being read, there are None objects coming back for some of the users in the directory. We have not seen this before, and I can't really investigate it without having more of the log to look at. Can you upload an entire debug-level log for a run that has this error?

@AndyH010493
Copy link
Author

Thank you for the information.

is there a flag for obtaining a debug-level log?

@adobeDan
Copy link
Contributor

adobeDan commented May 23, 2017

In your main user-sync-config.yml file, in the logging section (typically at the bottom), specify debug as the value for the file_log_level: setting. See the example file 1 user-sync-config.yml for details.

@AndyH010493
Copy link
Author

I have sent you the log file via my company's file transfer service

@adobeDan
Copy link
Contributor

I got the log, will take a look later today.

@AndyH010493
Copy link
Author

Hello,

just wondering if there is any update on this?

Thanks
Andy

@adobeDan
Copy link
Contributor

So sorry! I promise an update by end-of-day (Pacific Time) tomorrow!

@AndyH010493
Copy link
Author

no worries and Thankyou

@adobeDan
Copy link
Contributor

OK, so I can't be sure about this but I think I may have found the issue. It's looking to me like you have a user in your LDAP directory who has a defined email attribute but the value of that attribute is the empty string. That is an edge case that we should check for and catch, and it would lead to exactly the error in your log: there is a created directory user whose "user key" is the None value.

Can you please check to see if you have any users in your LDAP directory that have a defined "mail" attribute but for whom that attribute value is empty? If you can confirm that's the case, then I can be sure I've found the issue. Thanks!

@adobeDan adobeDan self-assigned this May 31, 2017
@AndyH010493
Copy link
Author

ok yes, it definitely appears to be the case. I ran a powershell script to pull a list of the users in my AD that have no mail attribute set and the user that the adobe sync tool fails at is one of the users that do not have a mail attribute

@adobeDan
Copy link
Contributor

adobeDan commented Jun 1, 2017

Thanks so much for the confirmation. I will catch this case and guard against it properly. Marking this as a bug.

@adobeDan adobeDan added this to the v2.1.1 milestone Jun 1, 2017
@adobeDan adobeDan changed the title ERROR main - Unhandled exception empty email attribute in LDAP causes exception Jun 2, 2017
@AndyH010493
Copy link
Author

Hello, sorry to pester. I was wondering if there is any time scale on when a fix can be applied?

@adobeDan
Copy link
Contributor

adobeDan commented Jun 6, 2017

Hi Andy, not a bother at all. The fix is already working locally and I will push it for an rc build of 2.1.1 tomorrow or Wednesday. We hope to have the 2.1.1 release ready Friday with this fix.

@adobeDan
Copy link
Contributor

adobeDan commented Jun 6, 2017

So there is one more case my fix didn't catch: an email value consisting just of whitespace. The same issue applied to username and domain values as well.

@adobeDan adobeDan reopened this Jun 6, 2017
@AndyH010493
Copy link
Author

Hi Dan,

Strange one. I have installed version 2.1.1 of the user-sync tool but I'm still getting the same error. See below:

2017-06-13 10:10:19 32744 ERROR main - Unhandled exception
Traceback (most recent call last):
File "/home/adobesync/.pex/install/user_sync-2.1.1-py2-none-any.whl.d74436c53f3ebfa40d11c3b3623530ef8a9bb6e8/user_sync-2.1.1-py2-none-any.whl/user_sync/app.py", line 352, in main
begin_work(config_loader)
File "/home/adobesync/.pex/install/user_sync-2.1.1-py2-none-any.whl.d74436c53f3ebfa40d11c3b3623530ef8a9bb6e8/user_sync-2.1.1-py2-none-any.whl/user_sync/app.py", line 210, in begin_work
rule_processor.run(directory_groups, directory_connector, umapi_connectors)
File "/home/adobesync/.pex/install/user_sync-2.1.1-py2-none-any.whl.d74436c53f3ebfa40d11c3b3623530ef8a9bb6e8/user_sync-2.1.1-py2-none-any.whl/user_sync/rules.py", line 154, in run
self.read_desired_user_groups(directory_groups, directory_connector)
File "/home/adobesync/.pex/install/user_sync-2.1.1-py2-none-any.whl.d74436c53f3ebfa40d11c3b3623530ef8a9bb6e8/user_sync-2.1.1-py2-none-any.whl/user_sync/rules.py", line 300, in read_desired_user_groups
if not self.is_selected_user_key(user_key):
File "/home/adobesync/.pex/install/user_sync-2.1.1-py2-none-any.whl.d74436c53f3ebfa40d11c3b3623530ef8a9bb6e8/user_sync-2.1.1-py2-none-any.whl/user_sync/rules.py", line 411, in is_selected_user_key
username = self.get_username_from_user_key(user_key)
File "/home/adobesync/.pex/install/user_sync-2.1.1-py2-none-any.whl.d74436c53f3ebfa40d11c3b3623530ef8a9bb6e8/user_sync-2.1.1-py2-none-any.whl/user_sync/rules.py", line 907, in get_username_from_user_key
return self.parse_user_key(user_key)[1]
File "/home/adobesync/.pex/install/user_sync-2.1.1-py2-none-any.whl.d74436c53f3ebfa40d11c3b3623530ef8a9bb6e8/user_sync-2.1.1-py2-none-any.whl/user_sync/rules.py", line 904, in parse_user_key
return user_key.split(',')
AttributeError: 'NoneType' object has no attribute 'split'
2017-06-13 10:10:19 32744 INFO main - ========== End Run (User Sync version: 2.1.1) (Total time: 0:00:01)

adobeDan added a commit that referenced this issue Jun 13, 2017
I thought I had fixed this when I put in the fix #201, but it looks like I didn't catch all the cases.  So now I'm going directly to the source, looking for empty user keys as they are computed, ignoring those users, and logging their details so we can figure out why their user key is empty.
vossen-adobe added a commit to vossen-adobe/user-sync-fork that referenced this issue Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants