Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-1578

Facter incorrectly converts integers causing negative values to be stored in PDB

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: FACT 3.5.1
    • Fix Version/s: FACT 3.6.4
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Agent
    • Story Points:
      1
    • Sprint:
      Agent 2017-04-19, Agent 2017-05-03
    • Method Found:
      Customer Feedback
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Previously, facter had an integer overflow when reporting on large numeric fact values, eg disk sizes, so the values were reported as negative numbers. This bug fix ensures facter uses 64-bit longs to correctly report on the data.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      An acceptance test exists for this which should be added by this ticket

      Description

      PE 2016.5.2 Solaris x86 agent shows correct values in the output of `facter`, but shows negative numbers for large values when `puppet facts` is run. These negative numbers are also submitted to the Puppet server and stored in PDB.

      # /opt/puppetlabs/bin/puppet facts
      <snip>
          "mountpoints": {
            "/": {
              "available": "14.89 GiB",
              "available_bytes": -1195611136,
      # /opt/puppetlabs/bin/facter mountpoints
      {
        / => {
          available => "14.89 GiB",
          available_bytes => 15984258048,
      

      These negative numbers are then pushed to PDB:

      pe-puppetdb=# select factsets.certname,fact_paths.path,fact_values.value_integer,fact_values.value_float from facts inner join fact_values on fact_values.id = facts.fact_value_id inner join fact_paths on fact_paths.id = facts.fact_path_id inner join factsets on facts.factset_id = factsets.id where fact_paths.name = 'mountpoints' and value_integer<0;
                      certname                 |                      path                       | value_integer | value_float
      -----------------------------------------+-------------------------------------------------+---------------+-------------
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/etc/svc/volatile#~size_bytes      |   -1434329088 |
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/#~available_bytes                 |   -1195860992 |
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/etc/svc/volatile#~available_bytes |   -1434628096 |
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/lib/libc.so.1#~used_bytes         |   -1424512512 |
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/lib/libc.so.1#~available_bytes    |   -1195860992 |
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/tmp#~size_bytes                   |   -1387552768 |
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/tmp#~available_bytes              |   -1434628096 |
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/export/home#~size_bytes           |   -1195816960 |
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/rpool#~available_bytes            |   -1195860992 |
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/export/home#~available_bytes      |   -1195860992 |
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/rpool#~size_bytes                 |   -1195817472 |
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/#~used_bytes                      |   -1424512512 |
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/var/run#~size_bytes               |   -1434583040 |
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/export#~available_bytes           |   -1195860992 |
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/var/run#~available_bytes          |   -1434628096 |
       yq1fdj22euf1dp6.delivery.puppetlabs.net | mountpoints#~/export#~size_bytes                |   -1195828224 |
      (16 rows)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              branan Branan Riley
              Reporter:
              adam.bottchen Adam Bottchen
              QA Contact:
              Eric Delaney Eric Delaney
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support