{"record":{"id":"8c71d71086664692","repo":"paascloud/paascloud-master","slug":"omc10031013","errorCode":"OMC10031013","errorMessage":"OMC10031013","messagePattern":"OMC10031013","errorType":"error_code","errorClass":"OmcBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-omc/src/main/java/com/paascloud/provider/service/impl/OpcOssServiceImpl.java","lineNumber":53,"sourceCode":"\t@Resource\n\tprivate OpcOssFeignApi opcOssFeignApi;\n\n\t@Override\n\tpublic OptUploadFileRespDto uploadFile(OptUploadFileReqDto optUploadFileReqDto) {\n\t\tlog.info(\"uploadFile - 上传附件. optUploadFileReqDto={}\", optUploadFileReqDto);\n\t\tWrapper<OptUploadFileRespDto> wrapper = opcOssFeignApi.uploadFile(optUploadFileReqDto);\n\t\tif (null == wrapper || wrapper.error()) {\n\t\t\tthrow new OmcBizException(ErrorCodeEnum.OMC10031012);\n\t\t}\n\t\treturn wrapper.getResult();\n\t}\n\n\t@Override\n\tpublic String getFileUrl(OptGetUrlRequest optGetUrlRequest) {\n\t\tlog.info(\"getFileUrl - 获取附件地址. optUploadFileReqDto={}\", optGetUrlRequest);\n\t\tWrapper<String> wrapper = opcOssFeignApi.getFileUrl(optGetUrlRequest);\n\t\tif (null == wrapper || wrapper.error()) {\n\t\t\tthrow new OmcBizException(ErrorCodeEnum.OMC10031013);\n\t\t}\n\t\treturn wrapper.getResult();\n\t}\n}\n","sourceCodeStart":35,"sourceCodeEnd":58,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-omc/src/main/java/com/paascloud/provider/service/impl/OpcOssServiceImpl.java#L35-L58","documentation":"ErrorCodeEnum.OMC10031013 ('failed to get attachment URL', 获取附件地址失败) is thrown by OpcOssServiceImpl.getFileUrl when the opc-oss Feign call getFileUrl returns null or an error Wrapper. It indicates the remote OSS service could not produce a signed/accessible URL for the requested file.","triggerScenarios":"Calling getFileUrl(optGetUrlRequest) when the opc-oss service is unavailable (null wrapper from fallback), or the OSS service errors resolving the file key/bucket (nonexistent file key, expired/invalid credentials).","commonSituations":"Requesting a URL for a file that was never uploaded or already removed from the bucket, opc-oss service down, misconfigured bucket/endpoint after an environment migration.","solutions":["Confirm the optGetUrlRequest file key/bucket matches what uploadFile actually stored","Check opc-oss service availability and its logs for the underlying OSS SDK error","Validate OSS credentials/bucket configuration in the opc-oss provider's environment"],"exampleFix":"// before\nWrapper<String> wrapper = opcOssFeignApi.getFileUrl(optGetUrlRequest);\nif (null == wrapper || wrapper.error()) {\n    throw new OmcBizException(ErrorCodeEnum.OMC10031013);\n}\n// after\nWrapper<String> wrapper = opcOssFeignApi.getFileUrl(optGetUrlRequest);\nif (null == wrapper || wrapper.error()) {\n    log.error(\"getFileUrl failed for key={}\", optGetUrlRequest.getKey());\n    return null; // or throw with detail\n}","handlingStrategy":"fallback","validationCode":"if (optGetUrlRequest == null || Strings.isNullOrEmpty(optGetUrlRequest.getKey())) {\n    throw new IllegalArgumentException(\"file key required\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    String url = opcOssService.getFileUrl(optGetUrlRequest);\n} catch (OmcBizException e) {\n    if (e.getCode() == 10031013) { url = fallbackUrl(optGetUrlRequest); }\n    else throw e;\n}","preventionTips":["Only request URLs for keys returned by a successful uploadFile","Verify bucket/endpoint config in the opc-oss provider per environment","Cache URLs and reuse while valid to reduce RPC/OSS load"],"tags":["oss","feign","file-url","rpc"],"backgroundTag":"upstream-api-error","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"}