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

Fail to restart service. #1252

Closed
zhongdonglin opened this issue Feb 9, 2023 · 4 comments
Closed

Fail to restart service. #1252

zhongdonglin opened this issue Feb 9, 2023 · 4 comments

Comments

@zhongdonglin
Copy link

When I tried to restart the service, this problem occurred. Is there any problem with index

2023-02-08T10:35:21.003Z        INFO    storethehash/index      index/index.go:417      Scanned /index/storetheindex/data/valuestore/storethehash.index.8654
panic: runtime error: index out of range [3] with length 0

goroutine 1 [running]:
encoding/binary.littleEndian.Uint32(...)
        /usr/local/go/src/encoding/binary/binary.go:64
github.com/ipld/go-storethehash/store/index.scanIndexFile({0x1b2aef0, 0xc00012a480}, {0xc00017c100?, 0x53?}, 0x21cf, {0xc002a80000, 0x1000000, 0x0?}, 0x40000000)
        /home/lotus/go/pkg/mod/github.com/ipld/go-storethehash@v0.3.13/store/index/index.go:410 +0xb45
github.com/ipld/go-storethehash/store/index.scanIndex({0x1b2aef0, 0xc00012a480}, {0xc00017c100, 0x37}, 0x2a80001?, {0xc002a80000, 0x1000000, 0x1000000}, 0x0?)
        /home/lotus/go/pkg/mod/github.com/ipld/go-storethehash@v0.3.13/store/index/index.go:293 +0xde
github.com/ipld/go-storethehash/store/index.Open({0x1b2aef0, 0xc00012a480}, {0xc00017c100, 0x37}, {0x1b351e8?, 0xc0002ba2a0}, 0x18, 0x40000000, 0x1a3185c5000, 0x45d964b800, ...)
        /home/lotus/go/pkg/mod/github.com/ipld/go-storethehash@v0.3.13/store/index/index.go:206 +0x53b
github.com/ipld/go-storethehash/store.OpenStore({0x1b2aef0, 0xc00012a480}, {0x16cd065, 0x9}, {0xc00017c140, 0x36}, {0xc00017c100, 0x37}, 0x0, {0xc0008dedd8, ...})
        /home/lotus/go/pkg/mod/github.com/ipld/go-storethehash@v0.3.13/store/store.go:93 +0x310
github.com/ipni/go-indexer-core/store/storethehash.New({0x1b2aef0, 0xc00012a480}, {0xc0000434d0, 0x24}, 0x40, {0xc0008dedd8, 0x6, 0x6})
        /home/lotus/go/pkg/mod/github.com/ipni/go-indexer-core@v0.6.20-0.20230112154735-7b53be959fe6/store/storethehash/storethehash.go:74 +0x211
github.com/ipni/storetheindex/command.createValueStore({0x1b2aef0, 0xc00012a480}, {0x493e0, 0x6fc23ac00, 0x40, 0x4056800000000000, 0x1a3185c5000, 0x45d964b800, 0x0, 0x0, ...})
        /home/lotus/go/pkg/mod/github.com/ipni/storetheindex@v0.5.7/command/daemon.go:532 +0x58f
github.com/ipni/storetheindex/command.daemonCommand(0xc00012a980)
        /home/lotus/go/pkg/mod/github.com/ipni/storetheindex@v0.5.7/command/daemon.go:90 +0x2a5
github.com/urfave/cli/v2.(*Command).Run(0x253e4c0, 0xc00012a700)
        /home/lotus/go/pkg/mod/github.com/urfave/cli/v2@v2.16.3/command.go:173 +0x6a2
github.com/urfave/cli/v2.(*App).RunContext(0xc00004c700, {0x1b2aef0?, 0xc00012a480}, {0xc000152000, 0x2, 0x2})
        /home/lotus/go/pkg/mod/github.com/urfave/cli/v2@v2.16.3/app.go:383 +0xfb5
main.main()
        /home/lotus/go/pkg/mod/github.com/ipni/storetheindex@v0.5.7/main.go:55 +0x325
@gammazero
Copy link
Collaborator

The panic comes from here:
https://cs.opensource.google/go/go/+/refs/tags/go1.18.6:src/encoding/binary/binary.go;l=64
when called from here:
https://github.com/ipld/go-storethehash/blob/master/store/index/index.go#L410

This means that the size that was read from the index file, here, was less than 4 bytes, causing the data here to be too short and failing the bounds check.

This means that something is wrong with the index file as it appears to have an invalid data size value.

@zhongdonglin
Copy link
Author

What should I do? Can I delete the corresponding index file?

@gammazero
Copy link
Collaborator

Do not delete the corresponding index file, but rather truncate it to zero size. Unfortunately, this will result in the loss of any indexed data that was referenced by the indexes in that file.

If you are planning on re-indexing, then I recommend you move to a more recent version of the indexer that supports the Pebble valuestore. Using that will result in significantly better storage space utilization, and better performance an larger scale.

@gammazero
Copy link
Collaborator

This issue is dead. Any recovery of a version this old is to simply install new indexer and other services and reindex.

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

2 participants