用户同步工具 - 常见错误

适用于企业。

列出运行 UST 时的一些常见错误以及解决这些错误的提示

FileNotFoundError: [Errno 2]

控制台错误输出样例:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\USER\\.pex\\install\\pycryptodome [...]'

如果路径长度大于 256 个字符,则在 Windows 上可能会显示此错误。

提示:创建一个名为 PEX_ROOT 的环境变量,其值为 C:\pex(如果脚本是从 C: 驱动器运行的,或者请更改字母以匹配相应的驱动器)。 有时,需要重新启动系统才能使该变量生效。

 

can't open file 'user-sync.pex': [Errno 2]

错误输出示例:

python:无法打开文件 'user-sync.pex': [Errno 2] 没有此类文件或目录

提示:确保从 user-sync.pex 所在的文件夹运行 python 命令行。

 

UMAPI timeout

日志错误输出示例:

2018-01-01 11:49:42 28102 警告 umapi - UMAPI 超时...服务不可用(第 1 次尝试的代码为 429)
2018-01-01 11:49:42 28102 警告 umapi - 42 秒后重试...

提示:如果超时时间少于 30 分钟,当达到每分钟 API 调用配额时,会收到这些警告消息。UST 附带一种指数退避机制以重试调用,以此来增加重试的间隔时间。 尝试失败三次后,脚本将停止运行。

这里的建议是让脚本一直运行到结束。

如果超时时间超过 1000 秒,这将是与每个用户同步工具实例运行频率相关的限制。如果观察到某个实例运行频率过高,它将被限制 30 到 75 分钟之间。虽然超时只是将 UST 暂停一段时间(不是重要的停止类错误),但 UST 会知道在之后恢复并继续同步。

由于脚本能识别同时启动两个实例的情况,因此在初始实例运行完成之前,不能触发新的实例。在这种情况下,UST 日志中可能会出现一条错误消息,内容为:“进程已在进行中”。

以下是关于如何调整运行频率以实现最佳性能的一些建议:

  • 修改计划任务频率,确保至少间隔 2 小时重复一次
  • 修改计划任务触发时间,使其不在整点或半点开始(避开高峰流量时段)
  • 如果需要更频繁地运行该工具,请考虑使用带有推送策略(变更增量)的 UST,而不是完全同步
  • 将 UST 的运行时间表调整为您组织的工作日,即用户需要配置的时间(例如,如果您的组织在夜间不需要修改用户配置,则不要在此时间运行同步作业)

 

 

error.user.belongs_to_another_org

日志条目示例:

2018-01-01 11:49:42 28102 ERROR umapi.action - Error in requestID: action_1 (User: {'user': 'myuser@domain2.com', 'requestID':'action_1'}, Command: {'createFederatedID': {'email': 'myuser@domain2.com', 'country': 'US', 'option': 'ignoreIfAlreadyExists', 'firstname': 'fname', 'lastname': 'lname'}}): code: "error.user.belongs_to_another_org" message: "Illegal to invite user from another organization's owned auth src"

提示:用于创建帐户的域可能未被组织内部声明/信任。在 管理控制台 -> 设置,活动域应会出现绿色旗帜或圆点。如果并非是这种情况,完成域名申领流程即可解决问题。

 

 

error.user.type_mismatch

日志条目示例:

2018-01-01 12:34:23 13383 ERROR umapi.action - Error in requestID: action_6 (User: {'user': ‘user@domain.com’, 'requestID': 'action_6'}, Command: {'createEnterpriseID': {'email': 'user@domain.com', 'option': 'updateIfAlreadyExists', 'firstname': 'test', 'lastname': 'user', 'country': ‘US’}}): code: "error.user.type_mismatch" message: "The user type requested for the invite does not match the claimed domain type"

Missing dependencies

控制台错误输出样例:

无法执行 PEX 文件,缺少以下兼容依赖项:
pyyaml
cryptography
cffi
umapi-client
pycryptodome
pyldap
psutil
user-sync

提示

a) 检查您系统上安装的 Python 版本是否为 32 位版本。 如果是,请卸载 32 位并安装 64 位版本以解决此问题。

b) 检查您从 GitHub 下载的 user-sync.pex 版本是否与 Python 版本和操作系统类型匹配。 例如,对于 Windows 64 位和 Python 3,需要下载 user-sync-v2.3-win64-py365.zip

使用最新版 Python 并非总是最佳选项, 尝试将最初创建的 .pex 与 Python 版本匹配会比较合理。 根据下载的 .zip 文件的后缀,确定有效的 Python 版本。 对于以上示例 (user-sync-v2.3-win64-py365.zip),可以确定使用 Python 3.6.5。

 

 

