IntersectMBO / cardano-node

The core component that is used to participate in a Cardano decentralised blockchain.
https://cardano.org
Apache License 2.0
3.05k stars 721 forks source link

[BUG] - cardano-testnet - genesis.json: renameFile:renamePath:rename: does not exist (No such file or directory) #5795

Open koslambrou opened 4 months ago

koslambrou commented 4 months ago

Internal/External Internal if an IOHK staff member.

Area Other cardano-testnet

Summary Trying to use the cardano-testnet package. However, running the testnet gives the following error:

$ cardano-testnet cardano --testnet-magic 4
  ✗ <interactive> failed at src/Testnet/Components/Configuration.hs:166:3
    after 1 test.
    shrink path: 1:

    forAll0 =
      Renaming from "/tmp/testnet-test-a0e3936a94e31543/genesis.json" to "/tmp/testnet-test-a0e3936a94e31543/shelley/genesis.shelley.json"

    forAll1 =
      Renaming from "/tmp/testnet-test-a0e3936a94e31543/byron-gen-command/genesis.json" to "/tmp/testnet-test-a0e3936a94e31543/byron/genesis.json"

    forAll2 =
      "/tmp/testnet-test-a0e3936a94e31543/shelley/genesis.conway.json"

    forAll3 =
      "/tmp/testnet-test-a0e3936a94e31543/shelley/genesis.alonzo.json"

    forAll4 =
      shelley

    forAll5 =
      byron

    forAll6 =
      shelley-genesis.json

    forAll7 =
      module

    forAll8 =
      stake-delegators

    forAll9 =
      genesis.alonzo.spec.json

    forAll10 =
      delegate-keys

    forAll11 =
      genesis.conway.spec.json

    forAll12 =
      drep-keys

    forAll13 =
      genesis-keys

    forAll14 =
      alonzo-genesis.json

    forAll15 =
      pools-keys

    forAll16 =
      conway-genesis.json

    forAll17 =
      utxo-keys

    forAll18 =
      byron-gen-command

    forAll19 =
      byron.genesis.spec.json

    forAll20 =
      Listing directory: /tmp/testnet-test-a0e3936a94e31543/

    forAll21 =
      Creating directory if missing: /tmp/testnet-test-a0e3936a94e31543/byron

    forAll22 =
      ━━━━ command ━━━━
      /nix/store/55f0rxkzmjwjq0ikz97lk57jw2nbz0vg-cardano-cli-exe-cardano-cli-8.22.0.0/bin/cardano-cli babbage genesis create-testnet-data --spec-shelley /tmp/testnet-test-a0e3936a94e31543/shelley/genesis.shelley.json --testnet-magic 4 --pools 3 --total-supply 2000000000000 --delegated-supply 1000000000000 --s
take-delegators 3 --utxo-keys 3 --drep-keys 3 --start-time 2024-04-22T12:02:38Z --out-dir /tmp/testnet-test-a0e3936a94e31543/

    forAll23 =
      Number of seeded UTxO keys: 3

    forAll24 =
      Number of stake delegators: 3

    forAll25 =
      Number of pools: 3

    forAll26 =
      Writing file: /tmp/testnet-test-a0e3936a94e31543/shelley/genesis.shelley.json

    forAll27 =
      Reading file: /tmp/testnet-test-a0e3936a94e31543/shelley/genesis.shelley.json

    forAll28 =
      Rewriting JSON file: /tmp/testnet-test-a0e3936a94e31543/shelley/genesis.shelley.json

    forAll29 =
      Creating directory if missing: /tmp/testnet-test-a0e3936a94e31543/shelley

    forAll30 =
      "/tmp/testnet-test-a0e3936a94e31543/configuration.yaml"

    forAll31 =
      "/tmp/testnet-test-a0e3936a94e31543/genesis.conway.spec.json"

    forAll32 =
      "/tmp/testnet-test-a0e3936a94e31543/genesis.alonzo.spec.json"

    forAll33 =
      ━━━━ command ━━━━
      /nix/store/55f0rxkzmjwjq0ikz97lk57jw2nbz0vg-cardano-cli-exe-cardano-cli-8.22.0.0/bin/cardano-cli byron genesis genesis --protocol-magic 4 --start-time 1713787358 --k 10 --n-poor-addresses 0 --n-delegate-addresses 3 --total-balance 8000000000000001 --delegate-share 1 --avvm-entry-count 0 --avvm-entry-bala
