{"record":{"id":"87aa2dcfa7e941d9","repo":"apache/beam","slug":"datastorev1-location-must-be-set","errorCode":null,"errorMessage":"DataStoreV1 location must be set. ","messagePattern":"DataStoreV1 location must be set\\. ","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":172,"sourceCode":"    public String getKind() {\n      return kind;\n    }\n\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":154,"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#L154-L183","documentation":"DataStoreV1SchemaIOProvider.validateLocation requires a location string for the DataStoreV1 SchemaIO. If the location is null (missing) it throws InvalidLocationException \"DataStoreV1 location must be set. \". The location identifies the target as 'projectId/kind'.","triggerScenarios":"Creating the DataStoreV1 SchemaIO (e.g. beam:io:datastorev1:... location) without any location string, such as WriteTo/DataStoreV1 with an empty or null location parameter.","commonSituations":"Templated pipelines where the location parameter was not filled in; programmatic DataStoreV1SchemaIOProvider.fromValue(null); scripts dropping the location argument.","solutions":["Supply a location in the form 'projectId/kind', e.g. my-project/my-kind.","Check the pipeline parameter/variable feeding the location is actually populated.","When using SchemaIO programmatically, pass the location string in the constructor/spec."],"exampleFix":"// before\n--location= \n// after\n--location=my-gcp-project/MyEntityKind","handlingStrategy":"validation","validationCode":"if (location == null || location.isEmpty()) {\n  throw new IllegalArgumentException(\"DataStoreV1 SchemaIO requires a location of form 'projectId/kind'.\");\n}","typeGuard":"static boolean hasLocation(java.util.Map<String,Object> config) {\n  Object loc = config.get(\"location\");\n  return loc instanceof String && !((String) loc).isEmpty();\n}","tryCatchPattern":"try {\n  SchemaIO io = new DataStoreV1SchemaIOProvider().fromValue(location);\n} catch (InvalidLocationException e) {\n  // location missing: abort pipeline startup with a clear user-facing message\n}","preventionTips":["Always set the location parameter before launching templated pipelines.","Add pipeline-parameter requiredness checks in launch scripts.","Fail fast at job-construction time, not inside the runner."],"tags":["datastore","configuration","missing-value","location"],"backgroundTag":"missing-required-argument","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"}