streamingfast / merger

Apache License 2.0
4 stars 5 forks source link

Nil pointer panic #7

Closed sosedoff closed 2 years ago

sosedoff commented 2 years ago

Testing latest changes in the merger and hit this panic:

2021-12-30T17:08:40.462-0600    info    Initialized logger  {"log-level": "info"}
2021-12-30T17:08:40.462-0600    info    running merger  {"config": {"StorageOneBlockFilesPath":"./tmp/data/one_block","StorageMergedBlocksFilesPath":"./tmp/data/merged_block","GRPCListenAddr":"0.0.0.0:9020","WritersLeewayDuration":10000000000,"TimeBetweenStoreLookups":10000000000,"StateFile":"./tmp/merger.state","OneBlockDeletionThreads":10,"MaxOneBlockOperationsBatchSize":250,"NextExclusiveHighestBlockLimit":0}}
2021-12-30T17:08:40.462-0600    info    sanitized base path {"original_base_path": "./tmp/data/one_block", "sanitized_base_path": "tmp/data/one_block"}
2021-12-30T17:08:40.462-0600    info    sanitized base path {"original_base_path": "./tmp/data/merged_block", "sanitized_base_path": "tmp/data/merged_block"}
2021-12-30T17:08:40.462-0600    info    new bundler {"bundle_size": 100, "first_exclusive_highest_block_limit": 5323700}
2021-12-30T17:08:40.462-0600    info    merger initiated
2021-12-30T17:08:40.462-0600    info    merger running
2021-12-30T17:08:40.463-0600    info    starting merger {"bundle": "bundle_size: 100, last_merge_block_num: 0, inclusive_lower_block_num: 5323600, exclusive_highest_block_limit: 5323700"}
2021-12-30T17:08:40.463-0600    info    grpc server created
2021-12-30T17:08:40.463-0600    info    tcp listener created
2021-12-30T17:08:40.463-0600    info    server registered
2021-12-30T17:08:40.463-0600    info    listening & serving grpc content    {"grpc_listen_addr": "0.0.0.0:9020"}
2021-12-30T17:08:40.716-0600    info    retrieved list of files {"files_count": 191}
2021-12-30T17:08:40.717-0600    info    retrieved list of files {"too_old_files_count": 0, "added_files_count": 191}
2021-12-30T17:08:40.717-0600    info    one block retrieved {"last_block_file": 5323890}
2021-12-30T17:08:40.719-0600    info    merging bundle  {"highest_bundle_block_num": 0, "bundle": "bundle_size: 100, last_merge_block_num: 0, inclusive_lower_block_num: 5323600, exclusive_highest_block_limit: 5323700"}
2021-12-30T17:08:40.719-0600    info    bundle merged and committed {"bundle": "bundle_size: 100, last_merge_block_num: 0, inclusive_lower_block_num: 5323700, exclusive_highest_block_limit: 5323800", "last_merge_one_block_time": "0001-01-01T00:00:00.000Z"}
2021-12-30T17:08:40.719-0600    info    saving state    {"state": "exclusive_highest_block_limit: 5323800"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x19f83ac]

goroutine 72 [running]:
github.com/streamingfast/merger.(*Merger).launch(0xc00051e8c0)
    /Users/sosedoff/go/pkg/mod/github.com/streamingfast/merger@v0.0.3-0.20211222185803-be94ba68b3dd/merger.go:158 +0x8ec
github.com/streamingfast/merger.(*Merger).Launch(0xc00051e8c0)
    /Users/sosedoff/go/pkg/mod/github.com/streamingfast/merger@v0.0.3-0.20211222185803-be94ba68b3dd/merger.go:77 +0x12a
created by github.com/streamingfast/merger/app/merger.(*App).Run
    /Users/sosedoff/go/pkg/mod/github.com/streamingfast/merger@v0.0.3-0.20211222185803-be94ba68b3dd/app/merger/app.go:142 +0x9dd

Happens during first run, when first available one-block file has a different height than first-streamable-block param and no merged-block files exist. Merger state file has been removed prior to the start.

sduchesneau commented 2 years ago

@sosedoff hi! there have been a few changes in merger since commit be94ba68b3dd (currently, our develop branch is the one to track), could you let me know if you still have this problem with the latest code ?

matthewdarwin commented 2 years ago

Probably close this?

sosedoff commented 2 years ago

If i recall correctly, this issue has been resolved.