cosmos / gaia

Cosmos Hub
https://hub.cosmos.network
Apache License 2.0
465 stars 679 forks source link

Basic container setup error. Panic: interface conversion error #1485

Closed meteokr closed 2 years ago

meteokr commented 2 years ago

Summary of Bug

Attempting to create a node using a container. Panic ensues.

Version

gaiad v7.0.2 and v7.0.1 tested with same results.

Steps to Reproduce

Sorry if its bad form but here is my simple Dockerfile

FROM docker.io/debian:11
RUN apt update && apt install -y wget
RUN useradd -m gaiadworker
USER gaiadworker
WORKDIR /home/gaiadworker
RUN wget -O gaiad "https://github.com/cosmos/gaia/releases/download/v7.0.2/gaiad-v7.0.2-linux-amd64"
RUN chmod a+x ./gaiad
RUN mkdir -p ./.gaia/config/
RUN wget -O ./.gaia/config/addrbook.json "https://quicksync.io/addrbook.cosmos.json"
RUN echo 'minimum-gas-prices = "0.0025uatom"' > .gaia/config/app.toml
CMD ./gaiad init $nodename --chain-id cosmoshub-4 && ./gaiad start

I am following this guide, https://github.com/cosmos/gaia/blob/main/docs/hub-tutorials/join-mainnet.md doing what I understand as the bare minimum to get started by not changing any defaults values. Testing with "./gaiad init yadayada --chain-id cosmoshub-4 && ./gaiad start" does not change outcome.

Upon ./gaiad start :

panic: interface conversion: interface {} is nil, not []interface {}

goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/server/config.GetConfig(_)
        github.com/cosmos/cosmos-sdk@v0.45.3/server/config/config.go:253 +0xb6c
github.com/cosmos/cosmos-sdk/server.startInProcess(_, {{0x0, 0x0, 0x0}, {0x25265f8, 0xc0010f8ba0}, {0x0, 0x0}, {0x24f1050, 0xc000ffe440}, ...}, ...)
        github.com/cosmos/cosmos-sdk@v0.45.3/server/start.go:245 +0x34b
github.com/cosmos/cosmos-sdk/server.StartCmd.func2(0xc00104c000, {0xc0010d70c0, 0x0, 0x1})
        github.com/cosmos/cosmos-sdk@v0.45.3/server/start.go:126 +0x169
github.com/spf13/cobra.(*Command).execute(0xc00104c000, {0xc0010d70b0, 0x1, 0x1})
        github.com/spf13/cobra@v1.4.0/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0xc000f96f00)
        github.com/spf13/cobra@v1.4.0/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.4.0/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
        github.com/spf13/cobra@v1.4.0/command.go:895
github.com/cosmos/cosmos-sdk/server/cmd.Execute(0x0, {0xc000c199e0, 0x17})
        github.com/cosmos/cosmos-sdk@v0.45.3/server/cmd/execute.go:36 +0x1eb
main.main()
        github.com/cosmos/gaia/v7/cmd/gaiad/main.go:16 +0x2c

grepping for "interface" yields no results, so I cannot find what setting is required here. Is the documentation out of date, or am I missing a step somewhere to create a super basic node?


For Admin Use

glnro commented 2 years ago

Hi @krassev would you mind trying with v7.0.0 and reporting the results?

meteokr commented 2 years ago

Sure!

Very slightly different output:

6:53AM INF starting ABCI with Tendermint
panic: interface conversion: interface {} is nil, not []interface {}

goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/server/config.GetConfig(_)
        github.com/cosmos/cosmos-sdk@v0.45.1/server/config/config.go:253 +0xb6c
github.com/cosmos/cosmos-sdk/server.startInProcess(_, {{0x0, 0x0, 0x0}, {0x20ad0b8, 0xc0011bb2f0}, {0x0, 0x0}, {0x2077ad0, 0xc001081a20
}, ...}, ...)
        github.com/cosmos/cosmos-sdk@v0.45.1/server/start.go:248 +0x34b
github.com/cosmos/cosmos-sdk/server.StartCmd.func2(0xc00111af00, {0xc0011be480, 0x0, 0x1})
        github.com/cosmos/cosmos-sdk@v0.45.1/server/start.go:129 +0x193
