Bug 2196825

Summary: satellite-installer fails with error "Ruby Integer outside of Puppet Integer max range" if a filesystem with 8.00 EiB is mounted
Product: Red Hat Satellite Reporter: Stefan Meyer <smeyer>
Component: InstallerAssignee: satellite6-bugs <satellite6-bugs>
Status: NEW --- QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.11.4CC: ahumbe, ehelms, yferszt
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stefan Meyer 2023-05-10 11:04:07 UTC
Description of problem:
satellite-installer fails with error "Ruby Integer outside of Puppet Integer max range" if a filesystem with 8.00 EiB is mounted

Version-Release number of selected component (if applicable):
- Satellite & Capsule 6.11.4

How reproducible:
- The customer has a Netapp fileshare mounted through NFS v4

Steps to Reproduce:
1. Mount a filesystem with a size of 9223371665325424640 bytes
2. Run satellite-installer
3.

Actual results:
The satellite installer shows error

  [ERROR ] [configure] Evaluation Error: Error while evaluating a '=>' expression, Use of a Ruby Integer outside of Puppet Integer max range, got '0x8000000000000000' (file: /usr/share/foreman-installer/modules/foreman_proxy/manifests/register.pp, line: 23, column: 7) on node XXX

Expected results:
The satellite installer should work regardless of a big filesystem

Additional info:

Puppet facter information:

...
/redacted => {
    available => "8.00 EiB",
    available_bytes => 9223371665325424640,
    capacity => "0.00%",
    device => "redacted",
    filesystem => "nfs4",
    options => [
      "rw",
      "relatime",
      "vers=4.1",
      "rsize=1048576",
      "wsize=1048576",
      "namlen=255",
      "hard",
      "proto=tcp",
      "timeo=600",
      "retrans=2",
      "sec=sys",
      "clientaddr=redacted",
      "local_lock=none",
      "addr=redacted"
    ],
    size => "8.00 EiB",
    size_bytes => 9223372036854775808,
    used => "346.01 GiB",
    used_bytes => 371529351168
  },
...

Comment 1 Ewoud Kohl van Wijngaarden 2023-05-11 14:30:41 UTC
I did some minimal testing by defining a custom fact with just a large number:

cat > lib/facter/large.rb <<EOF
Facter.add(:large) do
  setcode do
    9223371665325424640
  end
end
EOF

Then applying the following manifest does work (with Puppet 6.28.0):

if $facts['large'] > 1000 {
  file { '/tmp/bla':
    ensure => file,
    content => String($facts['large']),
  }
}

My next guess was some conversion in custom types, but also there with a small custom type I couldn't easily reproduce it:

Puppet::Type.newtype(:largenumber) do
  ensurable
  newparam(:name)
  newproperty(:content)
end

Puppet::Type.type(:largenumber).provide(:default) do
  mk_resource_methods

  def self.instances
    []
  end

  def self.prefetch(resources)
    resources.each do |name, resource|
      if File.exist?(name)
        resource.provider = new(ensure: :present, content: JSON.load(File.read(name)))
      else
        resource.provider = new(ensure: :absent)
      end
    end
  end

  def create
    require 'json'
    File.write(name, JSON.dump(resource.should(:content)))
    @property_hash[:ensure] = :present
    @property_hash[:content] = resource.should(:content)
  end

  def flush
    require 'json'
    File.write(name, JSON.dump(@property_hash[:content]))
  end

  def exists?
    return File.file?(name)
  end
end

That also happily wrote out the content.

So it needs some further investigation where it's happening.