Jira (FACT-2882) Gem-based Facter 4.0.x does not return the complete FQDN

64 views
Skip to first unread message

Sanjay Tripathi (Jira)

unread,
Dec 1, 2020, 9:04:04 PM12/1/20
to puppe...@googlegroups.com
Sanjay Tripathi created an issue
 
Facter / Bug FACT-2882
Gem-based Facter 4.0.x does not return the complete FQDN
Issue Type: Bug Bug
Affects Versions: FACT 4.0.44
Assignee: Unassigned
Components: Facter 4
Created: 2020/12/01 6:03 PM
Environment:

The gem-based facter 4.0.x does not return the correct fqdn – it returns the hostname with dot instead of returning hostname with the domain suffix.

Example:
facter fqdn
Output:

myhostname.

The correct output:
myhostname.mydomain.com

This breaks scripts which issue http request to the fqdn (like: http://myhostname.:1234 is not reachable).

Priority: Critical Critical
Reporter: Sanjay Tripathi

Add new os support on litmus modules

Before to start, make sure the new platform is provided by vmpooler and it's fully equipped
an image with the new os is available from puppet agent team

Here you can find a list with all the converted modules to use litmus

Step1: Using pdksync, check/update metadata.json, ci-job-configs/jenkii/platform/projects/modules-unified.yaml

metadata.json file

  • check for section: operatingsystem_support
  • add new version under the intended operatingsystem and save

ci-job-configs/jenkii/platform/projects/modules-unified.yaml

  • check for the module and add new platform under smoke_platforms| pe_platforms (if this platform was released)

Step2: Using pdksync, create PR with the changes on modules
Step3: Create PR on ci-job-configs
Step4: Deploy experimental platform intended module
Step5: Run ad-hoc tests using that experimental
Step6: Check testing results
Step7: If failures, fix them, re-execute all the testing part until they are green
Step8: Ask for review/merge

check for vmpooler platform
pdksync: update metadata.json
pdksync: push changes, create commit
create PR on ci-job-configs
deploy experimental platform intended module
run tests through ad-hoc jenkins using that experimental
check testing report
if failures, fix them, re-execute ad-hoc until they are green
review/merge PR

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Sanjay Tripathi (Jira)

unread,
Dec 1, 2020, 9:44:02 PM12/1/20
to puppe...@googlegroups.com
Sanjay Tripathi commented on Bug FACT-2882
 
Re: Gem-based Facter 4.0.x does not return the complete FQDN

Note that the domain fact is broken – it returns empty string, which is probably the cause of this issue.

Bogdan Irimie (Jira)

unread,
Dec 2, 2020, 3:07:04 AM12/2/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
 
Change By: Bogdan Irimie
Sprint: ghost-2.12
Sub-team: ghost
Team: Night's Watch

Bogdan Irimie (Jira)

unread,
Dec 2, 2020, 7:03:03 AM12/2/20
to puppe...@googlegroups.com

Oana Tanasoiu (Jira)

unread,
Dec 2, 2020, 9:16:05 AM12/2/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Dec 2, 2020, 2:10:04 PM12/2/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Dec 2, 2020, 2:12:03 PM12/2/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Environment:
The gem-based facter 4.0.x does not return the correct fqdn – it returns the hostname with dot instead of returning hostname with the domain suffix.

Example:
facter fqdn
Output:

myhostname.

The correct output:
myhostname.mydomain.com

This breaks scripts which issue http request to the fqdn (like: [http://myhostname.:1234|http://myhostname.:1234/] is not reachable).

Josh Cooper (Jira)

unread,
Dec 2, 2020, 2:12:04 PM12/2/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
The gem-based facter 4.0.x does not return the correct fqdn – it returns the hostname with dot instead of returning hostname with the domain suffix.

Example:
facter fqdn
Output:

myhostname.

The correct output:
myhostname.mydomain.com

This breaks scripts which issue http request to the fqdn (like: [http://myhostname.:1234|http://myhostname.:1234/] is not reachable).

----

Add new os support on litmus modules

*Before to start, make sure the new platform is provided by vmpooler and it's fully equipped*
*an image with the new os is available from puppet agent team*

[Here|https://confluence.puppetlabs.com/display/ECO/How+to+add+support+for+new+platforms] you can find a list with all the converted modules to use litmus


Step1: Using pdksync, check/update metadata.json, ci-job-configs/jenkii/platform/projects/modules-unified.yaml

*metadata.json file*
- check for section: operatingsystem_support
- add new version under the intended operatingsystem and save

*[ci-job-configs/jenkii/platform/projects/modules-unified.yaml|https://github.com/puppetlabs/ci-job-configs/blob/master/jenkii/platform/projects/modules-unified.yaml]*
- check for the module and add new platform under smoke_platforms| pe_platforms (if this platform was released)


Step2: Using pdksync, create PR with the changes on modules

Step4: Deploy experimental platform intended module
Step5: Run ad-hoc tests using that experimental
Step6: Check testing results
Step7: If failures, fix them, re-execute all the testing part until they are green
Step8: Ask for review/merge

(-) check for vmpooler platform
(-) pdksync: update metadata.json
(-) pdksync: push changes, create commit
(-) create PR on ci-job-configs
(-) deploy experimental platform intended module
(-) run tests through ad-hoc jenkins using that experimental
(-) check testing report
(-) if failures, fix them, re-execute ad-hoc until they are green
(-) review/merge PR

Josh Cooper (Jira)

unread,
Dec 4, 2020, 10:23:04 AM12/4/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Dec 4, 2020, 10:24:03 AM12/4/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-2882
 
Re: Gem-based Facter 4.0.x does not return the complete FQDN

Hi Sanjay Tripathi it looks like you're using the "New os support on traditional module" template to file new tickets. Can you omit the template for any new tickets you file? Thanks!

Sanjay Tripathi (Jira)

unread,
Dec 4, 2020, 1:36:03 PM12/4/20
to puppe...@googlegroups.com

Okay, I will omit this template in future tickets. I also would like to mention that this problem of incorrect/incomplete FQDN occurs on Windows 2016 (because the domain fact returns empty string). I don't know if it works on other OS but I have only run my tests in Windows.

Sanjay Tripathi (Jira)

unread,
Dec 8, 2020, 1:07:03 PM12/8/20
to puppe...@googlegroups.com

When will the fix be available? I would like to try it out on Windows.

Sanjay Tripathi (Jira)

unread,
Dec 8, 2020, 3:15:04 PM12/8/20
to puppe...@googlegroups.com

I downloaded the latest from https://github.com/puppetlabs/facter and on Windows 2016 I am still seeing the incorrect FQDN, due to the empty domain.

Mihai Buzgau (Jira)

unread,
Dec 9, 2020, 7:24:04 AM12/9/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
 
Change By: Mihai Buzgau
Fix Version/s: FACT 4.0.47

Bogdan Irimie (Jira)

unread,
Dec 16, 2020, 2:28:17 PM12/16/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-9.12 , ready for triage 3

Sanjay Tripathi (Jira)

unread,
Dec 16, 2020, 3:51:05 PM12/16/20
to puppe...@googlegroups.com
 
Re: Gem-based Facter 4.0.x does not return the complete FQDN

Hi,

Sorry, I had not checked the previous comments.

But today, I tried the new facter-4.0.47 https://rubygems.org/downloads/facter-4.0.47.gem and on Windows, I still get the incorrect FQDN having the hostname suffixed with "."

ffi (1.13.1) gem is installed in this environment.

Josh Cooper (Jira)

unread,
Dec 16, 2020, 4:19:03 PM12/16/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-2882

Thanks Sanjay Tripathi. Could you try running the following powershell commands and include the output?

PS C:\> Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
...
PS C:\> Get-WmiObject Win32_NetworkAdapterConfiguration
...

Also can you install facter 2.x (gem install facter -v 2.5.7) and see if it returns the correct hostname/domain/fqdn?

Sanjay Tripathi (Jira)

unread,
Dec 16, 2020, 5:18:18 PM12/16/20
to puppe...@googlegroups.com

Thank you, Josh Cooper.

Here's the information:

Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

DataBasePath             : C:\Windows\System32\drivers\etc
Domain                   : mysubdomain.mydomain.com
ForwardBroadcasts        : 0
ICSDomain                : myhome.net
IPEnableRouter           : 0
NameServer               :
SyncDomainWithMembership : 0
NV Hostname              : mytsthost
Hostname                 : mytsthost
SearchList               : mydev.mydomain.com,mydomain.com,mydomain.com,mysubdomain.mydomain.com
NV Domain                : mysubdomain.mydomain.com
TcpWindowSize            : 65535
PSPath                   : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\P
PSParentPath             : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip
PSChildName              : Parameters
PSDrive                  : HKLM
PSProvider               : Microsoft.PowerShell.Core\Registry

 

Get-WmiObject Win32_NetworkAdapterConfiguration

DHCPEnabled      : False
IPAddress        :
DefaultIPGateway :
DNSDomain        :
ServiceName      : RTL8023x64
Description      : Realtek RTL8139C+ Fast Ethernet NIC
Index            : 0

DHCPEnabled      : True
IPAddress        :
DefaultIPGateway :
DNSDomain        :
ServiceName      : kdnic
Description      : Microsoft Kernel Debug Network Adapter
Index            : 1

DHCPEnabled      : False
IPAddress        :
DefaultIPGateway :
DNSDomain        :
ServiceName      : tunnel
Description      : Microsoft ISATAP Adapter
Index            : 2

DHCPEnabled      : False
IPAddress        :
DefaultIPGateway :
DNSDomain        :
ServiceName      : tunnel
Description      : Microsoft Teredo Tunneling Adapter
Index            : 3

DHCPEnabled      : False
IPAddress        : {10.248.4.61, fe80::7025:aea3:ea4d:9e2a, 2606:b400:2010:4857:7025:aea3:ea4d:9e2a}
DefaultIPGateway : {10.248.4.1, fe80::22a:6aff:fe85:ac3c}
DNSDomain        :
ServiceName      : XenNet
Description      : Xen Virtual Ethernet Adapter
Index            : 4

DHCPEnabled      : False
IPAddress        :
DefaultIPGateway :
DNSDomain        :
ServiceName      : tunnel
Description      : Microsoft ISATAP Adapter
Index            : 5

========================================

Facter 2.5.7 gem's fqdn output on Windows is correct:
facter --version
2.5.7

facter fqdn
mytsthost.mysubdomain.mydomain.com

 

Josh Cooper (Jira)

unread,
Dec 16, 2020, 6:25:07 PM12/16/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-2882

I think facter 4 has a regression which we experienced during facter 2.x, see https://github.com/puppetlabs/facter/commit/5aa2a6f71ce0ccabe6097798115871dc08d9dc5e. It's possible for the (primary) domain to be set in the registry, but not on any of the network adapter config. I think facter 4 needs to do the same.

Bogdan Irimie (Jira)

unread,
Dec 18, 2020, 11:57:03 AM12/18/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-9.12, ghost-18.12 , ready for triage 3

Josh Cooper (Jira)

unread,
Jan 4, 2021, 1:24:03 PM1/4/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Labels: doc_reviewed platform_7. 1 2

Bogdan Irimie (Jira)

unread,
Jan 5, 2021, 3:17:03 AM1/5/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-9.12, ghost-18.12, ready for triage 3 ghost-13.01.2020
Reply all
Reply to author
Forward
0 new messages