hercules-ci / arion

Run docker-compose with help from Nix/NixOS
Apache License 2.0
667 stars 48 forks source link

Inaccurate error in arion exec when service does not exist #133

Open roberth opened 3 years ago

roberth commented 3 years ago

You must provide a command via service.defaultExec or on the command line.

Validate the service name first; only then proceed to the defaultExec logic.

Bonus points for giving the full path to service.defaultExec in the error message (when missing defaultExec is the actual problem).

zoechi commented 9 months ago

What causes arion ps not printing the service name? The name listed with arion ps does not work with arion exec. For example arion exec shows my_proj_webserver_1 or when I set container_name just webserver, but for arion exec it always requires my_proj_webserver_1

At least this worked at some point yesterday.

Today arion exec my_proj_webserver_1 sh jusr returns without any output or error message (besides the Add input 'flake-compat' ... 'nixpkgs') and with exit code 1

If I use the service name I get

❯ arion exec kanidm
warning: not writing modified lock file of flake 'path:/home/myuser/source/my_project/container':
• Added input 'flake-compat':
    'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33' (2023-10-04)
• Added input 'nixpkgs':
    'github:NixOS/nixpkgs/842d9d80cfd4560648c785f8a4e6f3b096790e19' (2024-01-17)
Error: no container with name or ID "b741cbc9de34d75fcadc891ecc56c69c32e8d43557d846d41243dbfcf5a3ba2e" found: no such container
arion: FatalError {fatalErrorMessage = "docker-compose failed with ExitFailure 125"}

Also there is no arion inspect to get details about running containers. Is there a way to make podman or podman compose show details about running containers? I tried, but only get empty output.