googleapis / python-pubsublite

Apache License 2.0
19 stars 12 forks source link

resource creation too soon error #472

Closed sl2902 closed 7 months ago

sl2902 commented 7 months ago

I am experimenting with the pubsublite api, and I had to delete the subscription resource for some reason. However, when I tried to recreate it, I encountered this error

google.api_core.exceptions.FailedPrecondition: 400 Resource projects/107422863028/locations/us-central1/subscriptions/bookings of type SUBSCRIPTION was deleted at 2024-01-16T11:05:56.130483-08:00 which is less than 1h ago, it cannot yet be recreated. [reason: "RESOURCE_RECREATION_TOO_SOON"
domain: "pubsublite.googleapis.com"
metadata {
  key: "resource_type"
  value: "SUBSCRIPTION"
}
metadata {
  key: "resource_identifier"
  value: "projects/107422863028/locations/us-central1/subscriptions/bookings"
}
metadata {
  key: "min_allowed_delay"
  value: "1h"
}
metadata {
  key: "deletion_time"
  value: "2024-01-16T11:05:56.130483-08:00"
}
]

Is there a way to turn it off or alter the time limit?

michaelpri10 commented 7 months ago

Hello! Unfortunately, this recreation delay is set by the Pub/Sub Lite service and cannot be modified using the API. This delay applies specifically to resources with the same name, so any new resource created within an hour of the deletion of another resource must have a different name.

sl2902 commented 7 months ago

oh ok. Thanks!