英文:
Internal error from Google Pub/Sub when trying to update
问题
当尝试更新Pub/Sub订阅的重试策略时,我一直收到以下错误:
rpc error: code = Internal desc = A service error has occurred. Please retry your request. If the error persists, please report it. [code=e8c0]
给定订阅已经存在且没有任何重试策略,并且使用go 1.19
和cloud.google.com/go/pubsub v1.28.0
,以下是重现该错误的代码:
sub, err := client.GetSubscription(
context.Background(),
&pubsubpb.GetSubscriptionRequest{
Subscription: subscriptionName,
})
// 省略了错误检查
sub.RetryPolicy = &pubsubpb.RetryPolicy{
MinimumBackoff: durationpb.New(c.config.MinimumBackoff),
MaximumBackoff: durationpb.New(c.config.MaximumBackoff),
}
req := pubsubpb.UpdateSubscriptionRequest{
Subscription: sub,
UpdateMask: &fieldmaskpb.FieldMask{
Paths: []string{"retry_policy.minimum_backoff", "retry_policy.maximum_backoff"},
},
}
_, err := client.UpdateSubscription(context.Background(), &req)
// err is "A service error has occurred. Please retry your request. If the error persists, please report it. [code=e8c0]"
否则,该订阅是完全可用的,所以看起来订阅本身没有任何问题。我是否有任何错误的操作?
英文:
I keep getting the following error when trying to update a Pub/Sub subscription's retry policy:
rpc error: code = Internal desc = A service error has occurred. Please retry your request. If the error persists, please report it. [code=e8c0]
Given the subscription already exists, without any retry policy, and using go 1.19
and cloud.google.com/go/pubsub v1.28.0
, this is the code that reproduces it:
sub, err := client.GetSubscription(
context.Background(),
&pubsubpb.GetSubscriptionRequest{
Subscription: subscriptionName,
})
// error check omitted for clarity
sub.RetryPolicy = &pubsubpb.RetryPolicy{
MinimumBackoff: durationpb.New(c.config.MinimumBackoff),
MaximumBackoff: durationpb.New(c.config.MaximumBackoff),
}
req := pubsubpb.UpdateSubscriptionRequest{
Subscription: sub,
UpdateMask: &fieldmaskpb.FieldMask{
Paths: []string{"retry_policy.minimum_backoff", "retry_policy.maximum_backoff"},
},
}
_, err := client.UpdateSubscription(context.Background(), &req)
// err is "A service error has occurred. Please retry your request. If the error persists, please report it. [code=e8c0]"
Otherwise, the subscription is completely usable, so it doesn't look like there is any problem with the subscription itself. Am I doing anything the wrong way?
答案1
得分: 1
对于内部错误,最好打开一个支持案例,以便进行调查。这需要查看与您的订阅相关的后端信息。
英文:
For internal errors, it is best to open a support case so that it can be investigated. It requires looking into backend information about your subscription.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论