puppet-debugger icon indicating copy to clipboard operation
puppet-debugger copied to clipboard

Facterdb default filter no longer works

Open b4ldr opened this issue 1 year ago • 1 comments

This is related to the fact that factedb has dropped support for legacy facts in facterdb v3

There is a previous similar issues but i suspect its unrelated https://github.com/nwops/puppet-debugger/issues/46

b4ldr avatar Jul 29 '24 12:07 b4ldr

Im also seeing issues the facterdb 2.1.0 I recive the following error

Using filter: operatingsystem=Fedora and operatingsystemrelease=23 and architecture=x86_64 and facterversion=/^3\.1/
Bad FacterDB filter, please change the filter so it returns a result set.
See https://github.com/camptocamp/facterdb/#with-a-string-filter

however running the following works

$ facterdb operatingsystem=Fedora and operatingsystemrelease=23 and architecture=x86_64 and facterversion=/^3\.1/

For now i have got things working using the debian bookworm version 1.12.1-1

b4ldr avatar Jul 29 '24 12:07 b4ldr

@b4ldr you are saying that this one works for you with Facterdb 3.4

$ facterdb operatingsystem=Fedora and operatingsystemrelease=23 and architecture=x86_64 and facterversion=/^3\.1/

but I am getting an empty array

maxadamo avatar Nov 26 '24 11:11 maxadamo

So, operatingsystem no longer exists.

a quick & dirty workaround consists of editing this file (I have .rbenv):

.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/puppet-debugger-1.4.0/lib/puppet-debugger/support/facts.rb

You can add a proper filter, or just replace the filter with an empty string: ""

and replace this block at line 14 as follows:

      def default_facterdb_filter
        "operatingsystem=#{facter_os_name} and operatingsystemrelease=#{facter_os_version} and architecture=x86_64 and facterversion=#{facter_version}"
      end
      def default_facterdb_filter
        ""
      end

maxadamo avatar Nov 26 '24 11:11 maxadamo

@b4ldr you are saying that this one works for you with Facterdb 3.4

$ facterdb operatingsystem=Fedora and operatingsystemrelease=23 and architecture=x86_64 and facterversion=/^3\.1/

No i was saying that facterdb dropped legacy facts in 3.0.0 as such the current default_facterdb_filter does not work. As a workaround i switched to using facterdb v1.27.0

b4ldr avatar Nov 26 '24 13:11 b4ldr

This works for me:

DEBUGGER_FACTERDB_FILTER="facterversion=/^4/" puppet-debugger

moritz-makandra avatar Dec 20 '24 16:12 moritz-makandra

FYi there is a PR to fix this: #77

b4ldr avatar Jan 08 '25 16:01 b4ldr

Please note this repo is hosted on gitlab. https://gitlab.com/puppet-debugger/puppet-debugger

The issue is track at https://gitlab.com/puppet-debugger/puppet-debugger/-/issues/22

I am currently updating the code and hope to get a minor release out soon.

logicminds avatar Mar 28 '25 01:03 logicminds

fixed in release 1.5.0

logicminds avatar Mar 28 '25 17:03 logicminds