Error decrypting private key

示例日志条目:

2018-01-01 09:52:23 7920 DEBUG umapi - umapi: reading private key data from file C:\path\to\private.key
2018-01-01 09:52:23 7920 CRITICAL main - umapi configuration.enterprise: Error decrypting private key, either the password is wrong or: RSA key format is not supported

提示:

a) 如果无法快速识别问题,则重新发布密钥对会更快

b) 如果您在 Windows 中运行脚本,请不要使用 umapi_private_key_data 属性, 而是应加密密钥,并将该密码存储在凭据管理器中。

c) 如果使用其他格式发出密钥对,请尝试使用 RSA256 /2048 位长度的私钥

d) 您可以在 connector-umapi.yml 文件中设置 secure_priv_key_pass_key: umapi_private_key_passphrase。 在这种情况下,请确保凭据存储中该值的项目与关联值的项目相匹配(请参阅下文)。

Windows 凭据管理器

 

No value in secure storage for user...

示例日志条目:

2018-01-01 09:52:23 7920 CRITICAL main - umapi CRITICAL main - umapi configuration.enterprise: No value in secure storage for user "someUUIDvalue@AdobeOrg", key "umapi_api_key"

提示

a) umapi_api_key 的凭据存储项目可能缺失。 在凭据存储中创建项目。 可以在此处找到帮助文档。

b) 该项目可能已添加到其他用户帐户下的凭据存储中。 但是,对于当前连接的用户,此项目缺失。 如有必要,添加该项目或切换用户帐户。

 

 

error.internal.exceptionflys / error.unauthorized

示例错误输出:

umapi_client.error.RequestError: Request Error (401): {"lastPage":false,"result":"error.internal.exceptionflys","message":"Failed to exchange token"}

OR

"umapi_client.error.RequestError: Request Error (401): {"lastPage":false,"result":"error.unauthorized","message":"Failed to authenticate provided token"}"

提示:可能在管理控制台 -> 设置 -> 身份验证设置中,选择了除对用户最简单(密码永不过期)以外的选项。如果启用了更安全最安全选项,则会造成链接到集成的技术帐户的密码失效。

要解决此问题,应创建一个新的集成。 确保 connector-umapi.yml 文件也更新了元数据。

已为其部署修复程序,但该修复程序可能会影响 2018 年 10 月之前创建的集成。

 

 

Failed to establish a new connection [Errno 10061]

示例错误输出:

ConnectionError: HTTPSConnectionPool(host='usermanagement.adobe.io', port=443): Max retries exceeded with url: /v2/usermanagement/users/someUUID@AdobeOrg/0?directOnly=True (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x00000000027B9630>: Failed to establish a new connection: [Errno 10061] No connection could be made because the target machine actively refused it',))

提示

该错误与 UST 无法连接到公共 API 端点有关。 本地设置可能由于以下原因而阻止访问:防火墙规则、代理阻止流量、帐户的 Internet 访问权限设置等原因。

在某些情况下,添加 https_proxy 环境变量并设置如下值可能会有所帮助:

http://<proxyAddress>:<port> OR https://<proxyAddress>:<port>

在其他情况下,允许访问以下端点可能会有所帮助:

ims-na1.adobelogin.com:443

usermanagement.adobe.io:443

本地只能通过清除运行帐户对上述端点的访问权限来解决该问题。

 

 

The metascopes in the JWT are not a subset of the metascopes in the binding

示例日志条目:

2017-07-07 09:01:37 4916 CRITICAL main - Connection to org [...] at endpoint https://usermanagement.adobe.io/v2/usermanagement failed: Unable to authorise against https://ims-na1.adobelogin.com/ims/exchange/jwt: Response Code: 400, Response Text: {&quot;error_description&quot;:&quot;The metascopes in the JWT are not a subset of the metascopes in the binding.&quot;,&quot;error&quot;:&quot;invalid_scope&quot;}

提示:访问您在 https://developer.adobe.com/console/projects 创建的集成,并查看列出 API 的左侧菜单。请确保已将用户管理 API 添加为服务(显示在列表中)。 

 

No valid bindings were found for organization and technical account combination

日志项目样例(调试模式):

2017-07-07 09:01:37 4916 CRITICAL main - UMAPI connection to org id 'someUUIDvalue@AdobeOrg' failed: Unable to authorize against https://ims-na1.adobelogin.com/ims/exchange/jwt:
Response Code: 400, Response Text: {&quot;error_description&quot;:&quot;No valid bindings were found for organization and technical account combination&quot;,&quot;error&quot;:&quot;invalid_token&quot;}

提示

a) 这可能是因为 connector-umapi.yml文件中的 tech_acct 值与 https://developer.adobe.com/console/projects 中集成中的技术帐户 ID 以外的值相对应。验证当前集成中的技术帐户 ID 值,并将其复制到此文件。

