Jira (FACT-1808) Incorrectly detects OS in docker container

3 views
Skip to first unread message

David Wood (JIRA)

unread,
Jan 12, 2018, 8:09:04 AM1/12/18
to puppe...@googlegroups.com
David Wood created an issue
 
Facter / Bug FACT-1808
Incorrectly detects OS in docker container
Issue Type: Bug Bug
Affects Versions: FACT 3.9.3
Assignee: Unassigned
Created: 2018/01/12 5:08 AM
Priority: Normal Normal
Reporter: David Wood

When running in a Docker container, facter incorrectly reports the OS.

To reproduce this, start a docker container with the "ubuntu" image, install Facter from the Puppet repository, run "puppet os" and notice it is reported as "Debian".

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db)
Atlassian logo

Scott McClellan (JIRA)

unread,
Feb 6, 2018, 5:14:04 PM2/6/18
to puppe...@googlegroups.com
Scott McClellan assigned an issue to Branan Riley
Change By: Scott McClellan
Assignee: Branan Riley
This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)
Atlassian logo

Branan Riley (JIRA)

unread,
Feb 6, 2018, 5:27:02 PM2/6/18
to puppe...@googlegroups.com
Branan Riley updated an issue
Change By: Branan Riley
Team: Platform OS

Branan Riley (JIRA)

unread,
Feb 6, 2018, 5:27:03 PM2/6/18
to puppe...@googlegroups.com
Branan Riley commented on Bug FACT-1808
 
Re: Incorrectly detects OS in docker container

We currently rely on the lsb-release package (specifically the lsb_release command) to identify various Debian derivatives. Probably we need to switch to the os-release file, since that appears to have filtered into most modern versions of various distros at this point.

For now, you should be able to install the lsb-release package in your container images to get Facter to behave correctly.

 

David Wood (JIRA)

unread,
Feb 19, 2018, 6:21:02 AM2/19/18
to puppe...@googlegroups.com
David Wood commented on Bug FACT-1808

Thanks, this workaround solves the problem for me.

Geoff Nichols (JIRA)

unread,
Feb 20, 2018, 5:55:02 PM2/20/18
to puppe...@googlegroups.com
Geoff Nichols updated an issue
 
Change By: Geoff Nichols
Labels: triaged virtualization

Matej Žerovnik

unread,
Mar 22, 2020, 12:42:03 PM3/22/20
to puppe...@googlegroups.com
Matej Žerovnik commented on Bug FACT-1808
 
Re: Incorrectly detects OS in docker container

This breaks facter v4 in debian based docker images with the error below. After installed lsb-release package, it works. But at least ruby docker image, which is based on debian, doesn't work by default.

$ facterfacter#<Thread:0x000055965be434e0@/usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/internal_fact_manager.rb:23 run> terminated with exception (report_on_exception is true):Traceback (most recent call last): 2: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/internal_fact_manager.rb:25:in `block (2 levels) in start_threads' 1: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/core_fact.rb:12:in `create'/usr/local/bundle/gems/facter-4.0.11/lib/facts/debian/os/release.rb:12:in `call_the_resolver': undefined method `split' for nil:NilClass (NoMethodError)#<Thread:0x000055965be432b0@/usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/internal_fact_manager.rb:23 run> terminated with exception (report_on_exception is true):Traceback (most recent call last): 2: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/internal_fact_manager.rb:25:in `block (2 levels) in start_threads' 1: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/core_fact.rb:12:in `create'/usr/local/bundle/gems/facter-4.0.11/lib/facts/debian/os/release.rb:12:in `call_the_resolver': undefined method `split' for nil:NilClass (NoMethodError)#<Thread:0x000055965be433c8@/usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/internal_fact_manager.rb:23 run> terminated with exception (report_on_exception is true):Traceback (most recent call last): 2: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/internal_fact_manager.rb:25:in `block (2 levels) in start_threads' 1: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/core_fact.rb:12:in `create'/usr/local/bundle/gems/facter-4.0.11/lib/facts/debian/os/release.rb:12:in `call_the_resolver': undefined method `split' for nil:NilClass (NoMethodError)Traceback (most recent call last): 2: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/internal_fact_manager.rb:25:in `block (2 levels) in start_threads' 1: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/core_fact.rb:12:in `create'/usr/local/bundle/gems/facter-4.0.11/lib/facts/debian/os/release.rb:12:in `call_the_resolver': undefined method `split' for nil:NilClass (NoMethodError)

This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages