axelarnetwork / support

Your source for support with the Axelar Network
3 stars 1 forks source link

axelar-examples: Error when starting examples with cosmos enabled #135

Closed bizzyvinci closed 2 months ago

bizzyvinci commented 3 months ago

After setting cosmos to true in config/default.json according to the README

npm run start results in an error

Error: spawn docker-compose ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn docker-compose',
  path: 'docker-compose',
  spawnargs: [ 'ps' ]
}
Error: spawn docker-compose ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn docker-compose',
  path: 'docker-compose',
  spawnargs: [ 'ps' ]
}
Error: Docker is not running. Please start Docker and try again.
    at DockerService.<anonymous> (PWD/node_modules/@axelar-network/axelar-local-dev-cosmos/dist/services/DockerService.js:194:23)
    at Generator.next (<anonymous>)
    at fulfilled (PWD/node_modules/@axelar-network/axelar-local-dev-cosmos/dist/services/DockerService.js:5:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
PWD/node_modules/@axelar-network/axelar-local-dev-cosmos/dist/utils.js:104
            throw new Error(`File not found at path: ${path}`);
                  ^

Error: File not found at path: PWD/node_modules/@axelar-network/axelar-local-dev-cosmos/docker/wasm/.wasm/mnemonic.txt
    at readFileSync (PWD/node_modules/@axelar-network/axelar-local-dev-cosmos/dist/utils.js:104:19)
    at PWD/node_modules/@axelar-network/axelar-local-dev-cosmos/dist/utils.js:60:26
    at Generator.next (<anonymous>)
    at PWD/node_modules/@axelar-network/axelar-local-dev-cosmos/dist/utils.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (PWD/node_modules/@axelar-network/axelar-local-dev-cosmos/dist/utils.js:4:12)
    at exportOwnerAccountFromContainer (PWD/node_modules/@axelar-network/axelar-local-dev-cosmos/dist/utils.js:58:12)
    at CosmosClient.<anonymous> (PWD/node_modules/@axelar-network/axelar-local-dev-cosmos/dist/clients/cosmos/CosmosClient.js:51:84)
    at Generator.next (<anonymous>)
    at PWD/node_modules/@axelar-network/axelar-local-dev-cosmos/dist/clients/cosmos/CosmosClient.js:8:71

PWD: is the working directory which is the cloned axelar-example repo And traefik container is running in docker desktop

Olanetsoft commented 3 months ago

Hello @bizzyvinci, do you have Docker deamon running in the background ? What's your OS?

bizzyvinci commented 3 months ago

Yes, docker daemon is running and the OS is MacOS (M1). But I got the same error in Kali-Linux.

bizzyvinci commented 3 months ago

When the daemon is not running, I'll get

{
  exitCode: 1,
  err: 'time="2024-08-11T13:44:44+01:00" level=warning msg="PWD/node_modules/@axelar-network/axelar-local-dev-cosmos/docker/traefik/docker-compose.yaml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion"\n' +
    'Cannot connect to the Docker daemon at unix:///Users/user/.docker/run/docker.sock. Is the docker daemon running?\n',
  out: ''
}
PWD/node_modules/@axelar-network/axelar-local-dev-cosmos/dist/utils.js:104
            throw new Error(`File not found at path: ${path}`);
                  ^
bizzyvinci commented 3 months ago

The issue is that the repo works with docker compose V1, and not V2. This answer about installing V1 worked

V1: docker-compose ps V2: docker compose ps

Just using alias docker-compose="docker compose" does not work.

Olanetsoft commented 2 months ago

The issue is that the repo works with docker compose V1, and not V2. This answer about installing V1 worked

V1: docker-compose ps V2: docker compose ps

Just using alias docker-compose="docker compose" does not work.

Got it. Thanks for flagging this. We currently use v1 and periodically update the dependencies, which we will consider adding this update as well. cc: @npty