b) 也可能是由于集成的公共证书过期所致。 续订私钥和公钥。 然后,上传公钥,并使用新密钥替换旧私钥。 验证 connector-umapi.yml 文件中的路径是否指向正确的文件。

c) 检查是否为正确的组织执行了集成。 在 https://developer.adobe.com/console/projects 左上角的下拉列表中选择组织。然后,验证活动集成的技术帐户 ID 值以及其他元数据(组织 ID、密钥和客户 ID)。

 

 

SSL: CERTIFICATE_VERIFY_FAILED

示例日志条目:

2017-07-07 09:01:37 4916 CRITICAL main - UMAPI connection to org id 'someUUIDvalue@AdobeOrg' failed: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)

提示:这是由本地代理服务器启用了 SSL 检查导致的

解决方案1:获取代理的 PEM 格式的根 CA 证书(假设其名称为 thecert.crt)。如果使用的是 DER 格式,请使用 openssl 命令将其转换为 PEM 格式:

openssl x509 -inform DER -in thecert.crt -out thecert.pem -outform PEM

注意:查看证书内容,如果在
-----BEGIN CERTIFICATE----- 和 -----END CERTIFICATE----- 行之间看到 base64 编码的字符串,则表示您拥有 PEM 格式的文件。

接下来,创建名为 REQUESTS_CA_BUNDLE 的环境变量,并将其值设置为 thecert.pem 文件的路径。

解决方案2:在某些 Windows 情况下,如果从与操作系统和 Python 安装位置不同的驱动器运行该工具,可能会出现此错误。将整个脚本移动到操作系统所在的驱动器上可以是一个解决方案。如果不行,可以将包含所有受信任根 CA 的 cacert.pem 文件复制到另一个驱动器,将其路径用作 REQUESTS_CA_BUNDLE 环境变量的输入值。如果代理也检查 SSL 流量,必须将根 CA 证书内容复制到 cacert.pem 文件中,确保代理证书也受信任。

注意:默认情况下,Python 安装将在 C:\Python36\Lib\site-packages\certifi\cacert.pem 路径下包含证书包。

解决方案 3:在代理端,禁用 API 端点 ims-na1.adobelogin.com 和 usermanagement.adobe.io 的 SSL 检查

 

 

No group found [...]

示例日志条目:

2018-01-01 09:01:37 4916 WARNING ldap - No group found for: Name_Of_The_Group

提示

a) LDAP 中不存在具有该确切名称的组;请通过添加该组的正确 LDAP 名称来修复它

b) 在声明的 base_dn 下找不到该组(请参阅 connector-ldap.yml 文件)。 更改 base_dn 值以包含上述组(主要发生在 base_dn 指向某个 OU 时,而不是尽可能广泛)。

 

error.group.not_found

示例日志条目:

2018-01-01 11:25:45 1 ERROR umapi.action - Error in requestID: action_1 (User: {'user': 'myuser@domain.com', 'useAdobeID': True, 'requestID': 'action_1'}, Command: {'add': {'product': ['group_name']}}): code: &quot;error.group.not_found&quot; message: &quot;Group my_group_name was not found&quot;

提示:上面输出中的用户组 group_name 在 Adobe 端不存在,因此请继续创建它。如果要设置 PLC 名称而不是用户组名称,请查看文档页面,以获取更直观的说明。

 

image not found

示例日志条目:

2018-09-05 10:58:08 96329 CRITICAL main - Connection to org some_Org_UUID@AdobeOrg at endpoint https://usermanagement.adobe.io/v2/usermanagement failed: dlopen(/Users/user/.pex/install/cryptography-2.3-cp37-cp37m-macosx_10_12_x86_64.whl.f77d5cc74b0deef9f1df7eacfe5f5ea57ed94a63/cryptography-2.3-cp37-cp37m-macosx_10_12_x86_64.whl/cryptography/hazmat/bindings/_openssl.abi3.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
 Referenced from: /Users/user/.pex/install/cryptography-2.3-cp37-cp37m-macosx_10_12_x86_64.whl.f77d5cc74b0deef9f1df7eacfe5f5ea57ed94a63/cryptography-2.3-cp37-cp37m-macosx_10_12_x86_64.whl/cryptography/hazmat/bindings/_openssl.abi3.so
 Reason: image not found
2018-09-05 10:58:08 96329 INFO main - ========== End Run (User Sync version: 2.3) (Total time: 0:00:00) 

提示:此错误是在 macOS High Sierra 上使用 UST v2.3 和 Python 3.7.0 时记录的。在终端中运行 brew install openssl 解决了这个特定场景的问题。

 

 

