Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BucketManager.AsyncFetch 总是返回 incorrect zone #13

Open
huangjunwen opened this issue Mar 9, 2021 · 1 comment
Open

BucketManager.AsyncFetch 总是返回 incorrect zone #13

huangjunwen opened this issue Mar 9, 2021 · 1 comment

Comments

@huangjunwen
Copy link

import (
	"log"

	"github.com/qiniu/go-sdk/v7/auth"
	"github.com/qiniu/go-sdk/v7/storage"
)

func main() {
	mac := auth.New("ak", "sk")
	m := storage.NewBucketManagerEx(mac, nil, nil)
	ret, err := m.AsyncFetch(storage.AsyncFetchParam{
		Url:              "https://thirdwx.qlogo.cn/mmopen/..../132",
		Bucket:           "bucket-name",
		Key:              "path/to/avatar",
		CallbackURL:      "https://callback.com",
		CallbackBody:     "bucket=$(bucket)&key=$(key)&etag=$(etag)&fname=$(fname)&fsize=$(fsize)&mimeType=$(mimeType)&endUser=$(endUser)&attach=",
		CallbackBodyType: "application/x-www-form-urlencoded",
	})
	if err != nil {
		log.Fatalln(err)
	}
	log.Println(ret)
}

2021/03/09 09:58:21 incorrect zone

貌似之前一直是可以的

@huangjunwen
Copy link
Author

代码里的 regionXXX.ApiHost 是不是缺少了区域机房代号?

        // regionHuanan 表示华南机房
	regionHuanan = Region{
                // ....
		RsHost:    "rs-z2.qbox.me",
		RsfHost:   "rsf-z2.qbox.me",
		ApiHost:   "api.qiniu.com",           // 这里应该是 api-z2.qiniu.com ?
		IovipHost: "iovip-z2.qbox.me",
	}

我 fork 了一份 huangjunwen@0edaa12, 加上 zone 再测试就好了.

麻烦能否跟进一下这个问题, 谢谢

Ref:

Host: api-[Zone].qiniu.com 中的 [Zone] 为七牛各区域机房代号

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant