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

minion id ends with non-existing domain ".mshome.net" #52162

Closed
marbx opened this issue Mar 13, 2019 · 15 comments
Closed

minion id ends with non-existing domain ".mshome.net" #52162

marbx opened this issue Mar 13, 2019 · 15 comments
Assignees
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged
Milestone

Comments

@marbx
Copy link
Contributor

marbx commented Mar 13, 2019

Description of Issue/Question

The domain grain is "mshome.net" which is not correct

This domain appears also in the fqdn

salt-call grains.item domain
local:
    ----------
    domain:
        mshome.net

Setup

Installed 2018.3.4 Py3 on Windows 10.

Versions Report

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

salt-call --versions-report

Salt Version:
Salt: 2018.3.4

Dependency Versions:
cffi: 1.10.0
cherrypy: 10.2.1
dateutil: 2.6.1
docker-py: Not Installed
gitdb: 2.0.5
gitpython: 2.1.3
ioflo: Not Installed
Jinja2: 2.9.6
libgit2: Not Installed
libnacl: 1.6.1
M2Crypto: Not Installed
Mako: 1.0.6
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: 2.17
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 16:02:32) [MSC v.1900 64 bit (AMD64)]
python-gnupg: 0.4.1
PyYAML: 3.12
PyZMQ: 16.0.3
RAET: Not Installed
smmap: 2.0.5
timelib: 0.2.4
Tornado: 4.5.1
ZMQ: 4.1.6

System Versions:
dist:
locale: cp1252
machine: AMD64
release: 10
system: Windows
version: 10 10.0.16299 SP0 Multiprocessor Free

@twangboy
Copy link
Contributor

If it's not part of a domain, it will use the workgroup. What is the workgroup setting on this machine?

@marbx
Copy link
Contributor Author

marbx commented Mar 14, 2019

Which command shall I execute for the workgroup settings?

@marbx
Copy link
Contributor Author

marbx commented Mar 14, 2019

The Python 2 Minion does show the correct domain.

C:>\salt\salt-call --versions-report
Salt Version:
Salt: 2018.3.4

Dependency Versions:
cffi: 1.10.0
cherrypy: 10.2.1
dateutil: 2.6.1
docker-py: Not Installed
gitdb: 2.0.5
gitpython: 2.1.3
ioflo: Not Installed
Jinja2: 2.9.6
libgit2: Not Installed
libnacl: 1.6.1
M2Crypto: Not Installed
Mako: 1.0.6
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: 2.17
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)]
python-gnupg: 0.4.1
PyYAML: 3.12
PyZMQ: 16.0.3
RAET: Not Installed
smmap: 2.0.5
timelib: 0.2.4
Tornado: 4.5.1
ZMQ: 4.1.6

System Versions:
dist:
locale: cp1252
machine: AMD64
release: 10
system: Windows
version: 10 10.0.16299 Multiprocessor Free

@Ch3LL Ch3LL added the Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged label Mar 14, 2019
@Ch3LL Ch3LL added this to the Blocked milestone Mar 14, 2019
@marbx marbx changed the title domain grain is set to "mshome.net" which is wrong domain grain is wrongly set to "mshome.net" under Python 3 Mar 14, 2019
@twangboy
Copy link
Contributor

I would log on to the machine and check the domain settings. Is it connected to a domain? What domain/workgroup name is shown in the GUI?

Windows Key+Break
Advanced System Settings
Computer Name tab

@marbx
Copy link
Contributor Author

marbx commented Mar 15, 2019

The client is in a domain which is still properly reported in the domain grain of the Python 2 minion.

I will continue to use the Python 2 client.

The grains unit test
does not test any grain value.

For the long term, I suggest that the unit test also covers values, starting with the domain.

The domain name should be in socket.getfqdn()

I can only add a test that is run by Jenkins, or I need to learn how to run the tests locally.

@twangboy twangboy self-assigned this Mar 15, 2019
@twangboy twangboy modified the milestones: Blocked, March 29th Mar 15, 2019
@twangboy
Copy link
Contributor

OK. I'll take a look at it and get some tests written up.

@twangboy
Copy link
Contributor

@markuskramerIgitt Would you mind verifying the above PR?

@twangboy
Copy link
Contributor

@markuskramerlgitt So, there is a grain called windowsdomain. The above PR sets the domain grain to be the same as the windowsdomain grain. But, now that I think about it, the domain grain may refer to a dns domain instead of the windows domain name. It uses socket.get_fqdn to determine the domain name. So, maybe the above PR shouldn't be the fix and you should use the windowsdomain grain instead.
@UtahDave @dwoz What do you think?

@marbx
Copy link
Contributor Author

marbx commented Mar 20, 2019

Please continue to distinguish
Domain and
Windows domain

@marbx
Copy link
Contributor Author

marbx commented Mar 20, 2019

I wrongly get "mshome.net" from Salt of Py2, Py3 and directly from socket.getfqdn().

Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32
>>> import socket
>>> socket.getfqdn()
'**********.mshome.net'

This seems to be a DHCP configuration problem.

@marbx marbx changed the title domain grain is wrongly set to "mshome.net" under Python 3 Python socketgetfqdn() ends with wrong domain "mshome.net" Mar 20, 2019
@marbx marbx changed the title Python socketgetfqdn() ends with wrong domain "mshome.net" Python socket.getfqdn() ends with wrong domain "mshome.net" Mar 20, 2019
@marbx
Copy link
Contributor Author

marbx commented Mar 20, 2019

As this is not a Salt issue, I close it

@marbx marbx closed this as completed Mar 20, 2019
@marbx
Copy link
Contributor Author

marbx commented Mar 20, 2019

The Python issue is https://bugs.python.org/issue36382

@marbx
Copy link
Contributor Author

marbx commented Mar 20, 2019

I found another client with mshome.net domain.

I guess under some conditions and from the viewpoint of Python, the Hyper-V adapter takes precedence over all other network adapters and therefore mshome.net overrides the network domains of the other adapters.

@marbx
Copy link
Contributor Author

marbx commented Mar 20, 2019

salt -G 'domain:mshome.net' grains.item ipv4, revealed that ~ 3% of the clients are affected

@marbx marbx changed the title Python socket.getfqdn() ends with wrong domain "mshome.net" Python socket.getfqdn() ends with domain "mshome.net" of Hyper-V NIC Mar 20, 2019
@marbx
Copy link
Contributor Author

marbx commented Jan 10, 2021

Still an issue with version 3001 physical minions.

Probably caused when client starts "offline" (cannot initially connect to the salt-master).

workaround exist with minion_id_remove_domain: True from PR #49378

@marbx marbx reopened this Jan 10, 2021
@marbx marbx changed the title Python socket.getfqdn() ends with domain "mshome.net" of Hyper-V NIC minion id ends with non-existing domain ".mshome.net" Jan 10, 2021
@marbx marbx closed this as completed Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged
Projects
None yet
Development

No branches or pull requests

3 participants