在尝试遵循示例代码以通过设置cryptoHashConfig生成代理哈希时得到以下错误
{ Error: In KmsWrappedCryptoKey
at Http2CallStream.call.on (/home/stoyak/Aritzia/dlp_api/node_modules/@google-cloud/dlp/node_modules/@grpc/grpc-js/build/src/client.js:103:45)
at Http2CallStream.emit (events.js:187:15)
at Http2CallStream.endCall (/home/stoyak/Aritzia/dlp_api/node_modules/@google-cloud/dlp/node_modules/@grpc/grpc-js/build/src/call-stream.js:74:18)
at handlingTrailers (/home/stoyak/Aritzia/dlp_api/node_modules/@google-cloud/dlp/node_modules/@grpc/grpc-js/build/src/call-stream.js:163:18)
at process._tickCallback (internal/process/next_tick.js:68:7)
code: 3,
details: 'In KmsWrappedCryptoKey',
metadata: Metadata { internalRepr: Map {} },
note:
'Exception occurred in retry method that was not classified as transient' }
这是使用的请求
{
"parent":"projects/XXXX",
"item":{
"value":"XXXXXXXX"
},
"deidentifyConfig":{
"infoTypeTransformations":{
"transformations":[
{
"primitiveTransformation":{
"cryptoHashConfig":{
"cryptoKey":{
"kmsWrapped":{
"wrappedKey":"CiQAnHQoiec0s1myvgJiQf+NjFKQ1MxzN2s+v/Jq74ek3tqhnRoSMAAEfzpfTLYI6jaMSRN4J8Q6wOZ0glgNF9UR9N+HxY+dhyTiggHwVQRnbrNnKU9MUw==",
"cryptoKeyName":"projects/XXXX/locations/global/keyRings/XXX/cryptoKeys/XXX"
}
},
"commonAlphabet":"ALPHA_NUMERIC"
}
}
}
]
}
}
}
答案 0 :(得分:1)
代码3是无效的输入异常。我的猜测是,如果您检查http响应,将会得到关于错误之处的更好提示。
您要查找的是如下所示的错误响应
{ “错误”:{ “代码”:400, “ message”:“项目有误……”, “状态”:“ INVALID_ARGUMENT”, } }
要排除客户端库中的错误处理,您是否介意通过Api Explorer尝试相同的调用? https://developers.google.com/apis-explorer/#p/dlp/v2/dlp.projects.content.deidentify