availproject / avail

774 stars 538 forks source link

bug: invalid memory address or nil pointer dereference #670

Open askucher opened 1 month ago

askucher commented 1 month ago

Bug Report

Check the contributing guide

Description

Just followed these docs https://docs.availproject.org/docs/build-with-avail/Optimium/op-stack/op-stack

appid is created

Sending tx with account 5DS76r5TuT4y3KkCmZPjfveRD9S8SbUqs8kBzmZmMqXZUtNY. Create app id with name wmc-testnet
Transaction included in block: 0x12f4f75553d784459d55d68a8457e9987f2bb8dfc8134fbfedc9d2c3624e3a22
Transaction success. Your info is { "key": "wmc-testnet", "owner": "5DS76r5TuT4y3KkCmZPjfveRD9S8SbUqs8kBzmZmMqXZUtNY", "id": "106" }

./bin/avail-da-server ./cmd/avail --addr=localhost --port=8000 --avail.rpc=8001 --avail.seed="..." --avail.appid=106

t=2024-09-25T14:48:18+0000 lvl=crit msg="Application failed" message="flag addr is required"

without ./cmd/avail

./bin/avail-da-server --addr=localhost --port=8000 --avail.rpc=8001 --avail.seed="..." --avail.appid=106

8001 goddess panda cradle diagram regular blood right forward ordinary pond draw shrug 106 1m40s
INFO [09-25|14:46:06.600] Initializing Alt DA DA server...
INFO [09-25|14:46:06.600] Connecting to 8001...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0xc3246e]

goroutine 1 [running]:
avail-alt-da-server/types.NewAvailDASpecs({0x7ffd9fe265f9?, 0x0?}, 0x6a, {0x7ffd9fe2660b, 0x51}, 0x174876e800)
    /home/chain/op_stack_deployer-1/avail-alt-da-server/types/avail_block_ref.go:55 +0x8e
avail-alt-da-server/service.NewAvailService({0x7ffd9fe265f9, 0x4}, {0x7ffd9fe2660b, 0x51}, 0x6a, 0x174876e800)
    /home/chain/op_stack_deployer-1/avail-alt-da-server/service/avail_service.go:21 +0x45
main.StartDAServer(0xc0000ae180)
    /home/chain/op_stack_deployer-1/avail-alt-da-server/entrypoint.go:32 +0x2e5
github.com/urfave/cli/v2.(*Command).Run(0xc0000382c0, 0xc0000ae180, {0xc00013a000, 0x7, 0x7})
    /home/chain/go/pkg/mod/github.com/urfave/cli/v2@v2.27.4/command.go:276 +0x97d
github.com/urfave/cli/v2.(*App).RunContext(0xc0003fa000, {0x1048e50, 0xc0000ce0f0}, {0xc00013a000, 0x7, 0x7})
    /home/chain/go/pkg/mod/github.com/urfave/cli/v2@v2.27.4/app.go:333 +0x5a5
main.main()
    /home/chain/op_stack_deployer-1/avail-alt-da-server/main.go:30 +0x14b

Steps to Reproduce

  1. Try to read your own documentation and install a fresh new setup on new server
  2. See the same issue
RISHABHAGRAWALZRA commented 1 month ago

Hi, --avail-rpc is wrong, it should be an rpc URL

rac-sri commented 1 month ago

Also this issue can happen if the connection to the rpc itself fails. Can you try with a different RPC.

askucher commented 1 month ago

Honestly I thought that's port of itself.

Should I enter http://localhost:8001 ?

Also this issue can happen if the connection to the rpc itself fails. Can you try with a different RPC.

It did not get it. What rpc should I try ?