ipfs / go-ds-s3

An s3 datastore implementation
MIT License
240 stars 66 forks source link

interface {} is nil, not string #197

Closed hubsmoke closed 3 years ago

hubsmoke commented 3 years ago

Hi, I am attempting to set up a fresh IPFS node to point to S3 storage using this plugin

I have followed the instructions and have tried various combinations of things and have finally gotten the IPFS daemon to run, but I now have the following error:

go-ipfs version: 0.10.0-dev-f63a997c3-dirty
Repo version: 11
System version: amd64/linux
Golang version: go1.17
panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
github.com/ipfs/go-ipfs/plugin/plugins/levelds.(*leveldsPlugin).DatastoreConfigParser.func1(0x1dde8e0)
    go-ipfs/plugin/plugins/levelds/levelds.go:57 +0x1cd
github.com/ipfs/go-ipfs/repo/fsrepo.AnyDatastoreConfig(0x1e85800)
    go-ipfs/repo/fsrepo/datastores.go:88 +0x84
github.com/ipfs/go-ipfs/repo/fsrepo.MountDatastoreConfig(0x1dde8e0)
    go-ipfs/repo/fsrepo/datastores.go:113 +0x185
github.com/ipfs/go-ipfs/repo/fsrepo.AnyDatastoreConfig(0x1e2de80)
    go-ipfs/repo/fsrepo/datastores.go:88 +0x84
github.com/ipfs/go-ipfs/repo/fsrepo.(*FSRepo).openDatastore(0xc000c2a8a0)
    go-ipfs/repo/fsrepo/fsrepo.go:425 +0xef
github.com/ipfs/go-ipfs/repo/fsrepo.open({0xc00043c1f0, 0xb})
    go-ipfs/repo/fsrepo/fsrepo.go:169 +0x24c
github.com/ipfs/go-ipfs/repo/fsrepo.Open.func1()
    go-ipfs/repo/fsrepo/fsrepo.go:113 +0x25
github.com/ipfs/go-ipfs/repo.(*OnlyOne).Open(0x3478240, {0x1d49c80, 0xc0001db120}, 0xc000d3f630)
    go-ipfs/repo/onlyone.go:35 +0x155
github.com/ipfs/go-ipfs/repo/fsrepo.Open({0xc00043c1f0, 0xc000010018})
    go-ipfs/repo/fsrepo/fsrepo.go:115 +0x65
main.daemonFunc(0xc000129110, {0x1, 0x60}, {0x1f0c520, 0xc000c2a780})
    go-ipfs/cmd/ipfs/daemon.go:280 +0x565
github.com/ipfs/go-ipfs-cmds.(*executor).Execute(0x2515900, 0xc000129110, {0x2541d30, 0xc000c2a7e0}, {0x1f0c520, 0xc000c2a780})
    pkg/mod/github.com/ipfs/go-ipfs-cmds@v0.6.0/executor.go:77 +0x375
github.com/ipfs/go-ipfs-cmds/cli.Run({0x2541898, 0xc000cf8a40}, 0x34833c0, {0xc00003c040, 0x2, 0x2}, 0x40, 0xc000060708, 0xc000010020, 0x22d8760, ...)
    pkg/mod/github.com/ipfs/go-ipfs-cmds@v0.6.0/cli/run.go:137 +0x90e
main.mainRet()
    go-ipfs/cmd/ipfs/main.go:168 +0x4ea
main.main()
    go-ipfs/cmd/ipfs/main.go:71 +0x19

Here is my ~/.ipfs/datastore_spec

{
    "mounts": [
        {
            "bucket": "BUCKET_NAME",
            "mountpoint": "/blocks",
            "region": "us-east-2",
            "rootDirectory": "ipfs"
        },
        {
            "mountpoint": "/",
            "path": "datastore",
            "type": "levelds"
        }
    ],
    "type": "mount"
}

Here is my ~/.ipfs/config

{
    ...,
    "Datastore": {
        "StorageMax": "10GB",
        "StorageGCWatermark": 90,
        "GCPeriod": "1h",
        "Spec": {
            "mounts": [
                {
                    "child": {
                        "type": "s3ds",
                        "region": "us-east-2",
                        "bucket": "BUCKET",
                        "rootDirectory": "ipfs",
                        "accessKey": "",
                        "secretKey": ""
                    },
                    "mountpoint": "/blocks",
                    "prefix": "s3.datastore",
                    "type": "measure"
                },
                {
                    "mountpoint": "/",
                    "path": "datastore",
                    "type": "levelds"
                }
            ],
            "type": "mount"
        },
        "HashOnRead": false,
        "BloomFilterSize": 0
    },
    ...
}

Thanks!

welcome[bot] commented 3 years ago

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

Finally, remember to use https://discuss.ipfs.io if you just need general support.

Stebalien commented 3 years ago

You're missing "compression": "none" in your levelds config section.

Stebalien commented 3 years ago

https://github.com/ipfs/go-ipfs/pull/8370