Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose v1 fails to bring up any compose file with podman v5.0 #306398

Closed
lunik1 opened this issue Apr 23, 2024 · 3 comments · Fixed by #310182
Closed

docker-compose v1 fails to bring up any compose file with podman v5.0 #306398

lunik1 opened this issue Apr 23, 2024 · 3 comments · Fixed by #310182
Labels
0.kind: bug Something is broken

Comments

@lunik1
Copy link
Contributor

lunik1 commented Apr 23, 2024

Describe the bug

docekr-compose up v1 fails with

ERROR: runtime error: index out of range [0] with length 0

with even the trivial docker-compose.yaml

version: '3.4'

when using podman v5.0 as the OCI container backend.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Use podman 5.0
  2. Run docker-compose up with a valid docker-compose.yaml using docker-compose_1

Expected behavior

docker-compose should bring up services specified in the compose file.

Additional context

arion still uses docker-compose_1 under the hood, so affects deployments using it.

hercules-ci/arion#237

Notify maintainers

@Frostman
@NixOS/podman

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
output here

Add a 👍 reaction to issues you find important.

@lunik1 lunik1 added the 0.kind: bug Something is broken label Apr 23, 2024
@kevincox
Copy link
Contributor

I am seeing something similar for GitLab runner. Reverting podman to <5 works around the problem.

ERROR: Failed to remove network for build
ERROR: Preparation failed: Error response from daemon: runtime error: index out of range [0] with length 0 (docker.go:935:0s)

@heitorPB
Copy link
Contributor

heitorPB commented May 8, 2024

Reported upstream: containers/podman#22561

/~https://github.com/NixOS/nixpkgs/blob/23f69f50f72ae19d7bbc7271abe30d8bc859207f/pkgs/applications/virtualization/podman/hardcode-paths.patch may be the cause of this bug.

@the-sun-will-rise-tomorrow
Copy link
Contributor

the-sun-will-rise-tomorrow commented May 8, 2024

How to reproduce this problem? If I try to use docker-compose_1, the command crashes due to https://stackoverflow.com/questions/77641240/getting-docker-compose-typeerror-kwargs-from-env-got-an-unexpected-keyword-ar.

[~/nixpkgs]$ nix-shell -I nixpkgs=. -p podman -p docker-compose_1 --pure

[nix-shell:~/nixpkgs]$ docker-compose up
ERROR: Top level object in './docker-compose.yaml' needs to be an object not '<class 'NoneType'>'.

[nix-shell:~/nixpkgs]$ echo "version: '3.4'" > docker-compose.yaml

[nix-shell:~/nixpkgs]$ docker-compose up
Traceback (most recent call last):
  File "/nix/store/ryfm1jy98zr3k7a6ym7acc4nck7bia7v-docker-compose-1.29.2/bin/.docker-compose-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/ryfm1jy98zr3k7a6ym7acc4nck7bia7v-docker-compose-1.29.2/lib/python3.11/site-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/nix/store/ryfm1jy98zr3k7a6ym7acc4nck7bia7v-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/ryfm1jy98zr3k7a6ym7acc4nck7bia7v-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/ryfm1jy98zr3k7a6ym7acc4nck7bia7v-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/ryfm1jy98zr3k7a6ym7acc4nck7bia7v-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/ryfm1jy98zr3k7a6ym7acc4nck7bia7v-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'

[nix-shell:~/nixpkgs]$ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants