Puppet - Parameter name with whitespace failed on CIFS Mount - puppet

Basic Info :
Puppet Version: 2.8.1
OS Name/Version: RedHat 7
We are trying to run the below puppet resource but we are getting whitespace error, Please find the same.
mount { "/SERVER/New York_share":
atboot => true,
ensure => mounted,
device => "//MOUNTSERVER/New York_share",
fstype => "cifs",
options => "credentials=/tmp/id,uid=oracle,gid=oinstall,iocharset=utf8,file_mode=0644,dir_mode=0775,_netdev,soft", }
Error:
Failed to apply catalog: Parameter name failed on Mount[/SERVER/New
York_share]: name must not contain whitespace: /SERVER/New York_share
at
/etc/puppetlabs/code/environments/master/site/profile/manifests/ob.pp:132
Anybody could suggest us. Please respond.

As the error message suggests, Puppet will not accept spaces in the mount point. It looks like you will need to rename your mount point so that it doesn't have spaces in it.
The behaviour goes all the way back to Puppet Bug #6409, where it was found that a mount point with spaces would break fstab, because fstab also doesn't support spaces in the mount point either.
Arguably, Puppet's behaviour is incorrect, and instead of erroring out, Puppet should write a string \040 in fstab like this article says. It's probably not hard to fix this behaviour, if someone feels like raising a pull request.

This is an new feature and it was apparently an intentional decision many years ago. We can look into supporting whitespace in paths here,
For More Info

Related

Snakemake cannot write metadata

I have troubles to get snakemake-minimal=7.8.5 to run on Windows 10. I can execute rules, but snakemake terminates due to an error regarding the metadata:
Failed to set marker file for job started ([Errno 2] No such file or directory: 'C:\\test\\project\\.snakemake\\incomplete\\cnVucy9leHBlcmltZW50XzAzL2RmX2ludGVuc2l0aWVzX3Byb3RlaW5Hcm91cHNfbG9uZ18yMDE3XzIwMThfMjAxOV8yMDIwX04wNTAxNV9NMDQ1NDcvUV9FeGFjdGl2ZV9IRl9YX09yYml0cmFwX0V4YWN0aXZlX1Nlcmllc19zbG90XyM2MDcwLzE0X2V4cGVyaW1lbnRfMDNfZGF0YS5pcHluYg=='). Snakemake will work, but cannot ensure that output files are complete in case of a kill signal or power loss. Please ensure write permissions for the directory C:\test\project\.snakemake
I tried to troubleshoot doing the following
change the folders: Documents, User folder, and like the above in the root folder of my c drive
I tried to manipulate the security settings: Controlled folder or RandsomWare Access, see discussion -> it is deactivated
If I erase the .snakemake it is re-creating upon execution, so I assume I have write access. However, some security setting is disallowing the long filename with the hash
I tried the same workflow on a different Windows 10 machine and there I don't get the error, so I assume it is some windows issue.
Did anyone encounter the same error and found a solution?
I agree it is due to the length of the filename. It seems the default max filename length is 260. The file you pasted has a length of 262. You can edit the registry to allow longer filenames. Also consider opening an issue in snakemake to improve the documentation or otherwise address this issue for windows machines.

Error of "encountered a second time" by find.pm

everyone,
when I deploy my package to a linux environment, I met this error:
.../Linux-2.6c2.5-i686/Ncurses/Ncurses-15766.0-0/lib/libncurses.so.5 is encountered a second time at /apollo/_env/FBAMerchantAutoRemovalDaemon-swit1na.1755067.237551097.1107633519/perl/lib/perl5.8-dist/File/Find.pm line 542.
though I read the perl script, I have no idea what is wrong. I suspect my environment is tainted. Does anyone have idea what is wrong and how can I debug this problem? Thanks a lot in advance!
Zhe
From perldoc File::Find
follow
Causes symbolic links to be followed. Since directory trees with symbolic links (followed) may contain files more than once and may even have cycles, a hash has to be built up with an entry for each file. This might be expensive both in space and time for a large directory tree. See "follow_fast" and "follow_skip" below. If either follow or follow_fast is in effect:
It is guaranteed that an lstat has been called before the user's wanted() function is called. This enables fast file checks involving _. Note that this guarantee no longer holds if follow or follow_fast are not set.
There is a variable $File::Find::fullname which holds the absolute pathname of the file with all symbolic links resolved. If the link is a dangling symbolic link, then fullname will be set to undef.
So, if, for the purposes of your application, if it is OK to follow symlinks, invoke find with the follow option set:
find({ wanted => \&process, follow => 1 }, $dir);
Or, consider if one of the other follow_skip behaviors is more appropriate for your application:
follow_skip
follow_skip==1, which is the default, causes all files which are neither directories nor symbolic links to be ignored if they are about to be processed a second time. If a directory or a symbolic link are about to be processed a second time, File::Find dies.
follow_skip==0 causes File::Find to die if any file is about to be processed a second time.
follow_skip==2 causes File::Find to ignore any duplicate files and directories but to proceed normally otherwise.
It may be that follow_skip => 2 is more appropriate for your application. Only you can make that decision.

