Skip to content

$PATH env dissapears which breaks facter plugin, when local connection is used #118

@kajinamit

Description

@kajinamit

I don't know if this is the right place to report this, but I have no clear idea about the potential root cause I'm reporting this here first to ask for some thoughts.

I'm now trying to on-board some of the acceptance tests which has been based on puppet-litmus, but I've seen consistent failure when setting up mysql grants using puppetlabs-mysql ( I've tried 16.3.0 or 16.1.0 so far).

Looking into the failure further I've identified that the mysqld_version fact[1] is resolved to '' after the mariadb package is installed.

[1] https://github.com/puppetlabs/puppetlabs-mysql/blob/1e550701515c2c144719b4f769aa954a0cf2645f/lib/facter/mysqld_version.rb#L3

I see no problem with manual local run.

[root@localhost ~]# env PATH=$PATH:/usr/libexec mysqld --no-defaults -V 2>/dev/null
mysqld  Ver 10.5.27-MariaDB for Linux on x86_64 (MariaDB Server)
[root@localhost ~]# rpm -q mariadb
mariadb-10.5.27-1.el9.x86_64

I've injected some debug logs and eventually found that the PATH environment is not resolved correctly when the command is being executed by the factor plugin.

  Debug: Facter: Executing command: /bin/echo $PATH
  Debug: Facter: /opt/puppetlabs/bin:/home/vagrant/puppet-nova/.bundled_gems/bin:/sbin:/bin:/usr/sbin:/usr/bin
  Debug: Facter: Executing command: /bin/env PATH=$PATH:/usr/libexec mysqld --no-defaults 2 > /dev/null
  Debug: Facter: Command /bin/env PATH=$PATH:/usr/libexec mysqld --no-defaults 2 > /dev/null completed with the following stderr message: /bin/env: ':/usr/libexec': No such file or directory

Note that I'm using LocalConnection.

$ cat spec/acceptance/nodesets/centos-9-x86_64.yml 
HOSTS:
  localhost:
    roles:
      - master
    platform: el-9-x86_64
    hypervisor: none
CONFIG:
  default_module_install_opts:
    append_cmds: '--ignore-dependencies --force'
  trace_limit: 200
  type: foss

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions