{"action":"created","issue":{"url":"https://api.github.com/repos/adobe-apiplatform/user-sync.py/issues/367","repository_url":"https://api.github.com/repos/adobe-apiplatform/user-sync.py","labels_url":"https://api.github.com/repos/adobe-apiplatform/user-sync.py/issues/367/labels{/name}","comments_url":"https://api.github.com/repos/adobe-apiplatform/user-sync.py/issues/367/comments","events_url":"https://api.github.com/repos/adobe-apiplatform/user-sync.py/issues/367/events","html_url":"https://github.com/adobe-apiplatform/user-sync.py/issues/367","id":340840985,"node_id":"MDU6SXNzdWUzNDA4NDA5ODU=","number":367,"title":"The error \"Failed to exchange token\" again displayed.","user":{"login":"Tomomi99145","id":35795898,"node_id":"MDQ6VXNlcjM1Nzk1ODk4","avatar_url":"https://avatars2.githubusercontent.com/u/35795898?v=4","gravatar_id":"","url":"https://api.github.com/users/Tomomi99145","html_url":"https://github.com/Tomomi99145","followers_url":"https://api.github.com/users/Tomomi99145/followers","following_url":"https://api.github.com/users/Tomomi99145/following{/other_user}","gists_url":"https://api.github.com/users/Tomomi99145/gists{/gist_id}","starred_url":"https://api.github.com/users/Tomomi99145/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tomomi99145/subscriptions","organizations_url":"https://api.github.com/users/Tomomi99145/orgs","repos_url":"https://api.github.com/users/Tomomi99145/repos","events_url":"https://api.github.com/users/Tomomi99145/events{/privacy}","received_events_url":"https://api.github.com/users/Tomomi99145/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-13T00:24:06Z","updated_at":"2018-07-13T03:35:58Z","closed_at":null,"author_association":"NONE","body":"Error is displayed when executing user-sync command.\r\nPlease tell me the solution.\r\n\r\nExample of execution\r\n↓\r\n2018-07-13 09:18:03 3644 INFO main - ========== Start Run (User Sync version: 2.2.2) ============\r\n2018-07-13 09:18:03 3644 INFO main - ------- Invocation parameters -------\r\n2018-07-13 09:18:03 3644 INFO main - user-sync.pex -t --users all --adobe-only-user-action exclude\r\n2018-07-13 09:18:03 3644 DEBUG main - -------- Internal parameters --------\r\n2018-07-13 09:18:03 3644 DEBUG main -   test_mode: True\r\n2018-07-13 09:18:03 3644 DEBUG main -   config_filename: user-sync-config.yml\r\n2018-07-13 09:18:03 3644 DEBUG main -   users: ['all']\r\n2018-07-13 09:18:03 3644 DEBUG main -   username_filter_pattern: None\r\n2018-07-13 09:18:03 3644 DEBUG main -   update_user_info: False\r\n2018-07-13 09:18:03 3644 DEBUG main -   manage_groups: False\r\n2018-07-13 09:18:03 3644 DEBUG main -   adobe_only_user_action: ['exclude']\r\n2018-07-13 09:18:03 3644 DEBUG main -   stray_list_input_path: None\r\n2018-07-13 09:18:03 3644 DEBUG main -   encoding_name: utf8\r\n2018-07-13 09:18:03 3644 DEBUG main -   strategy: sync\r\n2018-07-13 09:18:03 3644 INFO main - -------------------------------------\r\n2018-07-13 09:18:03 3644 DEBUG ldap - ldap initialized with options: {'group_filter_format': '(&(|(objectCategory=group)(objectClass=groupOfNames)(objectClass=posixGroup))(cn={group}))', 'all_users_filter': '(&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))', 'group_member_filter_format': '(memberOf={group_dn})', 'require_tls_cert': False, 'string_encoding': 'utf8', 'user_identity_type_format': None, 'user_email_format': '{mail}', 'user_username_format': None, 'user_domain_format': None, 'user_identity_type': 'federatedID', 'search_page_size': 200, 'logger_name': 'ldap', 'host': 'ldaps://dooon.work', 'username': 'osabe@dooon.work', 'base_dn': 'DC=dooon,DC=work'}\r\n2018-07-13 09:18:03 3644 DEBUG ldap - Connecting to: ldaps://dooon.work using username: osabe@dooon.work\r\n2018-07-13 09:18:03 3644 DEBUG ldap - Connected\r\n2018-07-13 09:18:03 3644 DEBUG umapi - UMAPI initialized with options: {'logger_name': 'umapi', 'test_mode': True, 'server': {'host': 'usermanagement.adobe.io', 'endpoint': '/v2/usermanagement', 'ims_host': 'ims-na1.adobelogin.com', 'ims_endpoint_jwt': '/ims/exchange/jwt', 'timeout': 120, 'retries': 3}, 'enterprise': {'org_id': '01830D295969307D0A495D1E@AdobeOrg', 'tech_acct': '622835905AF4E0320A495C04@techacct.adobe.com'}}\r\n2018-07-13 09:18:03 3644 DEBUG umapi - umapi: reading private key data from file C:\\user_sync\\Utils\\openSSL\\private.key\r\n2018-07-13 09:18:03 3644 DEBUG umapi - umapi: creating connection for org 01830D295969307D0A495D1E@AdobeOrg at endpoint https://usermanagement.adobe.io/v2/usermanagement\r\n2018-07-13 09:18:04 3644 DEBUG urllib3.connectionpool - Starting new HTTPS connection (1): ims-na1.adobelogin.com\r\n2018-07-13 09:18:05 3644 DEBUG urllib3.connectionpool - https://ims-na1.adobelogin.com:443 \"POST /ims/exchange/jwt HTTP/1.1\" 200 None\r\n2018-07-13 09:18:05 3644 DEBUG umapi - umapi: connection established\r\n2018-07-13 09:18:05 3644 DEBUG processor - Initialized with options: {'after_mapping_hook': None, 'default_country_code': 'JP', 'delete_strays': False, 'directory_group_filter': None, 'directory_group_mapped': False, 'disentitle_strays': False, 'exclude_groups': [], 'exclude_identity_types': ['adobeID'], 'exclude_strays': True, 'exclude_users': [], 'extended_attributes': None, 'manage_groups': False, 'max_adobe_only_users': 200, 'new_account_type': 'federatedID', 'remove_strays': False, 'strategy': 'sync', 'stray_list_input_path': None, 'stray_list_output_path': None, 'test_mode': True, 'update_user_info': False, 'username_filter_regex': None}\r\n2018-07-13 09:18:05 3644 INFO processor - ---------- Start Load from Directory -----------------------\r\n2018-07-13 09:18:05 3644 DEBUG processor - Building work list...\r\n2018-07-13 09:18:05 3644 WARNING ldap - Skipping user with dn CN=dcaasadmin,CN=Users,DC=dooon,DC=work: empty email attribute (mail)\r\n2018-07-13 09:18:05 3644 WARNING ldap - Skipping user with dn CN=Taro Adobe,OU=AADDC Users,DC=dooon,DC=work: empty email attribute (mail)\r\n2018-07-13 09:18:05 3644 WARNING ldap - Skipping user with dn CN=Tomomi Osabe,OU=AADDC Users,DC=dooon,DC=work: empty email attribute (mail)\r\n2018-07-13 09:18:05 3644 WARNING ldap - Skipping user with dn CN=osabe@adobe.com Osabe,OU=AADDC Users,DC=dooon,DC=work: empty email attribute (mail)\r\n2018-07-13 09:18:05 3644 DEBUG ldap - Total users loaded: 0\r\n2018-07-13 09:18:05 3644 DEBUG processor - Total directory users after filtering: 0\r\n2018-07-13 09:18:05 3644 DEBUG processor - Group work list: {None: {}}\r\n2018-07-13 09:18:05 3644 INFO processor - ---------- End Load from Directory (Total time: 0:00:00) ---\r\n2018-07-13 09:18:05 3644 INFO processor - ---------- Start Sync with UMAPI ---------------------------\r\n2018-07-13 09:18:05 3644 DEBUG processor - Syncing users to umapi...\r\n2018-07-13 09:18:05 3644 DEBUG urllib3.connectionpool - Starting new HTTPS connection (1): usermanagement.adobe.io\r\n2018-07-13 09:18:05 3644 DEBUG urllib3.connectionpool - https://usermanagement.adobe.io:443 \"GET /v2/usermanagement/users/01830D295969307D0A495D1E@AdobeOrg/0?directOnly=True HTTP/1.1\" 401 95\r\n2018-07-13 09:18:05 3644 ERROR main - Unhandled exception\r\nTraceback (most recent call last):\r\n  File \"c:\\pex\\install\\user_sync-2.2.2-py3-none-any.whl.56859f7b19ab6fcd1575d2fc52de777a8c4ead8c\\user_sync-2.2.2-py3-none-any.whl\\user_sync\\app.py\", line 362, in main\r\n    begin_work(config_loader)\r\n  File \"c:\\pex\\install\\user_sync-2.2.2-py3-none-any.whl.56859f7b19ab6fcd1575d2fc52de777a8c4ead8c\\user_sync-2.2.2-py3-none-any.whl\\user_sync\\app.py\", line 213, in begin_work\r\n    rule_processor.run(directory_groups, directory_connector, umapi_connectors)\r\n  File \"c:\\pex\\install\\user_sync-2.2.2-py3-none-any.whl.56859f7b19ab6fcd1575d2fc52de777a8c4ead8c\\user_sync-2.2.2-py3-none-any.whl\\user_sync\\rules.py\", line 175, in run\r\n    self.sync_umapi_users(umapi_connectors)\r\n  File \"c:\\pex\\install\\user_sync-2.2.2-py3-none-any.whl.56859f7b19ab6fcd1575d2fc52de777a8c4ead8c\\user_sync-2.2.2-py3-none-any.whl\\user_sync\\rules.py\", line 426, in sync_umapi_users\r\n    primary_adds_by_user_key = self.update_umapi_users_for_connector(umapi_info, umapi_connector)\r\n  File \"c:\\pex\\install\\user_sync-2.2.2-py3-none-any.whl.56859f7b19ab6fcd1575d2fc52de777a8c4ead8c\\user_sync-2.2.2-py3-none-any.whl\\user_sync\\rules.py\", line 744, in update_umapi_users_for_connector\r\n    for umapi_user in umapi_connector.iter_users():\r\n  File \"c:\\pex\\install\\user_sync-2.2.2-py3-none-any.whl.56859f7b19ab6fcd1575d2fc52de777a8c4ead8c\\user_sync-2.2.2-py3-none-any.whl\\user_sync\\connector\\umapi.py\", line 141, in iter_users\r\n    for u in umapi_client.UsersQuery(self.connection):\r\n  File \"c:\\pex\\install\\umapi_client-2.9-py2.py3-none-any.whl.9e8b5907a530f435b6b53572ac7f3f373a746472\\umapi_client-2.9-py2.py3-none-any.whl\\umapi_client\\api.py\", line 201, in __next__\r\n    return self.next()\r\n  File \"c:\\pex\\install\\umapi_client-2.9-py2.py3-none-any.whl.9e8b5907a530f435b6b53572ac7f3f373a746472\\umapi_client-2.9-py2.py3-none-any.whl\\umapi_client\\api.py\", line 197, in next\r\n    return self.query._next_item()\r\n  File \"c:\\pex\\install\\umapi_client-2.9-py2.py3-none-any.whl.9e8b5907a530f435b6b53572ac7f3f373a746472\\umapi_client-2.9-py2.py3-none-any.whl\\umapi_client\\api.py\", line 181, in _next_item\r\n    self._next_page()\r\n  File \"c:\\pex\\install\\umapi_client-2.9-py2.py3-none-any.whl.9e8b5907a530f435b6b53572ac7f3f373a746472\\umapi_client-2.9-py2.py3-none-any.whl\\umapi_client\\api.py\", line 172, in _next_page\r\n    self.url_params, self.query_params)\r\n  File \"c:\\pex\\install\\umapi_client-2.9-py2.py3-none-any.whl.9e8b5907a530f435b6b53572ac7f3f373a746472\\umapi_client-2.9-py2.py3-none-any.whl\\umapi_client\\connection.py\", line 249, in query_multiple\r\n    raise re\r\n  File \"c:\\pex\\install\\umapi_client-2.9-py2.py3-none-any.whl.9e8b5907a530f435b6b53572ac7f3f373a746472\\umapi_client-2.9-py2.py3-none-any.whl\\umapi_client\\connection.py\", line 241, in query_multiple\r\n    result = self.make_call(query_path)\r\n  File \"c:\\pex\\install\\umapi_client-2.9-py2.py3-none-any.whl.9e8b5907a530f435b6b53572ac7f3f373a746472\\umapi_client-2.9-py2.py3-none-any.whl\\umapi_client\\connection.py\", line 423, in make_call\r\n    raise RequestError(result)\r\numapi_client.error.RequestError: Request Error (401): {\"lastPage\":false,\"result\":\"error.internal.exceptionflys\",\"message\":\"Failed to exchange token\"}\r\n2018-07-13 09:18:05 3644 INFO main - ========== End Run (User Sync version: 2.2.2) (Total time: 0:00:01) "},"comment":{"url":"https://api.github.com/repos/adobe-apiplatform/user-sync.py/issues/comments/404716090","html_url":"https://github.com/adobe-apiplatform/user-sync.py/issues/367#issuecomment-404716090","issue_url":"https://api.github.com/repos/adobe-apiplatform/user-sync.py/issues/367","id":404716090,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDcxNjA5MA==","user":{"login":"Tomomi99145","id":35795898,"node_id":"MDQ6VXNlcjM1Nzk1ODk4","avatar_url":"https://avatars2.githubusercontent.com/u/35795898?v=4","gravatar_id":"","url":"https://api.github.com/users/Tomomi99145","html_url":"https://github.com/Tomomi99145","followers_url":"https://api.github.com/users/Tomomi99145/followers","following_url":"https://api.github.com/users/Tomomi99145/following{/other_user}","gists_url":"https://api.github.com/users/Tomomi99145/gists{/gist_id}","starred_url":"https://api.github.com/users/Tomomi99145/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tomomi99145/subscriptions","organizations_url":"https://api.github.com/users/Tomomi99145/orgs","repos_url":"https://api.github.com/users/Tomomi99145/repos","events_url":"https://api.github.com/users/Tomomi99145/events{/privacy}","received_events_url":"https://api.github.com/users/Tomomi99145/received_events","type":"User","site_admin":false},"created_at":"2018-07-13T03:35:58Z","updated_at":"2018-07-13T03:35:58Z","author_association":"NONE","body":"yes,it fail at the same point (right after starting umapi sync) every time."}}
{"actor":{"display_login":"Tomomi99145"}}