Slackbot
06/02/2023, 1:35 AMbinford2k
06/02/2023, 2:32 AM[root@tur-ds-dev4 opt]# puppet agent -t --no-noop
Info: Using environment 'dev'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Starting Facter
Info: Loading facts
symlink_realpath(/opt/dspace_src/latest) realpath() failed: No such file or directory
symlink_realpath(/opt/dspace_src/latest) realpath() failed: No such file or directory
symlink_realpath(/opt/dspace_src/latest) realpath() failed: No such file or directory
symlink_realpath(/opt/dspace_src/latest) realpath() failed: No such file or directory
Ending Facter
Starting Puppet
Info: Applying configuration version 'rhs-dev-4d60c0c4835'
Notice: /Stage[main]/Dspace_modern/File[/opt/dspace_src]/ensure: created (corrective)
Notice: /Stage[main]/Dspace_modern/File[/opt/dspace_src/latest]/ensure: created (corrective)
Notice: Applied catalog in 6.64 seconds
[root@tur-ds-dev4 opt]#binford2k
06/02/2023, 2:34 AMbinford2k
06/02/2023, 2:35 AMPatrick Rynhart
06/02/2023, 2:36 AMbinford2k
06/02/2023, 2:37 AMpuppet facts do?binford2k
06/02/2023, 2:40 AMError: Could not set 'link' on ensure: No such file or directory @ dir_chdir - /opt/dspace_src (file: /Users/ben.ford/tmp/blahblah/dspace.pp, line: 17)Patrick Rynhart
06/02/2023, 2:41 AMbinford2k
06/02/2023, 2:42 AMsymlink_realpath(/opt/dspace_src/latest) realpath() failed: No such file or directoryPatrick Rynhart
06/02/2023, 2:44 AMPatrick Rynhart
06/02/2023, 2:45 AMPatrick Rynhart
06/02/2023, 2:46 AMbinford2k
06/02/2023, 2:46 AMPatrick Rynhart
06/02/2023, 2:48 AMclass dspace_modern (
$config = [],
) {
file { '/opt':
ensure => 'directory',
}
file { '/opt/dspace_src':
ensure => 'directory',
owner => 'tomcat',
group => 'tomcat',
require => File['/opt'],
}
archive { '/tmp/dspace-7.5.tar.gz':
source => '<https://github.com/DSpace/DSpace/archive/refs/tags/dspace-7.5.tar.gz>',
extract => true,
extract_path => '/opt/dspace_src',
cleanup => true,
user => 'tomcat',
group => 'tomcat',
require => File['/opt/dspace_src'],
}
}Patrick Rynhart
06/02/2023, 2:48 AMPatrick Rynhart
06/02/2023, 2:50 AM[root@tur-ds-dev4 opt]# puppet agent -t --no-noop
Info: Using environment 'dev'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Info: Caching catalog for <http://tur-ds-dev4.massey.ac.nz|tur-ds-dev4.massey.ac.nz>
Info: Applying configuration version 'rhs-dev-7b9dc0675fa'
Notice: /Stage[main]/Dspace_modern/File[/opt/dspace_src]/ensure: created (corrective)
Notice: /Stage[main]/Dspace_modern/Archive[/tmp/dspace-7.5.tar.gz]/ensure: download archive from <https://github.com/DSpace/DSpace/archive/refs/tags/dspace-7.5.tar.gz> to /tmp/dspace-7.5.tar.gz and extracted in /opt/dspace_src with cleanup (corrective)
Notice: Applied catalog in 8.40 secondsPatrick Rynhart
06/02/2023, 2:51 AMbinford2k
06/02/2023, 2:51 AMPatrick Rynhart
06/02/2023, 2:52 AM[root@tur-ds-dev4 dspace_src]# puppet -V
6.26.0binford2k
06/02/2023, 2:54 AMPatrick Rynhart
06/02/2023, 2:55 AM[root@tur-ds-dev4 dspace_src]# facter -v
3.14.22 (commit 4d4afa91b226dfa8d2f92c495b7070377134386f)binford2k
06/02/2023, 2:56 AM/opt/puppetlabs/puppet/bin/ruby --version?Patrick Rynhart
06/02/2023, 2:56 AM[root@tur-ds-dev4 dspace_src]# /opt/puppetlabs/puppet/bin/ruby --version
ruby 2.5.9p229 (2021-04-05 revision 67939) [x86_64-linux]binford2k
06/02/2023, 3:00 AMbinford2k
06/02/2023, 3:03 AMsymlink_realpath in any of Puppet, Facter, or RubyPatrick Rynhart
06/02/2023, 3:03 AMPatrick Rynhart
06/02/2023, 3:04 AMfile { '/opt/dspace_src/latest':
ensure => 'link',
target => '/opt/dspace_src/DSpace-dspace-7.5', # When dspace-7.5.tar.gz is extracted (from above), it has directory 'DSpace-dspace-7.5' inside of it
require => Archive['/tmp/dspace-7.5.tar.gz'],
}Patrick Rynhart
06/02/2023, 3:04 AMPatrick Rynhart
06/02/2023, 3:07 AMbinford2k
06/02/2023, 3:09 AMbinford2k
06/02/2023, 3:09 AMbinford2k
06/02/2023, 3:09 AMgrep dspace /opt/puppetlabs/puppet/cache/lib/facter/ -rn say on the agent?Patrick Rynhart
06/02/2023, 3:10 AMPatrick Rynhart
06/02/2023, 3:15 AMPatrick Rynhart
06/02/2023, 3:17 AMbinford2k
06/02/2023, 3:17 AMPatrick Rynhart
06/02/2023, 3:17 AMPatrick Rynhart
06/02/2023, 3:18 AMbinford2k
06/02/2023, 3:20 AMPatrick Rynhart
06/02/2023, 3:24 AMbinford2k
06/02/2023, 3:24 AMPatrick Rynhart
06/02/2023, 3:24 AMbinford2k
06/02/2023, 3:24 AMPatrick Rynhart
06/02/2023, 3:24 AMbinford2k
06/02/2023, 3:26 AMPatrick Rynhart
06/02/2023, 3:27 AMbinford2k
06/02/2023, 3:27 AMPatrick Rynhart
06/02/2023, 3:28 AMcsharpsteen
06/08/2023, 3:22 PMNo such file or directory seems perfectly reasonable during fact collection if those file paths are created later when the catalog is applied.
If disabling SELinux silenced those errors, then it seems likely that SELinux in permissive mode is intercepting the system call and causing it to return an abnormal exit code that the Fact logic does not handle.
As for how to work around or resolve that, you'll need to determine what exact change SELinux is causing in the behavior of that function.