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

User-Sync tool crashing with "AttributeError: 'NoneType' object has no attribute 'split'" #227

Closed
AndyH010493 opened this issue Jun 13, 2017 · 15 comments
Assignees
Labels
Milestone

Comments

@AndyH010493
Copy link

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
Copy link
Contributor

Hmmmm. Can you send me your debug logs again? I need to figure out if the catch for empty emails isn't working (which would surprise me) or whether there's some other form of unexpected email format that's crashing the tool (which I suspect).

Also, what platform are you on? I'd like to post an instrumented build for you that will help me narrow this down.

@AndyH010493
Copy link
Author

Hi Dan,

Will send the log over now.

Im running the tool on an Ubuntu server

Thanks
Andy

@AndyH010493
Copy link
Author

log has just been sent

@adobeDan
Copy link
Contributor

ok, got the log and compared it with what was happening before. There's clearly a failure mode that I didn't think of before, and now I'm kicking myself for not catching it at the root of the failure. Ah, well, live and learn. I'm going to put in a better fix that also instruments the source of the problem and then post a build for you to try. Which version of Ubuntu? I'll use 14 LTS Trusty unless you want something newer.

@adobeDan adobeDan added the bug label Jun 13, 2017
@adobeDan adobeDan added this to the 2.2 milestone Jun 13, 2017
@chad-fox
Copy link

chad-fox commented Jun 13, 2017

Hi @adobeDan I have a similar issue but in Windows (2012r2), running v2.1.

PS C:\UserSyncTool> C:\UserSyncTool\AdobeUserSync_TEST_MODE.ps1
2017-06-13 12:26:04 3668 INFO config - Using main config file: user-sync-config.yml
2017-06-13 12:26:04 3668 ERROR main - Unhandled exception
Traceback (most recent call last):
File "c:\user-sync.pex\install\user_sync-2.1-py2-none-any.whl.fa4c34d1dc170ed47d2293e859ef616253546b5a\user_sync-2.1-py2-none-any.whl\user_sync\app.py", line 33
0, in main
init_log(config_loader.get_logging_config())
File "c:\user-sync.pex\install\user_sync-2.1-py2-none-any.whl.fa4c34d1dc170ed47d2293e859ef616253546b5a\user_sync-2.1-py2-none-any.whl\user_sync\app.py", line 14
2, in init_log
fileHandler = logging.FileHandler(file_path)
File "C:\Python27\lib\logging_init_.py", line 913, in init
StreamHandler.init(self, self.open())
File "C:\Python27\lib\logging_init
.py", line 943, in _open
stream = open(self.baseFilename, self.mode)

I only get the error when running in test mode, users sync into the console without issue.

@adobeDan
Copy link
Contributor

@chad-fox This doesn't look like a related error. Can you please open a separate issue about this, setting console_log_level to be debug in your config, and attaching the full console output? (There should be no need to sanitize it, because this is an early quit so no user data should be in the output.)

@AndyH010493
Copy link
Author

@adobeDan Im using Ubuntu 16.04.2

@AndyH010493
Copy link
Author

thanks for the quick reply btw

@adobeDan
Copy link
Contributor

OK here's a 2.2a1 release for you to try, built off the issue227 branch on Ubuntu 16.04.2 LTS (server). This should (hopefully! :) not crash, and should log warnings for the users on which it was crashing before.

@AndyH010493
Copy link
Author

@adobeDan - This looks to have worked successfully. DO you want me to email you my log so you can check?

@adobeDan
Copy link
Contributor

@AndyH010493 Yes please I would LOVE to see the log so I can find out how this happens! :)

@AndyH010493
Copy link
Author

@adobeDan I have just emailed you the log. Thanks again

@adobeDan
Copy link
Contributor

adobeDan commented Jun 14, 2017

And thank you @AndyH010493 for the log, which I have received! I'll let you know what I find after I have a chance to analyze it against the last one you sent me.

@adobeDan
Copy link
Contributor

So it turns out users with "improperly formatted email addresses" (no domain, illegal characters, etc.) were crashing us. Since this is a rare event on the customer side (congrats, @AndyH010493, for being the first customer to have this happen :), I think the general warning message being used (which simply says that the user is being skipped because they don't have a valid user key), along with the dump of the user data, is probably enough for customers to find them (if they care). I'll merge this fix, which will close this bug.

@AndyH010493
Copy link
Author

Thanks @adobeDan. There's always a first :)

adobeDan added a commit that referenced this issue Jun 16, 2017
Fix #227: crash on None value for user key
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

3 participants