尝试更新时,来自Google Pub/Sub的内部错误。

huangapple go评论116阅读模式
英文:

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.19cloud.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.

huangapple
  • 本文由 发表于 2023年3月10日 21:19:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/75696650.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定