{"record":{"id":"e4f17a9549647ab7","repo":"apache/beam","slug":"datastorev1-location-must-be-in-the-following-format","errorCode":null,"errorMessage":"DataStoreV1 location must be in the following format: 'projectId/kind' but was:{location}","messagePattern":"DataStoreV1 location must be in the following format: 'projectId/kind' but was:(.+?)","errorType":"validation","errorClass":"InvalidLocationException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/datastore/DataStoreV1SchemaIOProvider.java","lineNumber":175,"sourceCode":"\n    private String determineKeyField(String configKey) {\n      if (configKey != null && configKey.isEmpty()) {\n        throw new InvalidConfigurationException(\n            String.format(\"'%s' property cannot be null.\", KEY_FIELD_PROPERTY));\n      } else if (configKey != null) {\n        return configKey;\n      } else {\n        return DEFAULT_KEY_FIELD;\n      }\n    }\n\n    private void validateLocation(String location, Matcher matcher) {\n      // TODO: allow users to specify a namespace in a location string.\n      if (location == null) {\n        throw new InvalidLocationException(\"DataStoreV1 location must be set. \");\n      }\n      if (!matcher.matches()) {\n        throw new InvalidLocationException(\n            \"DataStoreV1 location must be in the following format: 'projectId/kind'\"\n                + \" but was:\"\n                + location);\n      }\n    }\n  }\n}\n","sourceCodeStart":157,"sourceCodeEnd":183,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/datastore/DataStoreV1SchemaIOProvider.java#L157-L183","documentation":"DataStoreV1SchemaIOProvider.validateLocation checks the provided location against a regex Matcher expecting the format 'projectId/kind'. If the location is non-null but doesn't match (wrong number of segments, illegal characters, extra slashes), it throws InvalidLocationException \"DataStoreV1 location must be in the following format: 'projectId/kind' but was:<location>\".","triggerScenarios":"Passing a location like 'my-project' (no kind), 'project/kind/extra', a full URL, or a name with unsupported characters to the DataStoreV1 SchemaIO.","commonSituations":"Users pasting a full Datastore resource path or URL instead of projectId/kind; namespace included in the location (not supported — see TODO in the code); typos such as spaces or Windows path separators.","solutions":["Format the location as exactly 'projectId/kind', e.g. my-project/MyKind.","Remove any namespace, leading scheme, or extra path segments from the location.","If you need a namespace, it is not supported by this location format — set the namespace via a different option or restructure the kind."],"exampleFix":"// before\n--location=https://datastore.googleapis.com/project/my-project/kind/MyKind\n// after\n--location=my-project/MyKind","handlingStrategy":"validation","validationCode":"java.util.regex.Pattern LOCATION = java.util.regex.Pattern.compile(\"^[^/]+/[^/]+$\");\nif (location == null || !LOCATION.matcher(location).matches()) {\n  throw new IllegalArgumentException(\"Location must be 'projectId/kind', got: \" + location);\n}","typeGuard":"static boolean isValidDataStoreV1Location(String location) {\n  return location != null && location.matches(\"^[^/]+/[^/]+$\");\n}","tryCatchPattern":"try {\n  SchemaIO io = new DataStoreV1SchemaIOProvider().fromValue(location);\n} catch (InvalidLocationException e) {\n  // surface e.getMessage() (includes the bad location) and stop job creation\n}","preventionTips":["Always pass exactly two segments: projectId/kind, no namespace, scheme, or extra slashes.","Never paste full Datastore resource URLs as the location.","Validate the location with a regex in your launch tooling before submission."],"tags":["datastore","configuration","location-format","validation"],"backgroundTag":"invalid-url-format","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"}