aliyun / alibaba-cloud-sdk-go

Alibaba Cloud SDK for Go
Apache License 2.0
1.16k stars 273 forks source link

阿里云图片审核Go代码返回SDK.JsonUnmarshalError] Failed to unmarshal response, but you can get the data via response.GetHttpStatusCode() and response.GetHttpContentString() #568

Closed ouyangzhongmin closed 2 years ago

ouyangzhongmin commented 2 years ago

直接build centos上执行程序不报错,在k8s 1.16 版本 golang:1.18.1-alpine3.15 镜像内内返回打印返回如下错误: <!DOCTYPE html>\n<html lang=\"en\">\n\n\t<meta charset=\"UTF-8\">\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\tcom.com - owned and operated since 1995\n\t\n\n\n<img id=\"logo\" src=\"http://cdnwtc.s3.amazonaws.com/img/logo.png\" alt=\"com.com\">\n

Coming soon...

\n
\n\t<div class=\"button-group\">\n\t\t<a href=\"docs/why.html\" target=\"_blank\" class=\"button secondary tiny\">Why am I Here?\n\t\t<a href=\"docs/legal.html\" target=\"_blank\" class=\"button secondary tiny\">Legal Information\n\t\t<a href=\"docs/terms.html\" target=\"_blank\" class=\"button secondary tiny\">Terms of Use\n\t\t<a href=\"docs/privacy.html\" target=\"_blank\" class=\"button secondary tiny\">Privacy Policy\n\t
\n\n\tcom.com - owned and operated since 1995\n\n\n

源代码: req := green.CreateImageSyncScanRequest() body, _ := json.Marshal(data) req.SetContent(body) res, err := Client.ImageSyncScan(req) if err != nil { //以上错误这里打印的 logger.Errorln("CheckImageSync respose000::::", string(res.GetHttpContentBytes())) return nil, err } if res.IsSuccess() { v := &ImageRes{} err = json.Unmarshal(res.GetHttpContentBytes(), v) if err != nil { logger.Errorln("CheckImageSync respose::::", string(res.GetHttpContentBytes())) } return v, err }

ouyangzhongmin commented 2 years ago

原来是我自己的k8s dns问题