iotaledger / inx-chronicle

IOTA permanode implemented using the IOTA Node Extension (INX) interface.
Apache License 2.0
14 stars 13 forks source link

Attempt to subtract with overflow #1382

Open Alex6323 opened 5 months ago

Alex6323 commented 5 months ago

Bug description

I am running the iota-core docker-network (private tangle) and connect inx-chronicle to one of the validator nodes via INX. If I run without analytics, i.e. --disable-analytics, there's no issue, but if I turn on analytics then Chronicle crashes quickly and consistently.

Rust version

Chronicle version

Steps to reproduce the bug

  1. run a docker-network and expose the INX port of one of the nodes (e.g. validator node 1)
  2. build Chronicle on the 2.0 branch in debug mode (!!)
  3. make sure you have a working MongoDb and InfluxDb instance
  4. start Chronicle with correct mongodb conn string, influxdb url and inx url (don't disable analytics!)

Expected behaviour

Chronicle should not crash with analytics enabled.

Actual behaviour

It crashes every time.

Errors

2024-04-19T07:38:25.642056Z  INFO inx_chronicle: Connecting to database using hosts: `localhost:27017`.
2024-04-19T07:38:25.822234Z DEBUG inx_chronicle: Available databases: `["admin", "chronicle", "config", "local"]`
2024-04-19T07:38:25.826210Z  INFO inx_chronicle: Connected to database `chronicle` (57.5 MB)
2024-04-19T07:38:25.864129Z  INFO inx_chronicle: Connecting to influx at `http://localhost:8086`
2024-04-19T07:38:25.865251Z DEBUG reqwest::connect: starting new connection: http://localhost:8086/
2024-04-19T07:38:25.870354Z DEBUG reqwest::connect: starting new connection: http://localhost:8086/
2024-04-19T07:38:25.871494Z  INFO inx_chronicle: Connected to influx database `chronicle_analytics`
2024-04-19T07:38:25.871509Z  INFO inx_chronicle: Connected to influx database `chronicle_metrics`
2024-04-19T07:38:25.871623Z  INFO inx_chronicle::inx: Connecting to INX at bind address `http://localhost:9059`.
2024-04-19T07:38:25.873411Z  INFO inx_chronicle::inx: Connected to INX.
2024-04-19T07:38:25.876352Z DEBUG inx_chronicle::inx: The node has a pruning epoch index of `0` and a latest confirmed slot index of `3733`.
2024-04-19T07:38:25.877438Z DEBUG inx_chronicle::inx: Connected to network `docker-1713474996` with base token `Shimmer[SMR]`.
2024-04-19T07:38:25.886983Z DEBUG inx_chronicle::inx: Updating node configuration.
2024-04-19T07:38:25.893763Z DEBUG inx_chronicle::inx: Started listening to ledger updates via INX.
2024-04-19T07:38:25.944243Z ERROR handle_ledger_update{slot_index=3728 created=0 consumed=0}: inx_chronicle: panicked at /home/me/.cargo/git/checkouts/iota-sdk-43e451930a46536a/c104506/sdk/src/types/block/slot/index.rs:111:14:
attempt to subtract with overflow
2024-04-19T07:38:25.944565Z DEBUG handle_ledger_update{slot_index=3728 created=0 consumed=0}: inx_chronicle::inx: close time.busy=12.4ms time.idle=36.6ms
2024-04-19T07:38:26.030084Z  INFO inx_chronicle::api: Starting API server on port `8042`
2024-04-19T07:38:26.035241Z  INFO inx_chronicle: runtime stopped
DaughterOfMars commented 5 months ago

Yeahh, this is only a problem in debug mode but I have not been able to track it down. It's very mysterious.