Skip to content

incompatible with podman-compose - alpine musl gethostbyname and gethostbyaddr only return single ip  #672

@coredump17

Description

@coredump17

Describe the bug

Podman 4 has DNS and 'should' be compatible withh docker. podman-compose up -d shows below error for containers configuration and autostarter.

File "core/autostarter.py", line 269, in core.autostarter.AutostarterWorker.check_and_control_services
File "/usr/local/lib/pyenv/versions/3.6.8/lib/python3.6/site-packages/artemis_utils/service.py", line 37, in service_to_ips_and_replicas_in_compose
replica_name = "{}-{}".format(base_service_name, replica_name_match.group(1))
AttributeError: 'NoneType' object has no attribute 'group'

upon investigation it would appear that this issue is caused by podman having multiple PTR records for an IP- container id, container name. alpine, which uses musl, only returns one host or IP per call which is unexpected, as you would only find one replica. PTR lookups would never match the container ID in podmans case as it has multiple entries - see below:

bash-4.4# dig +short configuration
10.89.0.97

bash-4.4# dig +short -x 10.89.0.97
artemis_configuration_1.
configuration.
5cf0e12b159a. <---- this will always be returned

The above PTR lookup will not match the below regex in 'service_to_ips_and_replicas_in_compose' call.

    r"^"
    + re.escape(COMPOSE_PROJECT_NAME)
    + r"[_|-]"
    + re.escape(base_service_name)
    + r"[_|-](\d+)",
    replica_host_by_addr,
  )

If dns calls using the socket module only return one value every time, i believe this would limit the platform to one replica.

Affected Component(s)

  • Back-End (configuration, autostarter)

To Reproduce
Steps to reproduce the behavior:

  1. centos/rocky/redhat/alma OS 8+
  2. yum install podman
  3. enable epel repo
  4. yum install podman compose
  5. ** pull repo, cd artimis ; podman-compose up -d
  6. ui starts but admin/system page errors
  7. podman logs configuration or podman logs autostarter show error

Expected behavior
i would expect a DNS lookup to respond with all entries not just the last one. i believe this would impact the replica set if wishh to run > 1 container of the same kind. It also caused the solution to be incompatible with podman.

Screenshots
File "core/autostarter.py", line 269, in core.autostarter.AutostarterWorker.check_and_control_services
File "/usr/local/lib/pyenv/versions/3.6.8/lib/python3.6/site-packages/artemis_utils/service.py", line 37, in service_to_ips_and_replicas_in_compose
replica_name = "{}-{}".format(base_service_name, replica_name_match.group(1))
AttributeError: 'NoneType' object has no attribute 'group'

System (please complete the following information):

  • OS: rocky 9
  • Browser chrome/ edge

Additional context
alpine uses musl which acts differently to glibc and appears to only return one dns entry per lookup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions