{"record":{"id":"77065bbf3ae0f685","repo":"apache/beam","slug":"unsupported-secret-manager-s-currently-supported-options-s","errorCode":null,"errorMessage":"Unsupported secret manager: '%s'. Currently supported options: %s.","messagePattern":"Unsupported secret manager: '(.+?)'\\. Currently supported options: (.+?)\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/util/Secret.java","lineNumber":275,"sourceCode":"    }\n\n    Map<String, String> specMap = null;\n    if (spec != null && !spec.isEmpty()) {\n      try {\n        ObjectMapper mapper = new ObjectMapper();\n        mapper.configure(com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);\n        specMap = mapper.readValue(spec, new TypeReference<Map<String, String>>() {});\n      } catch (Exception e) {\n        LOG.debug(\"Failed to parse secret spec as JSON map\", e);\n      }\n    }\n\n    if (smManager != null) {\n      SecretRegistrar.SecretFactory factory = SECRET_FACTORIES.get(smManager.toLowerCase());\n      if (factory != null) {\n        return factory.createSecret(specMap != null ? specMap : Collections.emptyMap());\n      }\n      throw new IllegalArgumentException(\n          String.format(\n              \"Unsupported secret manager: '%s'. Currently supported options: %s.\",\n              smManager, SUPPORTED_TYPES));\n    }\n\n    if (specMap != null) {\n      LOG.warn(\n          \"The 'spec' parameter appears to be a JSON specification, but 'secret_manager' is not set. Defaulting to Raw.\");\n    }\n\n    return new RawSecret(spec != null ? spec : \"\");\n  }\n\n  /**\n   * Return a Secret instance with default raw secret handling.\n   *\n   * @param spec Secret string (raw secret or JSON specification string).\n   * @return An instance of Secret.","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/util/Secret.java#L257-L293","documentation":"fromJson resolves the secret manager from the JSON's secret_manager field by looking it up in SECRET_FACTORIES. If the field is present but no factory is registered for that name, IllegalArgumentException is thrown listing supported options. Unlike parseSecretOption, this is the JSON-parsing path.","triggerScenarios":"Calling Secret.fromJson with a JSON object containing a secret_manager (smManager) value that is not a registered type, e.g. {\"secret_manager\": \"HashiCorpVault\", ...}.","commonSituations":"Hand-written secret specification JSON using a provider name from another platform, misspelled manager names, or Beam versions lacking support for the requested manager.","solutions":["Change the secret_manager field to one of the supported values shown in the error message.","Check spelling/casing — lookup is done on the lowercased manager name against the registry.","Register a custom SecretRegistrar.SecretFactory for your manager before calling fromJson, or upgrade Beam if support was added later."],"exampleFix":"// before\nSecret s = Secret.fromJson(\"{\\\"secret_manager\\\":\\\"vault\\\",\\\"path\\\":\\\"secret/foo\\\"}\");\n// after\nSecret s = Secret.fromJson(\"{\\\"secret_manager\\\":\\\"GcpSecret\\\",\\\"version_name\\\":\\\"my_secret/versions/latest\\\"}\");","handlingStrategy":"validation","validationCode":"String mgr = specJson.get(\"secret_manager\").asText();\nif (!java.util.Set.of(\"gcpsecret\").contains(mgr.toLowerCase())) { throw new IllegalArgumentException(\"unsupported secret_manager: \" + mgr); }","typeGuard":null,"tryCatchPattern":"try { Secret s = Secret.fromJson(json); } catch (IllegalArgumentException e) { LOG.error(\"bad secret spec json: {}\", e.getMessage()); throw e; }","preventionTips":["Use only supported secret_manager names in spec JSON.","Keep secret spec JSON schemas documented and validated with JSON Schema.","Lowercase names as the registry lookup is case-insensitive on the value but the name must be registered."],"tags":["java","beam","secrets","json","unsupported"],"backgroundTag":"unsupported-enum-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"}