Jira (FACT-3187) Facter fails on mountpoints fact on Solaris 10 with non-global zones which have NFS mounts

0 views
Skip to first unread message

Selvakumar Azhagarsami (Jira)

unread,
Feb 15, 2023, 10:29:05 PM2/15/23
to puppe...@googlegroups.com
Selvakumar Azhagarsami created an issue
 
Facter / Bug FACT-3187
Facter fails on mountpoints fact on Solaris 10 with non-global zones which have NFS mounts
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2023/02/15 7:28 PM
Priority: Normal Normal
Reporter: Selvakumar Azhagarsami

Puppet Version: 2021.7.2

Agent OS: Solaris 10 u1

Our infrastructure and agents have been upgraded to 2021.7.2. (from 2019.8.10). In this specific case, it appears that facter in the new version has a problem:

  • Solaris 10 agent
  • Running on global zone of a system that has at least one non-global zone
  • At least one non-global zone has an NFS mount point

In this combination, the root user on the global zone does not have the ability to run statvfs on the NFS filesystems:

 

```

  1. df -h -Z
    Filesystem             size   used  avail capacity  Mounted on

/zones/XXXXX/root/export/disk01/app/axentsu
                      27G    13G    15G    47%    /zones/XXXXX/root/app/axentsu
df: cannot statvfs /zones/XXXXX/root/cmntsu: Not owner

```

The previous version of facter seemed to handle this well, but the new version does not:

```

  1. facter -p mountpoints
    [2023-02-16 09:22:00.944124 ] ERROR Facter::InternalFactManager - statvfs() function failed: Not owner

#

```

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Selvakumar Azhagarsami (Jira)

unread,
Feb 15, 2023, 10:30:03 PM2/15/23
to puppe...@googlegroups.com
Selvakumar Azhagarsami updated an issue
Puppet Version: 2021.7.2

Agent OS: Solaris 10 u1

Our infrastructure and agents have been upgraded to 2021.7.2. (from 2019.8.10). In this specific case, it appears that facter in the new version has a problem:
* Solaris 10 agent
* Running on global zone of a system that has at least one non-global zone
* At least one non-global zone has an NFS mount point


In this combination, the root user on the global zone does not have the ability to run statvfs on the NFS filesystems:
{code:java}
 

```

# df -h -Z

Filesystem             size   used  avail capacity  Mounted on
/zones/XXXXX/root/export/disk01/app/axentsu
                      27G    13G    15G    47%    /zones/XXXXX/root/app/axentsu
df: cannot statvfs /zones/XXXXX/root/cmntsu: Not owner {code}
 
```

The previous version of facter seemed to handle this well, but the new version does not:
{code:java}
```

# facter -p mountpoints

[2023-02-16 09:22:00.944124 ] ERROR Facter::InternalFactManager - statvfs() function failed: Not owner {code}

#

```

 

Selvakumar Azhagarsami (Jira)

unread,
Feb 15, 2023, 10:32:03 PM2/15/23
to puppe...@googlegroups.com
Selvakumar Azhagarsami updated an issue
Puppet Version: 2021.7.2

Agent OS: Solaris 10 u1

Our infrastructure and agents have been upgraded to 2021.7.2. (from 2019.8.10). In this specific case, it appears that facter in the new version has a problem:
* Solaris 10 agent
* Running on global zone of a system that has at least one non-global zone
* At least one non-global zone has an NFS mount point

In this combination, the root user on the global zone does not have the ability to run statvfs on the NFS filesystems:
{code:java}

# df -h -Z
Filesystem             size   used  avail capacity  Mounted on
/zones/XXXXX/root/export/disk01/app/axentsu
                      27G    13G    15G    47%    /zones/XXXXX/root/app/axentsu
df: cannot statvfs /zones/XXXXX/root/cmntsu: Not owner{code}
 

The previous version of facter seemed to handle this well, but the new version does not:
{code:java}

# facter -p mountpoints
[2023-02-16 09:22:00.944124 ] ERROR Facter::InternalFactManager - statvfs() function failed: Not owner{code}
 


I think facter should just ignore such errors, as it apparently used to do

Charmaine Pritchett (Jira)

unread,
Feb 15, 2023, 10:34:03 PM2/15/23
to puppe...@googlegroups.com

Charmaine Pritchett (Jira)

