[SOLVED] Bare metal validator can't start: panic: runtime error: slice bounds out of range [:4] with capacity 0

Hi,

I’m trying to light-up a bare metal validator but get

panic: runtime error: slice bounds out of range [:4] with capacity 0

I’m driving the app with systemd

EnvironmentFile=/etc/systemd/system/incognito.env
ExecStart=/bin/bash -c "cd ~ && env | sort && ( cd ./incognito-chain && git log -1 ) && exec ./incognito-chain/incognito --configfile=.incognito/config.conf"

Here’s the log with some redacted info

Jul 05 11:49:25 systemd[1]: Started Incognito.
Jul 05 11:49:25 incognito[153078]: BOOTNODE_IP=mainnet-bootnode.incognito.org:9330
Jul 05 11:49:25 incognito[153078]: GETH_NAME=mainnet.infura.io/v3/xxxx7dddb3f14022a89229d86142xxxx
Jul 05 11:49:25 incognito[153078]: GETH_PORT=
Jul 05 11:49:25 incognito[153078]: GETH_PROTOCOL=https
Jul 05 11:49:25 incognito[153078]: HOME=/home/incognito-service
Jul 05 11:49:25 incognito[153078]: INVOCATION_ID=35a26e4b0e44411d9c04407f4547aba8
Jul 05 11:49:25 incognito[153078]: JOURNAL_STREAM=9:128560180
Jul 05 11:49:25 incognito[153078]: LANG=en_US.UTF-8
Jul 05 11:49:25 incognito[153078]: LIMIT_FEE=1
Jul 05 11:49:25 incognito[153078]: LOGNAME=incognito
Jul 05 11:49:25 incognito[153078]: MININGKEY=12AYkZy5wm5QPtVySCjw7jzuRMa6DPgHg6onwQKhyyzGf7XLiR4
Jul 05 11:49:25 incognito[153078]: NODE_PORT=9433
Jul 05 11:49:25 incognito[153078]: OLDPWD=/
Jul 05 11:49:25 incognito[153078]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Jul 05 11:49:25 incognito[153078]: PWD=/home/incognito-service
Jul 05 11:49:25 incognito[153078]: RPC_PORT=9334
Jul 05 11:49:25 incognito[153078]: SHELL=/bin/bash
Jul 05 11:49:25 incognito[153078]: SHLVL=0
Jul 05 11:49:25 incognito[153078]: TESTNET=false
Jul 05 11:49:25 incognito[153078]: USER=incognito-service
Jul 05 11:49:25 incognito[153078]: _=/usr/bin/env
# $( cd incognito-chain && git log -1)
Jul 05 11:49:25 incognito[153078]: commit dbe2c254d534058a952fe4120daf904370c005b4
Jul 05 11:49:25 incognito[153078]: Author: 0xsirrush <[email protected]>
Jul 05 11:49:25 incognito[153078]: Date:   Thu Jun 11 14:07:09 2020 +0700
Jul 05 11:49:25 incognito[153078]:     - Release Portal v2
Jul 05 11:49:25 incognito[153078]: NumCPU 8
Jul 05 11:49:25 incognito[153078]: 2020-07-05 11:49:25.362 incognito.go:87 [INF] Server log: Version 1.21.0-beta
Jul 05 11:49:25 incognito[153078]: 2020-07-05 11:49:25.450 server.go:257 [INF] Server log: Init 3-rd Party Random Client
Jul 05 11:49:25 incognito[153078]: encoded libp2p key: CAMSeTB3AgEBBCCPF9hbC0QCyVYuljKVFiF5t5PhJ9nBXKkBD8mWB91nSaAKBggqhkjOPQMBB6FEA0IABCfxg0YnobfPSG3nCkaDO7IjLNUaYstAypbXZ6tZJuMdg8Bf6f4Ev1vQRlKlhPkY9LkW6RzxAx9GkyPUdPh30G8=
Jul 05 11:49:25 incognito[153078]: 2020-07-05 11:49:25.479 host.go:88 [INF] Peerv2 log: selfPeer: QmfVVGjSqtpLdKqfMuc7SjwhdaZP2w8npNBxgjaMaAsWgG 127.0.0.1 9444
Jul 05 11:49:25 incognito[153078]: 2020-07-05 11:49:25.480 beaconprocess.go:831 [INF] BlockChain log: Process Update Beacon Best State With Beacon Genesis Block
Jul 05 11:49:25 incognito[153078]: 2020-07-05 11:49:25.480 incognito.go:144 [WRN] Server log: Gracefully shutting down the btc database...
Jul 05 11:49:25 incognito[153078]: 2020-07-05 11:49:25.499 panic.go:969 [WRN] Server log: Shutdown complete
Jul 05 11:49:25 incognito[153078]: panic: runtime error: slice bounds out of range [:4] with capacity 0
Jul 05 11:49:25 incognito[153078]: goroutine 1 [running]:
Jul 05 11:49:25 incognito[153078]: github.com/incognitochain/incognito-chain/blockchain.(*BeaconBestState).initBeaconBestState(0xc0001ab880, 0xc000397340, 0x1c60c00, 0xc00000e0a0, 0x0, 0x0)
Jul 05 11:49:25 incognito[153078]:         /home/incognito-service/incognito-chain/blockchain/beaconprocess.go:864 +0x122e
Jul 05 11:49:25 incognito[153078]: github.com/incognitochain/incognito-chain/blockchain.(*BlockChain).initBeaconState(0xc00017a000, 0x0, 0x0)
Jul 05 11:49:25 incognito[153078]:         /home/incognito-service/incognito-chain/blockchain/blockchain.go:292 +0xb4
Jul 05 11:49:25 incognito[153078]: github.com/incognitochain/incognito-chain/blockchain.(*BlockChain).initChainState(0xc00017a000, 0xc000d7cce0, 0xc0003967e9)
Jul 05 11:49:25 incognito[153078]:         /home/incognito-service/incognito-chain/blockchain/blockchain.go:192 +0xcbc
Jul 05 11:49:25 incognito[153078]: github.com/incognitochain/incognito-chain/blockchain.(*BlockChain).Init(0xc00017a000, 0xc0011bf718, 0xe, 0xc0001f28c0)
Jul 05 11:49:25 incognito[153078]:         /home/incognito-service/incognito-chain/blockchain/blockchain.go:148 +0xa0
Jul 05 11:49:25 incognito[153078]: main.(*Server).NewServer(0xc0010e05a0, 0xc00036da40, 0x5, 0x1c60c00, 0xc00000e0a0, 0x1c60b80, 0xc0000103f8, 0x29220e0, 0xc00036da90, 0xb, ...)
Jul 05 11:49:25 incognito[153078]:         /home/incognito-service/incognito-chain/server.go:328 +0x136d
Jul 05 11:49:25 incognito[153078]: main.mainMaster(0x0, 0x0, 0x0)
Jul 05 11:49:25 incognito[153078]:         /home/incognito-service/incognito-chain/incognito.go:160 +0xcda
Jul 05 11:49:25 incognito[153078]: main.main()
Jul 05 11:49:25 incognito[153078]:         /home/incognito-service/incognito-chain/incognito.go:230 +0x241
Jul 05 11:49:25 systemd[1]: incognito.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 05 11:49:25 systemd[1]: incognito.service: Failed with result 'exit-code'.

The only edit I made to the virgin incognito.conf file was to the RPC user credentials.
Can any one offer any suggestions as to what’s going wrong? @khanhj?

3 Likes

Hi @3ncrypt3d,

Make sure that you have the sample-config.conf and keylist.json in same folder with the incognito binary. Copy the keylist-mainnet.json to keylist.json (the default keylist.json is for testnet)

5 Likes

Thanks for the quick reply. I still have the same problem, though. :frowning:

incognito-chain]$ ls -lh incognito keylist.json sample-config.conf
-rwxrwxr-x. 1 incognito incognito  50M Jun 28 10:46 incognito
-rw-rw-r--. 1 incognito incognito 111K Jul  6 08:00 keylist.json
-rw-rw-r--. 1 incognito incognito  11K Apr 19 18:29 sample-config.conf
incognito-chain]$ diff keylist-mainnet.json keylist.json 
incognito-chain]$ 

Any other ideas?

I have no experience with this at all, but you define configfile as config.conf while it is listed as sample_config.conf in your listing.

If that is not the error maybe the missing slash in your configfile definition is.

1 Like

@Jamie the sample-config.conf contain default parameters if user does not include them in the command used to run incognito binary (see more below)

@3ncrypt3d, I suggest that you try this command first, to see if there is any error

thach@ns567925:~/jenkins/jenkins/workspace/BenchMark/BM_build_chain/inc_bin$ ls
CJN.log  incognito  keylist.json  sample-config.conf  data  logs               

thach@ns567925:~/jenkins/jenkins/workspace/BenchMark/BM_build_chain/inc_bin$ ./incognito --discoverpeersaddress "mainnet-bootnode.incognito.org:9330" --miningkey "your_validator_key" --testnet false --nodemode "auto" --datadir "data/CJN" --listen "0.0.0.0:9465" --externaladdress "0.0.0.0:9465" --norpcauth --rpclisten "0.0.0.0:9365" 2>&1 | tee CJN.log

then try with systemd later

3 Likes

Success! Thank-you, @khanhj!

2 Likes