{"record":{"id":"80d11bd03e4994be","repo":"paascloud/paascloud-master","slug":"gl99990002-80d11b","errorCode":"GL99990002","errorMessage":"GL99990002","messagePattern":"GL99990002","errorType":"error_code","errorClass":"MdcBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/MdcAddressServiceImpl.java","lineNumber":33,"sourceCode":"/**\n * The class Mdc address service.\n *\n * @author paascloud.net @gmail.com\n */\n@Service\n@Transactional(rollbackFor = Exception.class)\npublic class MdcAddressServiceImpl implements MdcAddressService {\n\t@Resource\n\tprivate MdcAddressQueryFeignApi mdcAddressQueryFeignApi;\n\n\t@Override\n\t@Transactional(readOnly = true, rollbackFor = Exception.class)\n\tpublic AddressDTO getAddressById(Long addressId) {\n\t\tPreconditions.checkArgument(addressId != null, \"地址ID不能为空\");\n\t\tWrapper<AddressDTO> wrapper = mdcAddressQueryFeignApi.getById(addressId);\n\n\t\tif (wrapper == null) {\n\t\t\tthrow new MdcBizException(ErrorCodeEnum.GL99990002);\n\t\t}\n\t\tif (wrapper.error()) {\n\t\t\tthrow new MdcBizException(ErrorCodeEnum.MDC10021002);\n\t\t}\n\t\treturn wrapper.getResult();\n\t}\n}\n","sourceCodeStart":15,"sourceCodeEnd":41,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/MdcAddressServiceImpl.java#L15-L41","documentation":"MdcAddressServiceImpl.getAddressById throws MdcBizException(GL99990002) when the Wrapper returned by mdcAddressQueryFeignApi.getById(addressId) is null — i.e. the Feign call to the mdc (mall directory center) address service returned no wrapper object at all. GL99990002 is the generic 'MDC service call returned null/failed' code; a non-null but error() wrapper raises MDC10021002 instead.","triggerScenarios":"Calling getAddressById when the downstream mdc service responds with an empty body (Feign decode produces null Wrapper), e.g. the remote endpoint returned nothing for that addressId or the response could not be deserialized.","commonSituations":"mdc service down or returning empty 200 bodies; Feign decoder configuration mismatch (empty body -> null); nonexistent addressId hitting an endpoint that returns no wrapper; network/proxy issues yielding empty responses.","solutions":["Check mdc service health/logs for the getById request corresponding to this addressId","Verify the addressId actually exists in the mdc address table","Ensure the Feign client's decoder is configured to wrap empty bodies (or return a fallback Wrapper) instead of null","Confirm mdc service registration/discovery (Eureka) so the Feign call reaches a live instance"],"exampleFix":"// before\nWrapper<AddressDTO> wrapper = mdcAddressQueryFeignApi.getById(addressId);\n// after (server-side)\nreturn Wrapper.ok(addressMapper.selectByPrimaryKey(addressId)); // never return a bare/empty body\n// caller-side\nif (wrapper == null) { throw new MdcBizException(ErrorCodeEnum.GL99990002); }","handlingStrategy":"fallback","validationCode":"boolean exists = addressMapper.selectCount(new QueryWrapper().eq(\"id\", addressId)) > 0; // verify locally before RPC","typeGuard":"if (wrapper == null || wrapper.getResult() == null) { return Optional.empty(); }\nreturn Optional.of(wrapper.getResult());","tryCatchPattern":"try { return addressService.getAddressById(id); } catch (MdcBizException e) { if (ErrorCodeEnum.GL99990002.getCode().equals(e.getCode())) { log.error(\"mdc returned null wrapper for addressId={}\", id, e); return defaultAddress(); } throw e; }","preventionTips":["Make downstream mdc endpoints always return a Wrapper (Wrapper.fail for not-found), never an empty body","Configure Feign fallbacks so transient mdc outages return a degraded result","Validate addressId existence before RPC when the caller already owns the data","Monitor mdc service health and alert on rising null-wrapper rates"],"tags":["feign","rpc","empty-response","microservices"],"backgroundTag":"empty-response-body","analyzedSha":"781281a9503332ed3cef44ea618349d14230a127","analyzedAt":"2026-09-10T10:59:02.070Z","contentChangedAt":"2026-09-10T10:59:02.070Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}