在使用汇总服务时,可能会因多种因素而导致问题,包括报告格式、输出网域问题和协调程序问题。请务必了解错误来源及其包含的所有元数据,以便准确诊断问题。
指南主题:
验证客户端 Measurement API 设置
验证源服务器已正确注册后,请完成以下步骤:
检查您是如何触发报告的。确认您收到的报告格式是否与所使用的 API 相符:
- Attribution Reporting API
- Private Aggregation API
- 您可以使用
contributeToHistogram
函数在 Private Aggregation API 中生成报告。请确保您传递的是存储分区键和值。存储分区键应采用BigInt
格式。(详细了解 Private Aggregation API)
- 您可以使用
如果您按照建议触发报告,但问题仍然存在,请检查 Chrome 开发者控制台中的“控制台”和“网络”标签页中是否存在错误。
如果您需要有关这些客户端 API 的进一步问题排查支持,请参阅我们的 Attribution Reporting API 调试指南和 Private Aggregation API + Shared Storage。
排查报告来源设置问题
报告来源服务器是您声明正确的对应 .well-known
端点的位置,系统会将可汇总报告发送到这些端点。验证您部署的报告来源服务器是否已正确注册。
您的报告来源是否在接收报告?
验证您部署的报告来源服务器是否已正确注册。您已在此服务器上声明了正确的相应 .well-known
端点,系统会将可汇总的报告发送到这些端点。
客户端衡量 API | 匹配的可汇总端点 |
---|---|
归因报告 | POST /.well-known/attribution-reporting/report-aggregate-attribution |
Private Aggregation + Shared Storage(组合) | POST /.well-known/private-aggregation/report-shared-storage |
Private Aggregation + Protected Audience(组合) | POST /.well-known/private-aggregation/report-protected-audience |
验证源服务器已正确注册后,请完成以下步骤:
检查您是如何触发报告的。确认您收到的报告格式是否与所使用的 API 相符:
如果您按照建议触发报告,但问题仍然存在,请检查 Chrome 开发者控制台中的“控制台”和“网络”标签页中是否存在错误。
如果您需要有关这些客户端 API 的进一步问题排查支持,请继续参阅 Attribution Reporting API 调试指南和 Private Aggregation API + Shared Storage。
排查汇总报告问题
汇总报告由客户端衡量 API 生成,并发送到您的报告来源。这些报告应由您的报告端点转换为 AVRO
格式。如果此转化存在问题,或者报告本身不完整,您可能会在汇总服务中看到错误。
您的可汇总报告是否正确转换?
验证您的报告端点 (.well-known/…
) 是否正确将给定的可汇总 JSON 报告转换为 AVRO
。
因此问题而出现的 API 错误如下:
错误 | DECRYPTION_ERROR |
---|---|
示例 |
"result_info": {
"return_code": "REPORTS_WITH_ERRORS_EXCEEDED_THRESHOLD",
"return_message": "Aggregation job failed early because the number of reports excluded from aggregation exceeded threshold.",
"error_summary": {
"error_counts": [
{
"category": "DECRYPTION_ERROR",
"count": 1,
"description": "Unable to decrypt the report. This may be caused by: tampered aggregatable report shared info, corrupt encrypted report, or other such issues."
},
{
"category": "NUM_REPORTS_WITH_ERRORS",
"count": 1,
"description": "Total number of reports that had an error. These reports were not considered in aggregation. See additional error messages for details on specific reasons."
}
],
"error_messages": []
}
}
|
检查 |
这可能是因为解密错误,而解密错误可能是由 AVRO 报告生成不正确(无论是可汇总的 AVRO 报告还是输出网域 AVRO)所致。可汇总的 AVRO 报告是否生成正确?载荷需要进行 base64 解码并转换为字节数组。确保报告采用 avro 格式。此外,请检查输出网域 AVRO 是否正确。存储分区会转换为转义的 Unicode 十六进制格式,然后转换为字节数组。
如果您看到多个错误数,可以在汇总服务 GitHub 页面中详细了解这些错误。
|
错误 | DECRYPTION_KEY_NOT_FOUND |
---|---|
示例 |
"result_info": {
"return_code": "REPORTS_WITH_ERRORS_EXCEEDED_THRESHOLD",
"return_message": "Aggregation job failed early because the number of reports excluded from aggregation exceeded threshold.",
"error_summary": {
"error_counts": [{
"category": "DECRYPTION_KEY_NOT_FOUND",
"count": 1,
"description": "Could not find decryption key on private key endpoint."
}, {
"category": "NUM_REPORTS_WITH_ERRORS",
"count": 1,
"description": "Total number of reports that had an error. These reports were not considered in aggregation. See additional error messages for details on specific reasons."
}],
"error_messages": []
}
}
|
检查 |
Attribution Reporting API
对于 Attribution Reporting API,此错误可能是由触发器注册问题所致。检查他们是否已使用 aggregation_coordinator_origin 字段向正确的云平台注册了触发器(点击此处查看相关说明)。您还可以向其 Google Cloud 部署的汇总服务提供 AWS 加密报告,或向其 AWS 部署提供 Google Cloud 加密报告。请他们验证用于加密可汇总报告的公钥端点。对于 Google Cloud,可汇总报告中的 `aggregation_coordinator_origin` 字段应为 https://publickeyservice.msmt.gcp.privacysandboxservices.com。对于 AWS,则为 https://publickeyservice.msmt.aws.privacysandboxservices.com。 Private Aggregation API对于 Private Aggregation API,您必须使用 Private Aggregation API 说明文档中“汇总协调者选项”部分中的示例定义 `aggregationCoordinatorOrigin`。请将 https://publickeyservice.msmt.gcp.privacysandboxservices.com 指定为 例如: sharedStorage.run('someOperation', {'privateAggregationConfig':
{'aggregationCoordinatorOrigin': ' https://publickeyservice.msmt.gcp.privacysandboxservices.com'}});
|
错误 | DECRYPTION_KEY_FETCH_ERROR |
---|---|
示例 |
"result_info": {
"return_code": "REPORTS_WITH_ERRORS_EXCEEDED_THRESHOLD",
"return_message": "Aggregation job failed early because the number of reports excluded from aggregation exceeded threshold.",
"error_summary": {
"error_counts": [
{
"category": "DECRYPTION_KEY_FETCH_ERROR",
"count": 1,
"description": "Fetching the decryption key for report decryption failed. This can happen using an unapproved aggregation service binary, running the aggregation service binary in debug mode, key corruption or service availability issues."
},
{
"category": "NUM_REPORTS_WITH_ERRORS",
"count": 1,
"description": "Total number of reports that had an error. These reports were not considered in aggregation. See additional error messages for details on specific reasons."
}
]
}
}
|
检查 | 如果出现未获批准的二进制文件或调试模式问题,使用正确的二进制文件即可解决问题。请按照此处的说明使用预构建的 AMI,或自行构建 AMI。 |
请完成以下步骤进行验证:
您可以使用
aggregatable_report_converter
工具将从 .well-known 端点收集的可汇总报告转换为 AVRO,并创建输出网域键。(注意:输出网域文件应为 16 字节的大端字节字符串。)按照适用于您的公共云提供商的 Codelab 中的步骤收集调试报告,并使用输出网域键运行汇总服务作业: a. Google Cloud:按照汇总服务 Google Cloud Codelab 中的第 3.1.2 步到第 3.2.3 步操作 b. Amazon Web Services:请按照汇总服务 AWS Codelab 中的第 4.2 步到第 5.3 步操作。
如果此操作返回 SUCCESS
响应,则表示您的转化正在正常运行。
您的可汇总报告是否完好无损?
验证汇总报告、输出网域键和共享信息是否完好无损。如需了解详情,请参阅示例代码,了解如何转换可汇总报告和创建网域文件。
您可能会看到与此问题对应的以下 API 错误:
错误 | INPUT_DATA_READ_FAILED |
---|---|
端点 | createJob |
检查 |
createJob 请求中的 input_data_bucket_name 、input_data_blob_prefix 、output_data_bucket_name 和 output_data_blob_prefix 字段是否正确?输入报告数据位置是否包含要处理的报告?您是否有权从报告和输出网域的存储位置读取数据?
|
请完成以下步骤进行验证:
验证汇总报告:
- 生成汇总报告,并使用
aggregatable_report_converter
工具将输出网域转换为AVRO
格式。 - 使用此可汇总的报告和输出网域文件运行
createJob
请求。 - 如果此方法返回
SUCCESS
,则表示可汇总的报告完好无损。如果系统返回错误,则表示您的可汇总报告或报告和网域都存在问题。 - 继续执行下一步,检查网域文件。
- 生成汇总报告,并使用
验证输出网域文件:
- 生成输出网域文件,然后使用
aggregatable_report_converter
工具创建可汇总报告。 - 使用此可汇总的报告和输出网域文件运行
createJob
请求。 - 如果此方法返回
SUCCESS
,则表示输出网域完好无损,并且用于创建可汇总报告的代码存在问题。 - 继续执行下一步,检查
shared_info
。
- 生成输出网域文件,然后使用
验证分享的信息:
- 确保您已启用调试报告。启用了调试功能的报告将包含
debug_cleartext_payload
字段。 - 创建要与本地测试工具搭配使用的调试报告,并使用
debug_cleartext_payload
作为载荷。 - 使用您的网域文件运行本地测试工具。如果这是
SUCCESS
,则表示您的shared_info
文件已被篡改。
- 确保您已启用调试报告。启用了调试功能的报告将包含
如果您怀疑还有其他错误或篡改行为,请收集 JSON 汇总报告、网域键、生成的汇总 AVRO
报告和输出网域,然后继续执行后续步骤。
检查新的部署版本
请验证您的汇总服务版本是否仍受支持。确定您使用的是哪个版本后,请查看汇总服务版本列表,并确认您的版本没有显示支持终止警告:This release has reached its end of support on { date }
。以下说明适用于确定您部署了哪个版本的受支持公共云。
Google Cloud 的步骤
- 依次前往 Compute Engine > 虚拟机实例。
- 点击名称中包含
-worker-
的虚拟机实例。 - 找到
Custom Metadata
部分,然后找到键tee-image-reference
。- 注意:通过 Terraform 在 Google Cloud 中预配的每个虚拟机都应具有此元数据(worker 模块中的
tee-image-reference
元数据)。
- 注意:通过 Terraform 在 Google Cloud 中预配的每个虚拟机都应具有此元数据(worker 模块中的
tee-image-reference
的值将包含版本号。例如,以下路径的版本号为v2.9.1
。这些是位于 Google Cloud 项目的 Artifact Registry 中的预构建映像。- 注意:如果您使用的是预构建的素材资源,则此字段很重要;如果您没有使用预构建的素材资源,则此字段应与您为图片命名和添加的标记一致。(例如:
us.docker.pkg.dev/<gcp_project_name>/artifacts:aggregation-service- container-artifacts-worker_mp_go_prod:2.9.1
)
- 注意:如果您使用的是预构建的素材资源,则此字段很重要;如果您没有使用预构建的素材资源,则此字段应与您为图片命名和添加的标记一致。(例如:
Amazon Web Services 的步骤
- 在 Amazon Web Services 控制台中,前往 EC2 实例。
- 点击名称为
aggregation-service-operator-dev-env
的实例。 - 在实例页面上,依次选择“详细信息”> AMI (Amazon 机器映像)
- 图片路径中应包含您的版本名称。例如,以下路径的版本号为
v2.9.1
。- 注意:如果您使用的是预构建的素材资源,则此字段很重要;如果您没有使用预构建的素材资源,则此字段应与您为图片命名和添加的标记一致。(例如:
aggregation-service-enclave_2.9.1--2024-10-03T01-24-25Z
)
- 注意:如果您使用的是预构建的素材资源,则此字段很重要;如果您没有使用预构建的素材资源,则此字段应与您为图片命名和添加的标记一致。(例如: