{"record":{"id":"50f120cd5782d92a","repo":"apache/druid","slug":"couldn-t-deserialize-authorizer-groupmappingmap","errorCode":null,"errorMessage":"Couldn't deserialize authorizer groupMappingMap!","messagePattern":"Couldn't deserialize authorizer groupMappingMap!","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/BasicAuthUtils.java","lineNumber":195,"sourceCode":"    catch (IOException ioe) {\n      throw new ISE(ioe, \"Couldn't serialize authorizer userMap!\");\n    }\n  }\n\n  public static Map<String, BasicAuthorizerGroupMapping> deserializeAuthorizerGroupMappingMap(\n      ObjectMapper objectMapper,\n      byte[] groupMappingMapBytes\n  )\n  {\n    Map<String, BasicAuthorizerGroupMapping> groupMappingMap;\n    if (groupMappingMapBytes == null) {\n      groupMappingMap = new HashMap<>();\n    } else {\n      try {\n        groupMappingMap = objectMapper.readValue(groupMappingMapBytes, BasicAuthUtils.AUTHORIZER_GROUP_MAPPING_MAP_TYPE_REFERENCE);\n      }\n      catch (IOException ioe) {\n        throw new RuntimeException(\"Couldn't deserialize authorizer groupMappingMap!\", ioe);\n      }\n    }\n    return groupMappingMap;\n  }\n\n  public static byte[] serializeAuthorizerGroupMappingMap(ObjectMapper objectMapper, Map<String, BasicAuthorizerGroupMapping> groupMappingMap)\n  {\n    try {\n      return objectMapper.writeValueAsBytes(groupMappingMap);\n    }\n    catch (IOException ioe) {\n      throw new ISE(ioe, \"Couldn't serialize authorizer groupMappingMap!\");\n    }\n  }\n\n  public static Map<String, BasicAuthorizerRole> deserializeAuthorizerRoleMap(\n      ObjectMapper objectMapper,\n      byte[] roleMapBytes","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/druid-basic-security/src/main/java/org/apache/druid/security/basic/BasicAuthUtils.java#L177-L213","documentation":"BasicAuthUtils.deserializeAuthorizerGroupMappingMap parses stored bytes into the authorizer group-mapping map; Jackson IOException is wrapped as RuntimeException('Couldn't deserialize authorizer groupMappingMap!'). The persisted group-mapping blob is corrupt or from an incompatible schema version.","triggerScenarios":"Loading group mappings from metadata storage when the byte[] fails to parse as Map<String, BasicAuthorizerGroupMapping>.","commonSituations":"Manually edited metadata rows, failed writes, or upgrade/downgrade version skew changing BasicAuthorizerGroupMapping's serialized shape.","solutions":["Re-create group mappings via the authorizer REST API so valid JSON is persisted","Restore the metadata record from a clean backup","Verify consistent basic-security versions across all nodes"],"exampleFix":"// before\n// corrupt groupMappingMap row in metadata store\n// after\ncurl -X POST http://coordinator:8084/druid-ext/basic-security/authorization/db/auth_groups/groupMappings/ldap_map -H'Content-Type: application/json' -d '{...}'","handlingStrategy":"try-catch","validationCode":"if (bytes != null && bytes.length > 0) {\n  mapper.readTree(bytes); // validate JSON before deserialize\n}","typeGuard":null,"tryCatchPattern":"try {\n  Map<String, BasicAuthorizerGroupMapping> gm =\n    BasicAuthUtils.deserializeAuthorizerGroupMappingMap(mapper, bytes);\n} catch (RuntimeException e) {\n  if (e.getMessage().contains(\"Couldn't deserialize authorizer groupMappingMap!\")) {\n    gm = new HashMap<>(); // or restore from backup\n  } else throw e;\n}","preventionTips":["Manage group mappings only via the security REST API","Back up metadata storage before upgrades","Verify JSON integrity after any direct DB maintenance","Keep basic-security versions consistent cluster-wide"],"tags":["java","security","jackson","serialization"],"backgroundTag":"json-unmarshal-failed","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}