hercules-ci / arion

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

`arion up` fails with strange error #230

Open augustebaum opened 7 months ago

augustebaum commented 7 months ago

Hi,

I'm trying out arion by following the "first steps" section of the docs.

When I run arion up I get:

/nix/store/w5y9k69h754b17vd0jyzj5dzvgndc45r-docker-compose.yaml
Traceback (most recent call last):
  File "/nix/store/p0nvak45fpgjbva6banmwsc7pkdhwfz9-docker-compose-1.29.2/bin/.docker-compose-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/p0nvak45fpgjbva6banmwsc7pkdhwfz9-docker-compose-1.29.2/lib/python3.11/site-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/nix/store/p0nvak45fpgjbva6banmwsc7pkdhwfz9-docker-compose-1.29.2/lib/python3.11/site-packages/compose/cli/main.py", line 200, in perform_command
    project = project_from_options('.', options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/p0nvak45fpgjbva6banmwsc7pkdhwfz9-docker-compose-1.29.2/lib/python3.11/site-packages/compose/cli/command.py", line 60, in project_from_options
    return get_project(
           ^^^^^^^^^^^^
  File "/nix/store/p0nvak45fpgjbva6banmwsc7pkdhwfz9-docker-compose-1.29.2/lib/python3.11/site-packages/compose/cli/command.py", line 152, in get_project
    client = get_client(
             ^^^^^^^^^^^
  File "/nix/store/p0nvak45fpgjbva6banmwsc7pkdhwfz9-docker-compose-1.29.2/lib/python3.11/site-packages/compose/cli/docker_client.py", line 41, in get_client
    client = docker_client(
             ^^^^^^^^^^^^^^
  File "/nix/store/p0nvak45fpgjbva6banmwsc7pkdhwfz9-docker-compose-1.29.2/lib/python3.11/site-packages/compose/cli/docker_client.py", line 124, in docker_client
    kwargs = kwargs_from_env(environment=environment, ssl_version=tls_version)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: kwargs_from_env() got an unexpected keyword argument 'ssl_version'

Has anyone seen this before? Thanks in advance for any help; let me know if you need more information.


More details:

Contents of arion-pkgs.nix:

import <nixpkgs> { system = "x86_64-linux"; }

Contents of arion-compose.nix:


{ pkgs, ... }:
{
  project.name = "test";

  services.mariadb = {
    service.image = "mariadb:latest";
    service.hostname = "mariadb";
    service.restart = "always";
    service.volumes = ["/mariadbfiles:/var/lib/mysql"];
    service.env_file = [".mariadb.env"];
    service.networks = ["db_connect"];
  };
}
zoechi commented 7 months ago

The Python package to access Docker/Podman needs to be updated I think. ssl_version is a parameter that was removed in Docker 7 (from the top of my head) I switched back from unstable to 23.11. That fixed it for me for now.

roberth commented 7 months ago

This appears to be a problem with the docker compose package in Nixpkgs.

augustebaum commented 7 months ago

Indeed installing Arion with nix profile install nixpkgs/23.11#arion makes the issue disappear.

AkechiShiro commented 2 months ago

Hi @roberth,

I tried using arion but I ran into this error, I changed the derivation to use docker_compose v2 and it worked fine, should I make a PR to update the arion derivation ? Do you have any input regarding this way of fixing the issue ?

Currently arion uses docker_compose_1 version 1 and I believe it's why this error is happening.

KiaraGrouwstra commented 2 months ago

@AkechiShiro nice! would you have a branch with the fix maybe? i wouldn't mind using that ^^

AkechiShiro commented 2 months ago

@KiaraGrouwstra you can try and see if this branch fixes your issues, but I'm not entirely sure if that is a proper way to fix the issue that was reported here, I would most likely have to check with more knowledgeable people about arion I guess.

Let me know if it fixes your issues.

KiaraGrouwstra commented 2 months ago

@AkechiShiro yep, that works for me! if you open a PR there i'll add a review. :)

KiaraGrouwstra commented 1 month ago

@AkechiShiro in case you're busy i could try filing it there as well

KiaraGrouwstra commented 1 month ago

https://github.com/NixOS/nixpkgs/pull/325802

KiaraGrouwstra commented 1 month ago

closed in https://github.com/NixOS/nixpkgs/pull/325802 - thanks @AkechiShiro! :tada:

AkechiShiro commented 1 month ago

Thank you as well for the PR @KiaraGrouwstra