paascloud/paascloud-master · error · MdcBizException
GL99990002
GL99990002
Error message
GL99990002
What it means
GL99990002 maps to ErrorCodeEnum GL99990002 ("微服务不在线,或者网络超时" — microservice offline or network timeout). getMainImage calls the MDC product service via the mdcProductFeignApi Feign client; if the Feign call returns null (the remote service is down, unregistered, or the call failed and the fallback/hystrix wrapper yielded no Wrapper), the method throws this MdcBizException instead of returning a result. It signals a downstream availability problem, not a bad product ID.
Solutions
- Verify the paascloud-provider-mdc service is running and registered in the service registry (check Eureka/registry console and its health endpoint).
- Check network connectivity and any firewall between the OMC service and the MDC service; confirm the registry address in config is correct.
- Increase Feign/Ribbon timeouts (feign.client.config.default.readTimeout, ribbon.ReadTimeout) if the MDC call is slow.
- Add retry or a fallback (e.g. return a default image URL) instead of failing the whole request when the MDC service is temporarily unavailable.
- Re-run the call after confirming the MDC service has finished starting.
Example fix
// before
Wrapper<String> wrapper = mdcProductFeignApi.getMainImage(productId);
if (wrapper == null) {
throw new MdcBizException(ErrorCodeEnum.GL99990002);
}
return wrapper.getResult();
// after
Wrapper<String> wrapper = mdcProductFeignApi.getMainImage(productId);
if (wrapper == null || PublicUtil.isEmpty(wrapper.getResult())) {
logger.warn("主图获取失败, 使用默认图, productId={}", productId);
return DEFAULT_MAIN_IMAGE;
}
return wrapper.getResult(); Defensive patterns
Strategy: try-catch
Validate before calling
// caller-side pre-check: ensure the MDC service is reachable before calling
boolean mdcHealthy = restTemplateName.getForEntity("http://PAASCLOUD-PROVIDER-MDC/actuator/health", String.class).getStatusCode().is2xxSuccessful();
if (!mdcHealthy) { throw new IllegalStateException("MDC service is offline"); } Type guard
boolean hasResult(Wrapper<String> w) { return w != null && w.getResult() != null; } Try / catch
try {
String mainImage = mdcProductService.getMainImage(productId);
} catch (MdcBizException e) {
if ("GL99990002".equals(e.getMessage())) {
// downstream MDC offline/timeout: use default image or retry later
} else { throw e; }
} Prevention
- Monitor MDC service registration/health in the registry and alert on downtime.
- Set realistic Feign/Ribbon connect and read timeouts.
- Add circuit-breaker fallbacks (Hystrix/Sentinel) that degrade gracefully instead of throwing.
- Retry idempotent reads with backoff during service restarts.
When it happens
Trigger: Calling MdcProductServiceImpl.getMainImage(productId) when the paascloud-provider-mdc service is not registered in the registry (Eureka), is stopped/crashed, or the Feign call times out so the client returns a null Wrapper.
Common situations: MDC provider not started or crashed; wrong registry address in config; network partition or firewall between OMC and MDC services; Feign read/ribbon timeout too low under load; service still starting up when the call is made.
Related errors
AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10).
Data as JSON: /api/errors/6ca74739ada78056.
Report an issue: GitHub.
Appendix: source
Thrown at paascloud-provider/paascloud-provider-omc/src/main/java/com/paascloud/provider/service/impl/MdcProductServiceImpl.java:91
@Override
public int updateProductStockById(ProductDto productDto) {
Preconditions.checkArgument(productDto.getId() != null, ErrorCodeEnum.MDC10021021.msg());
Wrapper<Integer> wrapper = mdcProductFeignApi.updateProductStockById(productDto);
if (wrapper == null) {
throw new MdcBizException(ErrorCodeEnum.GL99990002);
}
if (wrapper.error()) {
throw new MdcBizException(ErrorCodeEnum.MDC10021022, productDto.getId());
}
return wrapper.getResult();
}
@Override
public String getMainImage(final Long productId) {
Wrapper<String> wrapper = mdcProductFeignApi.getMainImage(productId);
if (wrapper == null) {
throw new MdcBizException(ErrorCodeEnum.GL99990002);
}
return wrapper.getResult();
}
}
View on GitHub (pinned to 781281a950)