{"record":{"id":"0a6d861e6bebf2b7","repo":"apache/beam","slug":"export-cannot-be-executed-because-export-uri-s-is-not-from","errorCode":null,"errorMessage":"Export cannot be executed because export URI (%s) is not from GCS or BigQuery.","messagePattern":"Export cannot be executed because export URI \\((.+?)\\) is not from GCS or BigQuery\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/FhirIO.java","lineNumber":1721,"sourceCode":"      }\n\n      @Setup\n      public void initClient() throws IOException {\n        this.client = new HttpHealthcareApiClient();\n      }\n\n      @ProcessElement\n      public void exportResources(ProcessContext context) throws IOException, InterruptedException {\n        final String fhirStore = context.element();\n        final String exportUri = this.exportUri.get();\n\n        Operation operation;\n        if (exportUri.startsWith(GCS_PREFIX)) {\n          operation = client.exportFhirResourceToGcs(fhirStore, exportUri);\n        } else if (exportUri.startsWith(BQ_PREFIX)) {\n          operation = client.exportFhirResourceToBigQuery(fhirStore, exportUri);\n        } else {\n          throw new RuntimeException(\n              String.format(\n                  \"Export cannot be executed because export URI (%s) is not from GCS or BigQuery.\",\n                  exportUri));\n        }\n\n        operation = client.pollOperation(operation, 15000L);\n        incrementLroCounters(\n            operation,\n            EXPORT_OPERATION_SUCCESS,\n            EXPORT_OPERATION_ERRORS,\n            RESOURCES_EXPORTED_SUCCESS,\n            RESOURCES_EXPORTED_ERRORS);\n        if (operation.getError() != null) {\n          throw new RuntimeException(\n              String.format(\n                  \"Export operation (%s) failed. Reason: %s\",\n                  operation.getName(), operation.getError().getMessage()));\n        }","sourceCodeStart":1703,"sourceCodeEnd":1739,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/FhirIO.java#L1703-L1739","documentation":"FhirIO's export step only supports exporting a FHIR store to Google Cloud Storage (gs://) or BigQuery (bq://) destinations, as defined by the GCS_PREFIX and BQ_PREFIX checks. When the configured export URI has any other scheme, no corresponding Healthcare API client method exists, so a RuntimeException is thrown with the offending URI. This is a configuration-time guard against unsupported destinations.","triggerScenarios":"Calling FhirIO.export with an exportUri that does not start with \"gs://\" or \"bq://\" — e.g. an https:// URL, a local file path like /tmp/export, or a misspelled scheme such as gcs://.","commonSituations":"Using a path copied from another tool (HDFS, local disk); forgetting the scheme entirely; assuming BigQuery URIs take dataset/table form that doesn't match the expected bq:// prefix; typo gcs:// instead of gs://.","solutions":["Set the export URI to a GCS location, e.g. gs://my-bucket/fhir-export/","For BigQuery, use a bq:// URI in the form bq://my-project.my_dataset.my_table","Check for typos in the scheme (gs:// not gcs://) and that no whitespace or quotes corrupt the prefix","If a non-GCS/BQ sink is truly needed, export to GCS first and add a downstream transform to move the data"],"exampleFix":"// before\nFhirIO.export(\"https://storage.example.com/export\") // throws\n// after\nFhirIO.export(\"gs://my-bucket/fhir-export\")","handlingStrategy":"validation","validationCode":"if (!exportUri.startsWith(\"gs://\") && !exportUri.startsWith(\"bq://\")) {\n  throw new IllegalArgumentException(\"exportUri must be a gs:// or bq:// URI: \" + exportUri);\n}","typeGuard":null,"tryCatchPattern":"try {\n  // run export\n} catch (RuntimeException e) {\n  if (e.getMessage().contains(\"not from GCS or BigQuery\")) {\n    LOG.error(\"Fix exportUri scheme: {}\", exportUri);\n  } else throw e;\n}","preventionTips":["Store export destinations as gs:// or bq:// URIs in config validated at startup","Watch for typo'd schemes (gcs://) and missing prefixes","Add a config-lint unit test for destination URIs"],"tags":["java","fhir","export","gcs","bigquery","unsupported-uri"],"backgroundTag":"invalid-argument-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}