{"record":{"id":"4a41b09433adcaa0","repo":"apache/beam","slug":"gcp-authentication-extension-not-configured-properly-s-not","errorCode":null,"errorMessage":"GCP Authentication Extension not configured properly: %s not configured. Configure it by exporting environment variable %s or system property %s","messagePattern":"GCP Authentication Extension not configured properly: (.+?) not configured\\. Configure it by exporting environment variable (.+?) or system property (.+?)","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/opentelemetry-gcp-auth-extension/src/main/java/org/apache/beam/sdk/extensions/opentelemetry/gcp/auth/ConfigurableOption.java","lineNumber":123,"sourceCode":"   */\n  String getUserReadableName() {\n    return this.userReadableName;\n  }\n\n  /**\n   * Retrieves the configured value for this option. This method checks the environment variable\n   * first and then the system property.\n   *\n   * @return The configured value as a string, or throws an exception if not configured.\n   * @throws ConfigurationException if neither the environment variable nor the system property is\n   *     set.\n   */\n  String getConfiguredValue(ConfigProperties configProperties) {\n    String configuredValue = configProperties.getString(this.getSystemProperty());\n    if (configuredValue != null && !configuredValue.isEmpty()) {\n      return configuredValue;\n    } else {\n      throw new ConfigurationException(\n          String.format(\n              \"GCP Authentication Extension not configured properly: %s not configured. Configure it by exporting environment variable %s or system property %s\",\n              this.userReadableName, this.getEnvironmentVariable(), this.getSystemProperty()));\n    }\n  }\n\n  /**\n   * Retrieves the value for this option, prioritizing environment variables and system properties.\n   * If neither an environment variable nor a system property is set for this option, the provided\n   * fallback function is used to determine the value.\n   *\n   * @param fallback A {@link Supplier} that provides the default value for the option when it is\n   *     not explicitly configured via an environment variable or system property.\n   * @return The configured value for the option, obtained from the environment variable, system\n   *     property, or the fallback function, in that order of precedence.\n   */\n  String getConfiguredValueWithFallback(\n      ConfigProperties configProperties, Supplier<String> fallback) {","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/opentelemetry-gcp-auth-extension/src/main/java/org/apache/beam/sdk/extensions/opentelemetry/gcp/auth/ConfigurableOption.java#L105-L141","documentation":"ConfigurableOption.getConfiguredValue() in the OpenTelemetry GCP auth extension requires the option's system property to be set (via config properties). If the property lookup returns null or an empty string, it throws ConfigurationException telling the user to export the corresponding environment variable or set the system property. The extension cannot authenticate to GCP without this value.","triggerScenarios":"Running a Beam pipeline with the GCP auth extension where neither the environment variable nor the system property for a required option (e.g. project ID, quota project) is set; the property is present but is an empty string.","commonSituations":"Deploying to a container/CI environment where the developer's local GCP env vars aren't exported, forgetting to set GOOGLE_CLOUD_PROJECT or the quota-project property, or an empty export like GOOGLE_APPLICATION_CREDENTIALS=\"\".","solutions":["Export the named environment variable before launching the pipeline (e.g. export GOOGLE_CLOUD_PROJECT=my-project).","Alternatively pass the system property with -D<property>=<value> in the JVM args.","Check for empty-string values: unset and re-export the variable with a real value.","Verify the variable is visible to the actual process (container env, k8s pod spec, CI job env)."],"exampleFix":"// before (no env set)\njava -jar pipeline.jar\n// after\nexport GOOGLE_CLOUD_PROJECT=my-project\njava -Dgoogle.cloud.project=my-project -jar pipeline.jar","handlingStrategy":"try-catch","validationCode":"String required = System.getenv(\"GOOGLE_CLOUD_PROJECT\");\nif (required == null || required.isEmpty()) {\n  throw new IllegalStateException(\"GOOGLE_CLOUD_PROJECT must be set before running the pipeline\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  String value = option.getConfiguredValue(configProperties);\n} catch (org.apache.beam.sdk.extensions.opentelemetry.gcp.auth.ConfigurationException e) {\n  logger.error(\"Missing GCP auth config: {}\", e.getMessage());\n  throw new IllegalStateException(\"Set the required env var or system property and retry\", e);\n}","preventionTips":["Set required GCP env vars in the deployment manifest (Dockerfile, k8s pod spec, CI env), not just your shell.","Prefer explicit -D system properties when launching pipeline JVMs.","Fail fast with an env check at application startup.","Watch for empty-string exports which trigger the same error."],"tags":["java","apache-beam","gcp","authentication","configuration"],"backgroundTag":"missing-env-var","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"}