unread,
Feb 15, 2023, 10:34:03 PM2/15/23
to puppe...@googlegroups.com

Selvakumar Azhagarsami (Jira)

unread,
Feb 15, 2023, 10:38:03 PM2/15/23
to puppe...@googlegroups.com

Selvakumar Azhagarsami (Jira)

unread,
Feb 15, 2023, 10:51:03 PM2/15/23
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Feb 24, 2023, 2:28:02 PM2/24/23
to puppe...@googlegroups.com

Stephen Jennings (Jira)

unread,
Mar 23, 2023, 4:48:02 AM3/23/23
to puppe...@googlegroups.com
Stephen Jennings commented on Bug FACT-3187
 
Re: Facter fails on mountpoints fact on Solaris 10 with non-global zones which have NFS mounts

Hi Tony Vu 

Have you had an opportunity to get a look at this? We still need to get back to the customer. Thanks Stephen

Stephen Jennings (Jira)

unread,
Apr 20, 2023, 4:02:02 AM4/20/23
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Apr 24, 2023, 7:34:03 PM4/24/23
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Apr 25, 2023, 1:10:01 AM4/25/23
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
May 10, 2023, 12:55:03 PM5/10/23
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
May 18, 2023, 3:44:01 PM5/18/23
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Phoenix 2023-06-07
This message was sent by Atlassian Jira (v8.20.21#820021-sha1:38274c8)
Atlassian logo

Josh Cooper (Jira)

unread,
May 18, 2023, 8:00:02 PM5/18/23
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-3187
 
Re: Facter fails on mountpoints fact on Solaris 10 with non-global zones which have NFS mounts

In Facter 3, if statvfs failed, then it excluded the size and available fields of the mountpoint:

https://github.com/puppetlabs/facter/blob/6d7ffc6efdfbc3b1fc79311cdeb4581ac2098d9c/lib/src/facts/solaris/filesystem_resolver.cc#L49-L52

And all of the derived fields were set to 0:

https://github.com/puppetlabs/facter/blob/6d7ffc6efdfbc3b1fc79311cdeb4581ac2098d9c/lib/src/facts/resolvers/filesystem_resolver.cc#L38-L39

And capacity was reported as 100%:

  /dev/fd => {
    available => "0 bytes",
    available_bytes => 0,
    capacity => "100%",
    device => "fd",
    filesystem => "fd",
    options => [
      "rw",
      "dev=xxx"
    ],
    size => "0 bytes",
    size_bytes => 0,
    used => "0 bytes",
    used_bytes => 0
  },

Facter 4 uses the statvfs gem, which raises if statvfs returns < 0

https://github.com/djberg96/sys-filesystem/blob/c00f568f3386329e21617174e2d1cd49a6a70fa8/lib/sys/unix/sys/filesystem.rb#L225

The Solaris mountpoint resolver needs to guard against Sys::Filesystem.stat raising and treat the mount has having available & total size 0 like we do in mac resolver:

https://github.com/puppetlabs/facter/blob/d9d8324b02c26be2eb17a1d8ff26306a331431e2/lib/facter/resolvers/macosx/mountpoints.rb#L36-L44

Rather than requiring every caller to handle the exception, the FilesystemHelper should rescue the exception, log it at debug, and return a stat(like) object with the fields initialized to 0.

Tony Vu (Jira)

unread,
Jun 7, 2023, 1:16:02 PM6/7/23
to puppe...@googlegroups.com
Tony Vu updated an issue
 
Change By: Tony Vu
Sprint: Phoenix 2023-06-07 , Phoenix 2023-06-21

Josh Cooper (Jira)

unread,
Jun 7, 2023, 1:31:01 PM6/7/23
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Phoenix 2023-06-07 , Phoenix 2023-06-21

Josh Cooper (Jira)

unread,
Jun 7, 2023, 1:54:02 PM6/7/23
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: FACT 4.4.1
Fix Version/s: FACT 4.4.2

Charmaine Pritchett (Jira)

unread,
Jun 19, 2023, 9:50:02 PM6/19/23
to puppe...@googlegroups.com
Charmaine Pritchett updated an issue
Change By: Charmaine Pritchett
Zendesk Ticket Count: 1 2
Zendesk Ticket IDs: 51107 ,52316
Reply all
Reply to author
Forward
0 new messages