{"record":{"id":"e9886df51df33718","repo":"apache/beam","slug":"saw-topic-in-v1beta1-format-topics-should-be-in-the-format","errorCode":null,"errorMessage":"Saw topic in v1beta1 format.  Topics should be in the format projects/<project_id>/topics/<topic_name>","messagePattern":"Saw topic in v1beta1 format\\.  Topics should be in the format projects/<project_id>/topics/<topic_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":475,"sourceCode":"     * <ul>\n     *   <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 'goog' prefix.\n     * </ul>\n     */\n    public static PubsubTopic fromPath(String path) {\n      if (path.equals(TOPIC_DEV_NULL_TEST_NAME)) {\n        return new PubsubTopic(PubsubTopic.Type.FAKE, \"\", path);\n      }\n\n      String projectName, topicName;\n\n      Matcher v1beta1Match = V1BETA1_TOPIC_REGEXP.matcher(path);\n      if (v1beta1Match.matches()) {\n        LOG.warn(\n            \"Saw topic in v1beta1 format.  Topics should be in the format \"\n                + \"projects/<project_id>/topics/<topic_name>\");\n        projectName = v1beta1Match.group(1);\n        topicName = v1beta1Match.group(2);\n      } else {\n        Matcher match = TOPIC_REGEXP.matcher(path);\n        if (!match.matches()) {\n          throw new IllegalArgumentException(\n              \"Pubsub topic is not in projects/<project_id>/topics/<topic_name> format: \" + path);\n        }\n        projectName = match.group(1);\n        topicName = match.group(2);\n      }\n\n      projectName =\n          checkArgumentNotNull(\n              projectName, \"Invalid path: project name must be non-null: %s\", path);\n      topicName =","sourceCodeStart":457,"sourceCodeEnd":493,"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#L457-L493","documentation":"PubsubIO.fromPath detects that the given topic path matches the legacy Cloud Pub/Sub v1beta1 naming scheme instead of the canonical projects/<project_id>/topics/<topic_name> format. The library still parses the legacy form for backwards compatibility but logs this warning because the v1beta1 format is deprecated and may stop working. No exception is thrown; the pipeline continues with the parsed project and topic names.","triggerScenarios":"Calling PubsubIO.readStrings().from(topic) / PubsubIO.fromPath with a topic string matching V1BETA1_TOPIC_REGEXP (e.g. '/topics/my-project/my-topic' or 'my-project/my-topic') rather than the fully qualified v1 format 'projects/my-project/topics/my-topic'.","commonSituations":"Migrating old pipelines written against the deprecated Pub/Sub beta API; hardcoding topic paths copied from legacy configs or tutorials; building topic paths from (project, topic) pairs without the projects/.../topics/ template.","solutions":["Rewrite the topic path to the canonical format: projects/<project_id>/topics/<topic_name>.","If constructing the path programmatically, use PubsubIO.topicFromPath or a helper like PubsubClient.topicPathFromName(project, topic).","Update legacy configuration files or job parameters that still contain '/topics/<project>/<topic>' style paths."],"exampleFix":"// before\nPubsubIO.readStrings().from(\"/topics/my-gcp-project/my-topic\")\n\n// after\nPubsubIO.readStrings().from(\"projects/my-gcp-project/topics/my-topic\")","handlingStrategy":"validation","validationCode":"Pattern TOPIC = Pattern.compile(\"^projects/([^/]+)/topics/([^/]+)$\");\nif (!TOPIC.matcher(topicPath).matches()) {\n  throw new IllegalArgumentException(\n      \"Topic must be in format projects/<project_id>/topics/<topic_name>: \" + topicPath);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always build topic paths from (project, topic) with the projects/.../topics/ template or PubsubClient.topicPathFromName.","Add a startup check that validates all Pub/Sub paths against the v1 regex before launching the pipeline.","Search configs for '/topics/' prefixes left over from v1beta1 usage."],"tags":["java","pubsub","deprecated","naming"],"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"}