paritytech / zombienet

A cli tool to easily spawn ephemeral Polkadot/Substrate networks and perform tests against them.
https://paritytech.github.io/zombienet/
GNU General Public License v3.0
157 stars 92 forks source link

Error: ENOENT: no such file or directory, copyfile '/tmp/zombie-.../temp-collator-1/cfg/genesis-state-1002 #1666

Closed forgetso closed 3 months ago

forgetso commented 8 months ago

Issue Description

Zombienet fails to copy the genesis state file between two directories and therefore fails to start

npx --yes @zombienet/cli@1.3.86 --provider podman spawn e2e/zombienet.native.toml

╔════════════════════╤════════════════════════════════════════════════════════════════════════════════════════════════════╗
║ 🧟 Zombienet 🧟    │ Initiation                                                                                         ║
╟────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────╢
║ Provider           │ podman                                                                                             ║
╟────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────╢
║ Namespace          │ zombie-96221c68                                                                                    ║
╟────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────╢
║ Temp Dir           │ /tmp/zombie-96221c68_-680032-bm3ztzjZBlFz                                                          ║
╚════════════════════╧════════════════════════════════════════════════════════════════════════════════════════════════════╝

     Monitor: prometheus - url: http://127.0.0.1:44263

     Monitor: tempo - url: http://127.0.0.1:44099

     Monitor: grafana - url: http://127.0.0.1:33765
Warning: port 43267 already used, retrying
┌─────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                     │ temp-1                                                                                             │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status                  │ Launching                                                                                          │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Command                 │ bash -c polkadot-parachain --help                                                                  │
└─────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                     │ temp                                                                                               │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status                  │ Launching                                                                                          │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Command                 │ bash -c /usr/bin/polkadot --help                                                                   │
└─────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                │ temp-1                                                                                             │
├────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status             │ Ready                                                                                              │
└────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                │ temp                                                                                               │
├────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status             │ Ready                                                                                              │
└────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                     │ temp-2                                                                                             │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status                  │ Launching                                                                                          │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Command                 │ bash -c /usr/bin/polkadot build-spec --chain rococo-local --disable-default-bootnode > /cfg/rococ… │
└─────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                │ temp-2                                                                                             │
├────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status             │ Ready                                                                                              │
└────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                     │ temp-3                                                                                             │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status                  │ Launching                                                                                          │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Command                 │ bash -c polkadot-parachain build-spec  --disable-default-bootnode > /cfg/undefined-plain.json      │
└─────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                     │ temp-4                                                                                             │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status                  │ Launching                                                                                          │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Command                 │ bash -c polkadot-parachain build-spec  --disable-default-bootnode > /cfg/undefined-plain.json      │
└─────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                │ temp-3                                                                                             │
├────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status             │ Ready                                                                                              │
└────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ 🧹 Starting with a fresh authority set...                                                                              │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────┬────────────────────┬──────────────────────────────────────────────────────────────────────┐
│ 👤 Added Genesis Authority   │ alice-1            │ 5H3ZQYaba5Lpw6xRBbnwW4fNcpYaCosGJfetZEuxtGQgB2Ft                     │
└──────────────────────────────┴────────────────────┴──────────────────────────────────────────────────────────────────────┘
┌────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                │ temp-4                                                                                             │
├────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status             │ Ready                                                                                              │
└────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                     │ temp-5                                                                                             │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status                  │ Launching                                                                                          │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Command                 │ bash -c polkadot-parachain build-spec  --disable-default-bootnode --chain /cfg/1000-rococo-local-… │
└─────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ 🧹 Starting with a fresh authority set...                                                                              │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────┬────────────────────┬──────────────────────────────────────────────────────────────────────┐
│ 👤 Added Genesis Authority   │ contracts          │ 5DPHUr7UT8YVofdR7hiRkQVyxGShDHctdFXC7r6inCq6Py1w                     │
└──────────────────────────────┴────────────────────┴──────────────────────────────────────────────────────────────────────┘
┌─────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                     │ temp-6                                                                                             │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status                  │ Launching                                                                                          │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Command                 │ bash -c polkadot-parachain build-spec  --disable-default-bootnode --chain /cfg/1002-rococo-local-… │
└─────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                │ temp-5                                                                                             │
├────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status             │ Ready                                                                                              │
└────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                │ temp-6                                                                                             │
├────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status             │ Ready                                                                                              │
└────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                     │ temp-collator                                                                                      │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status                  │ Launching                                                                                          │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Command                 │ bash -c polkadot-parachain export-genesis-state --chain /cfg/1000-rococo-local.json /              │
│                         │ cfg/genesis-state-1000 && polkadot-parachain export-genesis-wasm --chain /cfg/1000-rococo-         │
│                         │ local.json /cfg/genesis-wasm-1000 && until [ -f /tmp/finished.txt ]; do echo waiting for c         │
│                         │ opy files to finish; sleep 1; done; echo copy files has finished                                   │
└─────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                     │ temp-collator-1                                                                                    │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status                  │ Launching                                                                                          │
├─────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Command                 │ bash -c polkadot-parachain export-genesis-state --chain /cfg/1002-rococo-local.json /              │
│                         │ cfg/genesis-state-1002 && polkadot-parachain export-genesis-wasm --chain /cfg/1002-rococo-         │
│                         │ local.json /cfg/genesis-wasm-1002 && until [ -f /tmp/finished.txt ]; do echo waiting for c         │
│                         │ opy files to finish; sleep 1; done; echo copy files has finished                                   │
└─────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                │ temp-collator-1                                                                                    │
├────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status             │ Ready                                                                                              │
└────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
Error:       Error: ENOENT: no such file or directory, copyfile '/tmp/zombie-96221c68_-680032-bm3ztzjZBlFz/temp-collator-1/cfg/genesis-state-1002' -> '/tmp/zombie-96221c68_-680032-bm3ztzjZBlFz/1002/genesis-state'