nce 0 --avvm-balance-factor 1 --protocol-parameters-file /tmp/testnet-test-a0e3936a94e31543/byron.genesis.spec.json --genesis-output-dir /tmp/testnet-test-a0e3936a94e31543/byron-gen-command

    forAll34 =
      Writing file: /tmp/testnet-test-a0e3936a94e31543/byron.genesis.spec.json

    forAll35 =
      linux

    forAll36 =
      2024-04-22 12:02:38.859231927 UTC

    forAll37 =
      2024-04-22 12:02:23.859231927 UTC

    forAll38 =
      /tmp/testnet-test-a0e3936a94e31543

    forAll39 =
      Workspace: /tmp/testnet-test-a0e3936a94e31543

    ━━━ Exception (IOException) ━━━
    /tmp/testnet-test-a0e3936a94e31543/genesis.json: renameFile:renamePath:rename: does not exist (No such file or directory)

    This failure can be reproduced by running:
    > recheckAt (Seed 6284812244979610659 9929105761415290809) "1:" <property>

flake.nix

  inputs = {

    cardano-node = {
      url = "github:input-output-hk/cardano-node?ref=8.9.2";
    };

    cardano-cli = {
      url = "github:intersectmbo/cardano-cli?ref=cardano-cli-8.22.0.0";
    };
  };

shell.nix

let
  cardano-cli = inputs.cardano-cli.legacyPackages.cardano-cli;
  cardano-node = inputs.cardano-node.packages.cardano-node;
  cardano-testnet = inputs.cardano-node.packages.cardano-testnet;
in
{
  name = "nix-shell";

  packages = [
    cardano-cli
    cardano-node
    cardano-testnet
  ];

  env = {
    CARDANO_CLI = "${cardano-cli}/bin/cardano-cli";
    CARDANO_NODE = "${cardano-node}/bin/cardano-node";
  };

Expected behavior I should get a successful running testnet as detailed in the docs: https://github.com/input-output-hk/cardano-node-wiki/wiki/launching-a-testnet Although the docs seem out of date, thus need to be updated.

System info (please complete the following information):

$ cardano-node --version
cardano-node 8.9.2 - linux-x86_64 - ghc-8.10
git rev 424983fa186786397f5a99539f51710abf62c37b
$ cardano-cli --version
cardano-cli 8.22.0.0 - linux-x86_64 - ghc-9.6
git rev 0000000000000000000000000000000000000000
carbolymer commented 4 months ago

Can you use latest master or do you require to run latest mainnet node version? There were some tweaks and fixes to the testnet since 8.9.2.

koslambrou commented 4 months ago

As a user wanting to e2e test my Cardano DApp, I want both capabilities.

I want to test on a node which is essentially the same as the one used on mainnet so that I can be confident that by DApp will function correctly.

I also want to test on a node which represents the next version so that I can start preparing for the next release, and fix any issue. This will allow updating my DApp much earlier in the process.

Does that make sense?

carbolymer commented 4 months ago

Can you try to use cardano-cli-8.20.3 instead? 8.22 is not a release for mainnet.

koslambrou commented 4 months ago

Thanks @carbolymer. Seems like using an incompatible cardano-cli version was the issue. I can enter the shell just fine now.

Is there some documentation somewhere outline which versions of cardano-cli are compatible with which versions of cardano-node? I think something similar would be needed for cardano-api.

carbolymer commented 4 months ago

If you go to the node release page https://github.com/IntersectMBO/cardano-node/releases/tag/8.9.2 then in the Changelogs section in Individual packages' changelogs subsection you can find the versions of the compatible dependencies.

There's also compatibility matrix: https://docs.cardano.org/release-notes/comp-matrix - but CLI is not included there (yet).

koslambrou commented 4 months ago

Nice! Thanks for those links.

What do you think of putting the compatibility matrix in cardano-node README for better visibility? Or maybe mention in the README for the user to take a look at the release notes for the compatibility matrix?

Additionally, how did you know I had to use cardano-cli-8.20.3 when the release page points to cardano-cli-8.16.0.1?

carbolymer commented 4 months ago

What do you think of putting the compatibility matrix in cardano-node README for better visibility? Or maybe mention in the README for the user to take a look at the release notes for the compatibility matrix?

Yeah, that's a good idea. We should do that.

Additionally, how did you know I had to use cardano-cli-8.20.3 when the release page points to cardano-cli-8.16.0.1?

Where does it mention 8.16.0.1? image

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.