juicedata / juicesync

A tool to move your data between any clouds or regions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

format panic with qiniu kodo

e7 opened this issue · comments

commented

What happened:
juicefs format --storage=qiniu --bucket=http://some_qiniu_cdn_domain localhost test
2021/01/20 14:41:10.771521 juicefs[1728] : Meta address: redis://localhost
panic: runtime error: slice bounds out of range [:-1]

goroutine 1 [running]:
github.com/juicedata/juicesync/object.newQiniu(0x7ffd3dca278f, 0x1e, 0xc00004200b, 0x28, 0xc00004204b, 0x28, 0x2, 0x157d0a6, 0x7ffd3dca2780, 0x5)
/home/xxx/go/pkg/mod/github.com/juicedata/juicesync@v0.6.3-0.20210114082630-137546625adb/object/qiniu.go:164 +0x106e
github.com/juicedata/juicesync/object.CreateStorage(0x7ffd3dca2780, 0x5, 0x7ffd3dca278f, 0x1e, 0xc00004200b, 0x28, 0xc00004204b, 0x28, 0x24, 0xc000046540, ...)
/home/xxx/go/pkg/mod/github.com/juicedata/juicesync@v0.6.3-0.20210114082630-137546625adb/object/object_storage.go:123 +0x1ad
github.com/juicedata/juicefs/pkg/object.CreateStorage(0x7ffd3dca2780, 0x5, 0x7ffd3dca278f, 0x1e, 0xc00004200b, 0x28, 0xc00004204b, 0x28, 0xc0005df920, 0x45fb87, ...)
/home/xxx/Downloads/juicefs/pkg/object/interface.go:57 +0x26d
main.createStorage(0xc0005dfb68, 0x15806a1, 0x8, 0xc000548a40, 0x1c)
/home/xxx/Downloads/juicefs/cmd/format.go:54 +0xa5
main.format(0xc00054cd40, 0x8, 0xe)
/home/xxx/Downloads/juicefs/cmd/format.go:165 +0x8fe
github.com/urfave/cli/v2.(*Command).Run(0xc000141320, 0xc00054ca80, 0x0, 0x0)
/home/xxx/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:163 +0x4ed
github.com/urfave/cli/v2.(*App).RunContext(0xc0004b4ea0, 0x1784d80, 0xc00012a010, 0xc000130120, 0x6, 0x6, 0x0, 0x0)
/home/xxx/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:313 +0x81f
github.com/urfave/cli/v2.(*App).Run(...)
/home/xxx/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224
main.main()
/home/xxx/Downloads/juicefs/cmd/main.go:74 +0x93c

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • JuiceFS version (use ./juicefs --version): juicefs version 0.9.3-5 (2021-01-19 18baa89)
  • Cloud provider or hardware configuration running JuiceFS:
  • OS (e.g: cat /etc/os-release): Debian GNU/Linux 10 (buster)
  • Kernel (e.g. uname -a): SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux
  • Object storage (cloud provider and region): qiniu
  • Redis info (version, cloud provider managed or self maintained): 5.0.9
  • Network connectivity (JuiceFS to Redis, JuiceFS to object storage): ok
  • Others:
    REDIS_PASSWORD, ACCESS_KEY and SECRET_KEY environment variables are used

@e7 A vhost style endpoint should be provided like this: --bucket=http://mybucket.s3-.qiniucs.com, for the complete list of Qiniu endpoint: https://developer.qiniu.com/kodo/4088/s3-access-domainname

commented

@davies It works! But then I got this warning when mount, Any way can fix this?

juicefs mount localhost ~/juicefs
2021/01/21 11:10:14.527279 juicefs[6410] <INFO>: Meta address: redis://localhost
2021/01/21 11:10:14.531583 juicefs[6410] <INFO>: Data use qiniu://bucket/test/
2021/01/21 11:10:14.531968 juicefs[6410] <INFO>: Mounting volume test at /home/xxx/juicefs ...
2021/01/21 11:10:14.533352 juicefs[6410] <INFO>: Cache: /var/jfsCache/27c261b6-fe2f-4e44-90d9-0eff009da182 capacity: 1024 MB
2021/01/21 11:10:14.534825 <WARNING>: setpriority: permission denied

It's a warning, since you don't have root permission.