apache/beam · warning

Saw subscription in v1beta1 format. Subscriptions should be…

Error message

Saw subscription in v1beta1 format. Subscriptions should be in the format projects/<project_id>/subscriptions/<subscription_name>

What it means

PubsubIO.fromPath detected a subscription path in the legacy Cloud Pub/Sub v1beta1 format. The library still accepts and parses it, but logs a warning because the supported format is projects/<project_id>/subscriptions/<subscription_name>. Behavior is unchanged today, but v1beta1 support may be removed.

Solutions

  1. Rewrite the path to the v1 format: projects/<project_id>/subscriptions/<subscription_name>.
  2. Search pipeline configs and job flags for '/subscriptions/' prefixed paths and update them.
  3. Use PubsubIO.read...().from(Subscription) with an explicit subscription path built from project and subscription name components.
  4. Treat the warning as a deprecation signal and fix before a future Beam release removes v1beta1 handling.

Example fix

// before
PubsubIO.readStrings().fromPath("/subscriptions/my-project/my-subscription");
// after
PubsubIO.readStrings().fromPath("projects/my-project/subscriptions/my-subscription");
Defensive patterns

Strategy: validation

Validate before calling

static boolean isLegacyV1Beta1Subscription(String p) {
  return p != null && p.startsWith("/subscriptions/");
}

Type guard

String requireV1SubscriptionPath(String p) {
  if (p == null || !p.matches("projects/[^/]+/subscriptions/[^/]+"))
    throw new IllegalArgumentException("subscription must be projects/<project_id>/subscriptions/<name>: " + p);
  return p;
}

Prevention

When it happens

Trigger: Calling PubsubIO.readStrings().fromPath (or other read variants) with a subscription path matching V1BETA1_SUBSCRIPTION_REGEXP, e.g. '/subscriptions/<project>/<subscription>' — the legacy API format.

Common situations: Pipelines written years ago against the v1beta1 Pub/Sub API that still pass legacy subscription paths; configs copied from old blog posts or internal docs; migration of jobs from deprecated clients without updating resource paths.

Understand the failure class

Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/5f53a3e11e2facb7. Report an issue: GitHub.

Appendix: source

Thrown at sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubIO.java:320

     *   <li>Can only contain lowercase letters, numbers, dashes ('-'), underscores ('_') and
     *       periods ('.').
     *   <li>Must be between 3 and 255 characters.
     *   <li>Must begin with a letter.
     *   <li>Must end with a letter or a number.
     *   <li>Cannot begin with {@code 'goog'} prefix.
     * </ul>
     */
    public static PubsubSubscription fromPath(String path) {
      if (path.startsWith(SUBSCRIPTION_RANDOM_TEST_PREFIX)
          || path.startsWith(SUBSCRIPTION_STARTING_SIGNAL)) {
        return new PubsubSubscription(PubsubSubscription.Type.FAKE, "", path);
      }

      String projectName, subscriptionName;

      Matcher v1beta1Match = V1BETA1_SUBSCRIPTION_REGEXP.matcher(path);
      if (v1beta1Match.matches()) {
        LOG.warn(
            "Saw subscription in v1beta1 format. Subscriptions should be in the format "
                + "projects/<project_id>/subscriptions/<subscription_name>");
        projectName = v1beta1Match.group(1);
        subscriptionName = v1beta1Match.group(2);
      } else {
        Matcher match = SUBSCRIPTION_REGEXP.matcher(path);
        if (!match.matches()) {
          throw new IllegalArgumentException(
              "Pubsub subscription is not in "
                  + "projects/<project_id>/subscriptions/<subscription_name> format: "
                  + path);
        }
        projectName = match.group(1);
        subscriptionName = match.group(2);
      }

      projectName =
          checkArgumentNotNull(

View on GitHub (pinned to 12126d8942)