abracadaniel / cardano-pool-docker

Docker container for setting up and running a Cardano Stake Pool
164 stars 62 forks source link

Relay's topology.json is generated with JSON syntax error #16

Closed robinboening closed 3 years ago

robinboening commented 3 years ago

Starting the container throws this JSON parse error:

parse error: Expected separator between
values at line 1, column 225

I start the cardano node on the relay host with -e NODE_TOPOLOGY="xx.xxx.x.x:3000/1". The resulting topology.json file looks like this

$ root@cardano-relay-01:~# cat config/main-relay-01/topology.json
{
  ...,
  "Producers": [
    { "addr": "xx.xxx.x.x", "port": 3000, "valency": 1 }  { "addr": "relays-new.cardano-mainnet.iohk.io", "port": 3001, "valency": 2, "debug":"default fallback result" }
  ]
}

You can see its missing the comma inbetween the items in the array.

I looked up the place in the code where the NODE_TOPOLOGY is processed but it looks fine to me. I wasn't able to reproduce the issue by extracting and running the related code snippets.

The code in question is here: https://github.com/abracadaniel/cardano-node-docker/blob/master/scripts/init_config.py#L132

Any idea?

robinboening commented 3 years ago

It turned out the init_config.py was a red herring. The bug is in the auto updater. I started the node with AUTO_TOPOLOGY="False" and the topology.json looks correct now.

I'll have a look into the updater.

robinboening commented 3 years ago

The bug is in this API https://api.clio.one/htopology/v1 as it returns the wrong JSON:

https://api.clio.one/htopology/v1/fetch/?max=14&magic=123456789&customPeers=0.0.0.0:3000:1

robinboening commented 3 years ago

I reported the bug at the guild-operators repo and it got fixed very quickly.

https://github.com/cardano-community/guild-operators/issues/784

Closing this issue.

abracadaniel commented 3 years ago

Really awesome you got this fixed! And thanks a lot for your contributions, its super great! :)