Skip to content

docker helper: version not being obtained #359

@dfdan

Description

@dfdan

Package version (if known): 1.1.0

Describe the bug

With docker 20.10 / docker-compose 1.25.0 (ubuntu 20.04) the docker helper is trying to run 'docker compose' but this command isn't available. It should still be docker-compose in this case.

This causes docker not to be able to start services etc when the helper fails here:

dc_version = groups.group(0)

Steps to Reproduce

Bootstrap instance with Docker 20.10 (as packaged in Ubuntu 20.04), bootstrap an instance of ~12 and try to start services.

Expected behavior

services should start

Screenshots (if applicable)

(rdm12a) dan@id23:~/test2/rdm12a$ invenio-cli services setup
Traceback (most recent call last):
  File "/home/dan/.venv/rdm12a/bin/invenio-cli", line 33, in <module>
    sys.exit(load_entry_point('invenio-cli', 'console_scripts', 'invenio-cli')())
  File "/home/dan/.venv/rdm12a/lib/python3.8/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/dan/.venv/rdm12a/lib/python3.8/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/dan/.venv/rdm12a/lib/python3.8/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/dan/.venv/rdm12a/lib/python3.8/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/dan/.venv/rdm12a/lib/python3.8/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/dan/.venv/rdm12a/lib/python3.8/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/dan/.venv/rdm12a/lib/python3.8/site-packages/click/decorators.py", line 92, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/dan/.venv/rdm12a/lib/python3.8/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/dan/test2/invenio-cli/invenio_cli/cli/services.py", line 65, in setup
    commands = ServicesCommands(cli_config)
  File "/home/dan/test2/invenio-cli/invenio_cli/commands/services.py", line 29, in __init__
    self.docker_helper = docker_helper or DockerHelper(
  File "/home/dan/test2/invenio-cli/invenio_cli/helpers/docker_helper.py", line 29, in __init__
    self.container_prefix = self._normalize_name(project_shortname)
  File "/home/dan/test2/invenio-cli/invenio_cli/helpers/docker_helper.py", line 41, in _normalize_name
    dc_version = groups.group(0)
AttributeError: 'NoneType' object has no attribute 'group'

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions