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

[BUG] Glusterfs peered doesn't understand loopback IP as localhost #62273

Closed
rmsc opened this issue Jul 4, 2022 · 1 comment · Fixed by #62274
Closed

[BUG] Glusterfs peered doesn't understand loopback IP as localhost #62273

rmsc opened this issue Jul 4, 2022 · 1 comment · Fixed by #62274
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@rmsc
Copy link
Contributor

rmsc commented Jul 4, 2022

Description
In some situations, glusterfs.peered fails to detect a peer as being localhost.

More concretely, in some cases salt.utils.network.host_to_ips(name) may return an address like 127.0.1.1. This happens for instance if the host name is associated to a loopback address in /etc/hosts.

This loopback address obviously never matches the addresses returned by salt.utils.network.ip_addrs() or salt.utils.network.ip_addrs6(), hence localhost detection fails.

Setup

# salt 'minion1' cmd.run 'cat /etc/hosts'
minion1:
    # Static table lookup for hostnames.
    # See hosts(5) for details.
    127.0.1.1 minion1 minion1
$ cat glusterfs.sls
Add gluster peers:
  glusterfs.peered:
    - names:
      - minion1
      - minion2

Moreover, the minions must have glusterd installed and running.

Steps to Reproduce the behavior

# salt 'minion1' state.apply glusterfs
(...)
          ID: Add gluster peers
    Function: glusterfs.peered
        Name: minion1
      Result: False
     Comment: Host minion1 was successfully peered but did not appear in the list of peers
     Started: (...)
    Duration: (...)
     Changes:
----------
          ID: Add gluster peers
    Function: glusterfs.peered
        Name: minion2
      Result: True
     Comment: Host minion2 already peered
     Started: (...)
    Duration: (...)
     Changes:
(...)

Expected behavior

Peering minion1 shouldn't fail, and instead the comment should have been "Peering with localhost is not needed".

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3004.2

Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: Not Installed
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
      M2Crypto: 0.38.0
          Mako: Not Installed
       msgpack: 1.0.3
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: 3.12.0
        pygit2: Not Installed
        Python: 3.10.5 (main, Jun  6 2022, 18:49:26) [GCC 12.1.0]
  python-gnupg: Not Installed
        PyYAML: 6.0
         PyZMQ: 23.2.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: arch
        locale: utf-8
       machine: x86_64
       release: 5.18.7-arch1-1
        system: Linux
       version: Arch Linux
@rmsc rmsc added Bug broken, incorrect, or confusing behavior needs-triage labels Jul 4, 2022
@welcome
Copy link

welcome bot commented Jul 4, 2022

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

rmsc added a commit to rmsc/salt that referenced this issue Jul 5, 2022
Ch3LL pushed a commit that referenced this issue Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant