{"record":{"id":"5f53a3e11e2facb7","repo":"apache/beam","slug":"saw-subscription-in-v1beta1-format-subscriptions-should-be","errorCode":null,"errorMessage":"Saw subscription in v1beta1 format. Subscriptions should be in the format projects/<project_id>/subscriptions/<subscription_name>","messagePattern":"Saw subscription in v1beta1 format\\. Subscriptions should be in the format projects/<project_id>/subscriptions/<subscription_name>","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubIO.java","lineNumber":320,"sourceCode":"     *   <li>Can only contain lowercase letters, numbers, dashes ('-'), underscores ('_') and\n     *       periods ('.').\n     *   <li>Must be between 3 and 255 characters.\n     *   <li>Must begin with a letter.\n     *   <li>Must end with a letter or a number.\n     *   <li>Cannot begin with {@code 'goog'} prefix.\n     * </ul>\n     */\n    public static PubsubSubscription fromPath(String path) {\n      if (path.startsWith(SUBSCRIPTION_RANDOM_TEST_PREFIX)\n          || path.startsWith(SUBSCRIPTION_STARTING_SIGNAL)) {\n        return new PubsubSubscription(PubsubSubscription.Type.FAKE, \"\", path);\n      }\n\n      String projectName, subscriptionName;\n\n      Matcher v1beta1Match = V1BETA1_SUBSCRIPTION_REGEXP.matcher(path);\n      if (v1beta1Match.matches()) {\n        LOG.warn(\n            \"Saw subscription in v1beta1 format. Subscriptions should be in the format \"\n                + \"projects/<project_id>/subscriptions/<subscription_name>\");\n        projectName = v1beta1Match.group(1);\n        subscriptionName = v1beta1Match.group(2);\n      } else {\n        Matcher match = SUBSCRIPTION_REGEXP.matcher(path);\n        if (!match.matches()) {\n          throw new IllegalArgumentException(\n              \"Pubsub subscription is not in \"\n                  + \"projects/<project_id>/subscriptions/<subscription_name> format: \"\n                  + path);\n        }\n        projectName = match.group(1);\n        subscriptionName = match.group(2);\n      }\n\n      projectName =\n          checkArgumentNotNull(","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubIO.java#L302-L338","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Rewrite the path to the v1 format: projects/<project_id>/subscriptions/<subscription_name>.","Search pipeline configs and job flags for '/subscriptions/' prefixed paths and update them.","Use PubsubIO.read...().from(Subscription) with an explicit subscription path built from project and subscription name components.","Treat the warning as a deprecation signal and fix before a future Beam release removes v1beta1 handling."],"exampleFix":"// before\nPubsubIO.readStrings().fromPath(\"/subscriptions/my-project/my-subscription\");\n// after\nPubsubIO.readStrings().fromPath(\"projects/my-project/subscriptions/my-subscription\");","handlingStrategy":"validation","validationCode":"static boolean isLegacyV1Beta1Subscription(String p) {\n  return p != null && p.startsWith(\"/subscriptions/\");\n}","typeGuard":"String requireV1SubscriptionPath(String p) {\n  if (p == null || !p.matches(\"projects/[^/]+/subscriptions/[^/]+\"))\n    throw new IllegalArgumentException(\"subscription must be projects/<project_id>/subscriptions/<name>: \" + p);\n  return p;\n}","tryCatchPattern":null,"preventionTips":["Migrate all subscription paths to the projects/<id>/subscriptions/<name> format.","Audit job configs and flags for legacy '/subscriptions/' prefixed paths.","Add a startup config check that rejects v1beta1-style paths.","Build paths with typed Subscription helpers rather than raw strings."],"tags":["java","pubsub","deprecated","url-format","migration"],"backgroundTag":"deprecated-api-usage","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}