undefined
┌────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Node'              │ /tmp/zombie-96221c68_-680032-bm3ztzjZBlFz/logs                                                     │
│ s logs:            │                                                                                                    │
│ m                  │                                                                                                    │
└────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Pod                │ temp-collator                                                                                      │
├────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status             │ Ready                                                                                              │
└────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘

Steps to reproduce the issue

Steps to reproduce the issue

  1. Create the zombiefile TOML
[relaychain]
default_image = "docker.io/parity/polkadot:v1.0.0"
default_command = "/usr/bin/polkadot"
default_args = [ "-lparachain=debug" ]

chain = "rococo-local"

  [[relaychain.nodes]]
  name = "alice"
  validator = true
  ws_port = 9933

  [[relaychain.nodes]]
  name = "bob"
  validator = true

[[parachains]]
id = 1000

  [parachains.collator]
  name = "alice"
  rpc_port = 9934
  image = "docker.io/parity/polkadot-parachain:1.0.0"
  command = "polkadot-parachain"
  args = ["-lparachain=debug"]

[[parachains]]
id = 1002

  [parachains.collator]
  name = "contracts"
  rpc_port = 9988
  image = "docker.io/parity/polkadot-parachain:1.0.0"
  command = "polkadot-parachain"
  args = ["-lparachain=debug", "--discover-local"]
  chain = "contracts-rococo-dev"
  1. Run the zombienet command
    npx --yes @zombienet/cli@1.3.86 --provider podman spawn zombienet.native.toml

Describe the results you received

The process fails

Describe the results you expected

I expect the process to succeed

Zombienet version

@zombienet/cli@1.3.86

Provider

Podman

Provider version

## For binaries
polkadot docker.io/parity/polkadot:v1.0.0
polkadot-parachain docker.io/parity/polkadot-parachain:1.0.0

## For Kubernetes/Podman
podman version
Version:      3.4.4
API Version:  3.4.4
Go Version:   go1.17.3
Built:        Thu Jan  1 01:00:00 1970
OS/Arch:      linux/amd64

Upstream Latest Release

No

Additional environment details

OS: Linux 6.2.0-36-generic #37~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 9 15:34:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Additional information

The file that is being copied does exist

ls /tmp/zombie-96221c68_-680032-bm3ztzjZBlFz/temp-collator-1/cfg/genesis-state-1002
/tmp/zombie-96221c68_-680032-bm3ztzjZBlFz/temp-collator-1/cfg/genesis-state-1002

Screenshots

No response

pepoviola commented 3 months ago

Hi @forgetso, sorry about the delay. This looks like a race condition, can you try with the latest version and if the issue continue re-open please. Also, worth mention that we are adding better support for podman/docker in the new version of zombienet (zombienet-sdk).

Thanks!