github.com/spf13/cobra.(*Command).execute(0xc00111af00, {0xc0011be470, 0x1, 0x1})
        github.com/spf13/cobra@v1.3.0/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0xc001104000)
        github.com/spf13/cobra@v1.3.0/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.3.0/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
        github.com/spf13/cobra@v1.3.0/command.go:895
github.com/cosmos/cosmos-sdk/server/cmd.Execute(0x0, {0xc000575e90, 0x17})
        github.com/cosmos/cosmos-sdk@v0.45.1/server/cmd/execute.go:36 +0x1eb
main.main()
        github.com/cosmos/gaia/v7/cmd/gaiad/main.go:16 +0x2c

Here is the output from "gaiad init yadayada --chain-id cosmoshub-4" in the same setup

{"app_message":{"auth":{"accounts":[],"params":{"max_memo_characters":"256","sig_verify_cost_ed25519":"590","sig_verify_cost_secp256k1":"1000","tx_sig_limit":"7","tx_size_cost_per_byte":"10"}},"authz":{"authorization":[]},"bank":{"balances":[],"denom_metadata":[],"params":{"default_send_enabled":true,"send_enabled":[]},"supply":[]},"capability":{"index":"1","owners":[]},"crisis":{"constant_fee":{"amount":"1000","denom":"stake"}},"distribution":{"delegator_starting_infos":[],"delegator_withdraw_infos":[],"fee_pool":{"community_pool":[]},"outstanding_rewards":[],"params":{"base_proposer_reward":"0.010000000000000000","bonus_proposer_reward":"0.040000000000000000","community_tax":"0.020000000000000000","withdraw_addr_enabled":true},"previous_proposer":"","validator_accumulated_commissions":[],"validator_current_rewards":[],"validator_historical_rewards":[],"validator_slash_events":[]},"evidence":{"evidence":[]},"feegrant":{"allowances":[]},"genutil":{"gen_txs":[]},"gov":{"deposit_params":{"max_deposit_period":"172800s","min_deposit":[{"amount":"10000000","denom":"stake"}]},"deposits":[],"proposals":[],"starting_proposal_id":"1","tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"votes":[],"voting_params":{"voting_period":"172800s"}},"ibc":{"channel_genesis":{"ack_sequences":[],"acknowledgements":[],"channels":[],"commitments":[],"next_channel_sequence":"0","receipts":[],"recv_sequences":[],"send_sequences":[]},"client_genesis":{"clients":[],"clients_consensus":[],"clients_metadata":[],"create_localhost":false,"next_client_sequence":"0","params":{"allowed_clients":["06-solomachine","07-tendermint"]}},"connection_genesis":{"client_connection_paths":[],"connections":[],"next_connection_sequence":"0","params":{"max_expected_time_per_block":"30000000000"}}},"interchainaccounts":{"controller_genesis_state":{"active_channels":[],"interchain_accounts":[],"params":{"controller_enabled":true},"ports":[]},"host_genesis_state":{"active_channels":[],"interchain_accounts":[],"params":{"allow_messages":[],"host_enabled":true},"port":"icahost"}},"liquidity":{"params":{"circuit_breaker_enabled":false,"init_pool_coin_mint_amount":"1000000","max_order_amount_ratio":"0.100000000000000000","max_reserve_coin_amount":"0","min_init_deposit_amount":"1000000","pool_creation_fee":[{"amount":"40000000","denom":"stake"}],"pool_types":[{"description":"Standard liquidity pool with pool price function X/Y, ESPM constraint, and two kinds of reserve coins","id":1,"max_reserve_coin_num":2,"min_reserve_coin_num":2,"name":"StandardLiquidityPool"}],"swap_fee_rate":"0.003000000000000000","unit_batch_height":1,"withdraw_fee_rate":"0.000000000000000000"},"pool_records":[]},"mint":{"minter":{"annual_provisions":"0.000000000000000000","inflation":"0.130000000000000000"},"params":{"blocks_per_year":"6311520","goal_bonded":"0.670000000000000000","inflation_max":"0.200000000000000000","inflation_min":"0.070000000000000000","inflation_rate_change":"0.130000000000000000","mint_denom":"stake"}},"packetfowardmiddleware":{"params":{"fee_percentage":"0.000000000000000000"}},"params":null,"slashing":{"missed_blocks":[],"params":{"downtime_jail_duration":"600s","min_signed_per_window":"0.500000000000000000","signed_blocks_window":"100","slash_fraction_double_sign":"0.050000000000000000","slash_fraction_downtime":"0.010000000000000000"},"signing_infos":[]},"staking":{"delegations":[],"exported":false,"last_total_power":"0","last_validator_powers":[],"params":{"bond_denom":"stake","historical_entries":10000,"max_entries":7,"max_validators":100,"unbonding_time":"1814400s"},"redelegations":[],"unbonding_delegations":[],"validators":[]},"transfer":{"denom_traces":[],"params":{"receive_enabled":true,"send_enabled":true},"port_id":"transfer"},"upgrade":{},"vesting":{}},"chain_id":"cosmoshub-4","gentxs_dir":"","moniker":"yadayada","node_id":"ff93658bf29f97516eeab61b3978cb42121cbf8a"}

glnro commented 2 years ago

Hi @krassev it looks like you're trying to sync a node from the most recent release without using statesync or quicksync...if you want to sync a node via blocksync, you'll have to start with gaia v4.0.2...and then perform each subsequent upgrade which will take an incredibly long time and is not advisable. I suggest following the Quickstart Guide and sync via statesync or via quicksync.

Furthermore, I suggest doing this with v7.0.0 of gaia and then upgrading to v7.0.2 once you've been able to sync your node.

meteokr commented 2 years ago

Progress has been made.

This is the init script now.

#!/usr/bin/env bash

~/go/bin/gaiad init yadayada --chain-id cosmoshub-4

curl https://quicksync.io/addrbook.cosmos.json > ~/.gaia/config/addrbook.json

# "https://hub.cosmos.network/main/getting-started/quickstart.html"
# State Sync
sed -i'' 's/minimum-gas-prices = ""/minimum-gas-prices = "0.0025uatom"/' ~/.gaia/config/app.toml

# Configure State sync
sed -i'' 's/enable = false/enable = true/' ~/.gaia/config/config.toml
sed -i'' 's/trust_height = 0/trust_height = 10538758/' ~/.gaia/config/config.toml
sed -i'' 's/trust_hash = ""/trust_hash = "0D40F395A630763AC6A7449748AB19AC3AC8C0F797C3EAA7B0AA829D81B252A5"/' $HOME/.gaia/config/config.toml
sed -i'' 's/rpc_servers = ""/rpc_servers = "https:\/\/rpc.cosmos.network:443,https:\/\/rpc.cosmos.network:443"/' ~/.gaia/config/config.toml

~/go/bin/gaiad start --x-crisis-skip-assert-invariants

All seems correct now. I do get a lot of this type of error, but I assume that just because it's finding peers correct?

6:19PM ERR dialing failed (attempts: 1): auth failure: secret conn failed: EOF addr={"id":"604ce634bf7f938632bb2ca45aea0ea50ceac8e5","i
p":"REDACTEDIP","port":26656} module=pex                                                                                            
6:19PM ERR dialing failed (attempts: 1): dial tcp REDACTEDIP:54234: i/o timeout addr={"id":"77f23d0ae0022f54b044ce4b58158e7c04fcd20
0","ip":"REDACTEDIP","port":54234} module=pex

A small understanding question I have left, is accord to, https://hub.cosmos.network/main/hub-tutorials/join-mainnet.html#state-sync The graph labels "State Sync" as "Minimal Historical Data". If I start a state sync from a certain block height, and set pruning = "nothing" does that mean that I can save full historical data FROM the specific starting position? Or does the pruning setting only take effect from a quick/block sync? Can I resume a state sync that was paused for a reasonably long amount of time, and catch up, or would I need to readjust the starting block height if the sync was paused for too long?

glnro commented 2 years ago

Hi @krassev, since you are syncing via state sync, if you choose pruning = nothing and you keep indexing on (which is the default) you will begin persisting full historical state from the block height that your node starts syncing at. If you wanted a full historical version of cosmoshub-4, then you would need to sync a full archive node via quicksync. This takes at least a day or two to download, unzip and catch up, depending on when you start syncing after the most recent archive snapshot.

meteokr commented 2 years ago

Perfect, thank you very much. <3