Puppet: What's the difference between an ordering arrow and a notification arrow?

In the official Puppet docs it says that there are two chaining arrows:
https://docs.puppetlabs.com/puppet/latest/reference/lang_relationships.html
-> (ordering arrow)
Causes the resource on the left to be applied before the resource on the right. Written with a hyphen and a greater-than sign.
~> (notification arrow)
Causes the resource on the left to be applied first, and sends a refresh event to the resource on the right if the left resource changes. Written with a tilde and a greater-than sign.
Can someone clarify the difference between these two?
The document you mentioned has given the best explanation. If you try to understand it by simple way, using the exist sample.
Package['ntp'] -> File['/etc/ntp.conf'] ~> Service['ntpd']
For File['/etc/ntp.conf'], puppet needs to make sure that the package ntp has been installed before it creates or updates the file ntp.conf. There is no restart request.
But for Service['ntpd'], ntp.conf needs to exist first - that's the same order as ->. * But if puppet finds the file ntp.conf has any changes (whether it is created or updated), service ntp needs to be restarted. That's the difference*.
For more reading about ordering in puppet, please see these documents:
Learning Puppet — Resource Ordering
And do some testing by yourself to understand how it works.
set Package['ntp'], File['/etc/ntp.conf'] ,Service['ntpd'] with the order.
run puppet apply to make sure, Package/File/Service are ready on the system.
make a change in the file ntp.conf.
enable the --debug option with the puppet apply command. The debug log will give you detail in the background - for example, you should see that the file gets updated and the ntpd service gets restarted.

Custom mount point not working on puppet

I'm running Puppet 2.7.14 on RHEL 6.2 (both master and nodes have this configuration).
For the life of me, I can't figure out why I can't make custom mount points work.
If for example, I edit /etc/puppet/fileserver.conf to include the following:
[foo]
path /etc/puppet/files/foo
allow *
And put the file bar.txt in /etc/puppet/files/foo/bar.txt
Then I would expect resources like the following to resolve with no trouble:
file { "bar.txt":
ensure => present,
path => "/var/foo/bar.txt",
source => "puppet:///foo/bar.txt",
}
But this doesn't work! I consistently see error messages like the following:
... Could not evaluate: Could not retrieve information from environment production source(s) puppet:///foo/bar.txt ...
According to all documentation I have read, I have done this correctly, but I just can't get it to work.
Any thoughts?
Seems there's a "gotcha" at work here. A tabstop before the path or allow attribute is not allowed. Very surprising.

Issues running FSL command in Linux environment

I am new to FSL, using version 4.1.8. I am trying to run a script that reads and generates *.nii files, which format is normally supported by FSL. I am calling an FSL function, probtrackx from within Matlab. However, I get the following error message seemingly unable to generate or recognize *.nii files:
** ERROR (nifti_image_read): failed to find header file for '~/Documents/fMRI_data/../DTI/fsl_dti/masks/target_mask_001'
** ERROR: nifti_image_open(~/Documents/fMRI_data/../DTI/fsl_dti/masks/target_mask_001): bad header info
ERROR: failed to open file ~/Documents/fMRI_data/../DTI/fsl_dti/masks/target_mask_001
ERROR: Could not open image ~/Documents/fMRI_data/../DTI/fsl_dti/masks/target_mask_001
The files do exist but FSL fails to recognize them. Any help as to how to correct the issue and get FSL to work properly would be most appreciated. I suspect it's a Linux settings issue, just not sure how to fix it. A solution to a related problem in a previous posting suggested adding ls='ls --color=auto'. I've tried it to on avail.
Some FSL tools assume that the $FSLDIR unix unvironment variable is set, which might not be the case in your MATLAB environment. You can fix that with something like setenv('FSLDIR', '/usr/local/fsl') (modified of course if your FSL installation is in a different place). Some also need the regular FSL setup script to be executed as well: system('. ${FSLDIR}/etc/fslconf/fsl.sh'). See also: http://www.fmrib.ox.ac.uk/fsl/fsl/downloading.html.
Instead of the more complicated probtrackx script, another thing to try first is simply:
system('fslhd ~/Documents/fMRI_data/../DTI/fsl_dti/masks/target_mask_001')
If this fails with the same error, then you know that you entered the path to the data incorrectly. For example, do you mean to have the .. in there?
Also, in the future, the best place to get FSL support is on their mailing list at: https://www.jiscmail.ac.uk/cgi-bin/webadmin?A0=fsl
Does MATLAB have access to run other fsl commands? If you are able to run a command from the command line but not through MATLAB, the MATLAB user may not have access to run fsl or may be looking for some FSL variables.
You might have to do the equivalent of this for a linux system

Resources