Could not create person for type 2 or 3 [...]

日志条目示例:

2019-07-28 07:17:51 2220 ERROR umapi.action - Error in requestID: action_1 (User: {'user': 'user@claimed-domain.com', 'requestID': 'action_1'}, Command: {'createFederatedID': {'email': 'user@claimed-domain.com', 'option': 'updateIfAlreadyExists', 'firstname': 'First', 'lastname': 'Last', 'country': 'US'}}): code: &quot;error.internal.create_failed&quot; message: &quot;Could not create person for type 2 or 3. Renga 结果是 NOT_ALLOWED,资源是外部管理的,并且令牌缺少 GROUP_SOURCE_UPDATE 目的。”

有时,@claimed-domain.com 由其他组织拥有,该组织已设置 Azure 或 Google 连接器来管理帐户与 Admin Console 的同步。 接下来,将同一域委托给使用“用户同步工具”的其他组织来同步格式为 @claimed-domain.com 的帐户

原因:当同步工具从 LDAP 服务器中提取
user@claimed-domain.com 帐户以在辅助组织中创建该帐户时,出现此记录消息。但是,系统尚未通过 Azure 或 Google 连接器在主要组织中创建/存储该帐户。

提示:尝试使用 Azure 或 Google 连接器在组织中创建/同步 user@claimed-domain.com 帐户,然后重试与受托人组织中的 UST 同步。

 

 

Unexpected LDAP failure reading [...]

示例日志条目:

2018-09-05 10:58:08 96329 6348 CRITICAL main - Unexpected LDAP failure reading group info: {'desc': 'Referral', 'info': 'Referral:\nldap://domain.local/DC=sub,DC=domain,DC=local'}

可能的原因:目标组位于子域中,但主机值是根域之一。

提示:将 host 值更改为可以找到用户组的子域之一。如果用户或目标组同时位于根域及其子域中,请使用根域上的全局目录端口。 将子域中的组修改为通用,而不是全局。 使用全局目录的主机值示例:ldap://domain.local:3268ldaps://domain.local:3269

对于最后一种情况,如果使用全局目录端口,请确保 base_dn 值不包含任何值:

base_dn: ""

 

error.organization.invalid_id

示例日志条目:

2020-08-20 12:00:00 1892 ERROR main - Unhandled exception
    raise RequestError(result)
umapi_client.error.RequestError: Request Error (401): {&quot;lastPage&quot;:false,&quot;result&quot;:&quot;error.organization.invalid_id&quot;,
&quot;message&quot;:&quot;UNAUTHORIZED&quot;}

这个错误出现在较旧的集成中。

解决方法:在 https://developer.adobe.com/console/projects 创建一个新的集成(或项目),与现有的用于相同目的的集成并列。新集成将提供新的凭据,请务必在 connector-umapi.yml 文件中更新它们。密钥对(私钥/公钥)很有可能被重新颁发,因此,新的私钥要替换现有私钥。

 

 

无法创建 createFederatedID 类型的人员

示例日志条目:

2021-01-01 18:00:00 14063 ERROR umapi.action - Error in requestID: action_19 (User: {'user': 'some_user', 'domain': some.domain', 'requestID': 'action_19'}, Command: {'createFederatedID': {'email': 'some_user@some.domain', 'option': 'ignoreIfAlreadyExists', 'firstname': 'FName', 'lastname': 'LName, 'country': 'GB'}}): code: &quot;error.internal.create_failed&quot; message: &quot;Could not create person of type createFederatedID&quot;

这是由多种原因引发的一般错误,但通常的问题是创建操作中使用的域受到 Azure 或 Google 同步设置的影响。

检查方法:使用系统管理员帐户登录管理控制台,单击“设置”菜单,单击包含域的目录,然后单击“同步”菜单选项卡

同步菜单中是否存在同步源卡?

如果回答为,则修复取决于同步应如何继续:

-> 如果 Azure 或 Google 连接器应该执行同步,应继续同步源设置并完全删除 UST

-> 如果 UST 需要进行同步,请点击“前往设置”按钮,然后点击页面底部的“移除同步”按钮;此后,UST 应该会照常运行

如果回答为,则当前 UST 可能针对一个控制台运行,而该控制台中相关域是由另一个控制台(所属组织)委托的。该组织可能已打开 Azure 或 Google 同步,并可能导致当前错误。针对他的情况,解决方法是先在所属组织/控制台中同步帐户,然后使用 UST 在当前控制台中创建/添加帐户。

如果上述情况均不符合当前现实,应联系企业支持。

 

Adobe, Inc.

更快、更轻松地获得帮助

新用户?