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

Not able to start perkeepd with blackblaze(b2) enabled in config #1606

Open
malisetti opened this issue Apr 29, 2022 · 2 comments
Open

Not able to start perkeepd with blackblaze(b2) enabled in config #1606

malisetti opened this issue Apr 29, 2022 · 2 comments

Comments

@malisetti
Copy link

Below is my config

 cat .config/perkeep/server-config.json
{
    "auth": "localhost",
    "listen": ":3179",
    "camliNetIP": "",
    "identity": "E0A616FDD3D96BA7",
    "identitySecretRing": "/home/malisetti/.config/perkeep/identity-secring.gpg",
    "packRelated": true,
    "blobPath": "/home/malisetti/var/perkeep/blobs",
    "b2": "keyId:applicationKey:my-perkeep-backup",
    "levelDB": "/home/malisetti/var/perkeep/index.leveldb"
}

The error i get when starting perkeepd

./perkeep/perkeepd
2022/04/29 13:03:27 Starting perkeepd version 0.11, 2020-11-11-7675528645; Go go1.15.3 (linux/amd64)
2022/04/29 13:03:27 Starting to listen on http://localhost:3179
2022/04/29 13:03:27 blobpacked: checking integrity of packed blobs against index...
2022/04/29 13:03:27 blobpacked: 0 large blobs found in index, 0 missing from index
2022/04/29 13:03:29 Caught panic installer handlers: error instantiating storage for prefix "/sto-b2/", type "b2": Post "https://api004.backblazeb2.com/b2api/v1/b2_list_buckets": b2 remote error [bad_request]: accountId invalid
goroutine 1 [running]:
runtime/debug.Stack(0xc00007e0a0, 0x2, 0xc0005d00d0)
        /usr/local/go/src/runtime/debug/stack.go:24 +0x9f
runtime/debug.PrintStack()
        /usr/local/go/src/runtime/debug/stack.go:16 +0x25
perkeep.org/pkg/serverinit.(*Config).InstallHandlers.func1(0xc0008f1db8)
        /gopath/src/perkeep.org/pkg/serverinit/serverinit.go:660 +0x9e
panic(0x13f0000, 0xc0000b2490)
        /usr/local/go/src/runtime/panic.go:975 +0x47a
perkeep.org/pkg/serverinit.(*handlerLoader).setupHandler.func1(0xc001185b60, 0xc00111b1f0, 0x171abe8, 0xc)
        /gopath/src/perkeep.org/pkg/serverinit/serverinit.go:305 +0x165
panic(0x13f0000, 0xc0000b2490)
        /usr/local/go/src/runtime/panic.go:969 +0x1b9
perkeep.org/pkg/serverinit.(*handlerLoader).setupHandler.func1(0xc001185da0, 0xc00111b1f0, 0x17154c8, 0x8)
        /gopath/src/perkeep.org/pkg/serverinit/serverinit.go:305 +0x165
panic(0x13f0000, 0xc0000b2490)
        /usr/local/go/src/runtime/panic.go:969 +0x1b9
perkeep.org/pkg/serverinit.exitFailure(0x175a97e, 0x36, 0xc0008f13c0, 0x3, 0x3)
        /gopath/src/perkeep.org/pkg/serverinit/serverinit.go:274 +0x12e
perkeep.org/pkg/serverinit.(*handlerLoader).setupHandler(0xc00111b1f0, 0x17154c8, 0x8)
        /gopath/src/perkeep.org/pkg/serverinit/serverinit.go:316 +0x959
perkeep.org/pkg/serverinit.(*handlerLoader).GetStorage(0xc00111b1f0, 0x17154c8, 0x8, 0x1ea4be0, 0xc0011f4a20, 0x0, 0x0)
        /gopath/src/perkeep.org/pkg/serverinit/serverinit.go:248 +0x45
perkeep.org/pkg/server.newSyncFromConfig(0x1eaace0, 0xc00111b1f0, 0xc0011854a0, 0x4, 0xc00010e3e8, 0x1, 0xc0011a5708)
        /gopath/src/perkeep.org/pkg/server/sync.go:166 +0x3a8
perkeep.org/pkg/blobserver.CreateHandler(0x17109fe, 0x4, 0x1eaace0, 0xc00111b1f0, 0xc0011854a0, 0x1e7ae01, 0xc0011a03c0, 0x0, 0x0)
        /gopath/src/perkeep.org/pkg/blobserver/registry.go:140 +0xc4
perkeep.org/pkg/serverinit.(*handlerLoader).setupHandler(0xc00111b1f0, 0x171abe8, 0xc)
        /gopath/src/perkeep.org/pkg/serverinit/serverinit.go:367 +0xa2e
perkeep.org/pkg/serverinit.(*handlerLoader).setupAll(0xc00111b1f0)
        /gopath/src/perkeep.org/pkg/serverinit/serverinit.go:228 +0x96
perkeep.org/pkg/serverinit.(*Config).InstallHandlers(0xc001167180, 0x1e7afc0, 0xc0011672c0, 0xc001186840, 0x15, 0x0, 0x0, 0x0, 0x0)
        /gopath/src/perkeep.org/pkg/serverinit/serverinit.go:727 +0x9be
main.Main()
        /gopath/src/perkeep.org/server/perkeepd/perkeepd.go:455 +0x5b1
main.main()
        /gopath/src/perkeep.org/server/perkeepd/perkeepd.go:391 +0x25
Error parsing config: Caught panic: error instantiating storage for prefix "/sto-b2/", type "b2": Post "https://api004.backblazeb2.com/b2api/v1/b2_list_buckets": b2 remote error [bad_request]: accountId invalid```
@MichaHoffmann
Copy link
Member

Hey,

It works for me by using low-level config s3 with a build based on #1599 and the roughly following config:

...
    "/b2/": {
      "handler": "storage-s3",
      "handlerArgs": {
        "hostname": "...",
	"aws_access_key": "...",
	"aws_secret_access_key": "...",
	"bucket": "..."
      }
    },
    "/sync/": {
      "handler": "sync",
      "handlerArgs": {
        "from": "/bs/",
        "queue": {
          "file": "/path/to/sync-to-b2-queue.sqlite",
          "type": "sqlite"
        },
        "to": "/b2/"
      }
    },
...

I just created the low-level-config by dumping it first with pk dumpconfig and then adding the b2 + sync parts.

@kalidor
Copy link
Contributor

kalidor commented May 16, 2022

If you're using the build based on #1599, you missed the endpoint as last argument : "b2": "appKey:SecretKey:bucket:endpoint", can you try this ?

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

3 participants