Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - cardano-node shows misleading error when using strings for port/valency in topology.json #1446

Closed
rcmorano opened this issue Jul 13, 2020 · 0 comments · Fixed by #1634
Assignees
Labels
bug Something isn't working minorfix Something that needs to be fixed (e.g. a hard-coded constant), but that isnt a bug
Milestone

Comments

@rcmorano
Copy link

Internal/Exernal

External

Summary

If you happen to format your topology.json using strings instead of integers for peers' port or valency (or both :), you end up receiving this misleading error saying something is empty:
{fatalErrorMessage = "Cardano.Node.Run.readTopologyFile: Error in $: empty"}

This problem has led some people to walk around in circles for hours.

Steps to reproduce

See screenshots/attachments.

Expected behavior

cardano-node should cast these values to integer or report some non-misleading message.

System info (please complete the following information):

  • OS: Ubuntu
  • Version: 20.04
  • Node version: binary build from hydra:
root@passive-node-0:/# cardano-node --version
cardano-node 1.15.1 - linux-x86_64 - ghc-8.6
git rev 712a287602797e8fd889fbf73e56a08c3d8b004a
root@passive-node-0:/# 

Screenshots and attachments

root@passive-node-0:/# cat /opt/cardano/cnode/files/topology.json.bad
{
  "Producers": [
    {
      "addr": "relays-new.mainnet-candidate.dev.cardano.org",
      "port": "3001",
      "valency": 3
    }
  ]
}
root@passive-node-0:/# cardano-node run --config /opt/cardano/cnode/files/configuration.yaml --database-path /opt/cardano/cnode/db --host-addr 0.0.0.0 --port 31111 --topology /opt/cardano/cnode/files/topology.json.bad; echo
{"at":"2020-07-13T17:28:08.63Z","env":"1.15.1:712a2","ns":["cardano.#ekgview.realizeFrom"],"data":{"kind":"LogError","message":"EKGView backend disabled due to initialisation error: EKGServerStartupError \"Network.Socket.bind: resource busy (Address in use)\""},"app":[],"msg":"","pid":"120","loc":null,"host":"","sev":"Error","thread":"5"}

cardano-node: FatalError {fatalErrorMessage = "Cardano.Node.Run.readTopologyFile: Error in $: empty"}
root@passive-node-0:/# 

Additional context

Removing quotes from the topology so port/valency is taken as an integer fixes the problem.

@rcmorano rcmorano added the bug Something isn't working label Jul 13, 2020
@kevinhammond kevinhammond added the minorfix Something that needs to be fixed (e.g. a hard-coded constant), but that isnt a bug label Jul 15, 2020
@kevinhammond kevinhammond added this to To do in CLI Revision via automation Jul 15, 2020
@kevinhammond kevinhammond added this to the Backlog milestone Jul 15, 2020
@Jimbo4350 Jimbo4350 linked a pull request Aug 4, 2020 that will close this issue
iohk-bors bot added a commit that referenced this issue Aug 11, 2020
1634: Improve json topology parsing errors r=erikd a=Jimbo4350

Relevant issue: #1446

Co-authored-by: Jordan Millar <jordan.millar@iohk.io>
@iohk-bors iohk-bors bot closed this as completed in #1634 Aug 11, 2020
CLI Revision automation moved this from To do to Done Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working minorfix Something that needs to be fixed (e.g. a hard-coded constant), but that isnt a bug
Projects
No open projects
CLI Revision
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants