Puppet-Librarian, windows and Error: No such file or directory

255 Views Asked by At

On windows 2012 server edition, when I run puppet-librarian install I get the error below.

Error: No such file or directory - C:/Users/Administrator/infrastructure/.tmp/librarian/cache/source/puppet/forge/forgeapi_puppetlabs_com/opentable-windowsfeature/999.999.999/cache/tmp-unpacker20150907-1308-19kvk70/opentable-windowsfeature- 999.999.999/spec/acceptance/nodesets/windows-2008R2-serverstandard-x64.yml Error: Try 'puppet help module install' for usage

I think this is a generic windows problem and it took me a while to figure out the error. Windows has a 255 char maximum length for the absolute file name. Puppet-librarian doesn't give a good error message to indicate this is the root cause. Maximum filename length in NTFS (Windows XP and Windows Vista)?.

2

There are 2 best solutions below

0
On

My solution was to move the root directory from "C:/Users/Administrator/infrastructure" to "C:/infrastructure".

0
On

The issue with long file paths is likely due to puppet-librarian using PMT (Puppet Module Tool) to install the module. It's compounded by the fact that Librarian starts with this path C:/Users/Administrator/infrastructure/.tmp/librarian/cache/source/puppet/forge/forgeapi_puppetlabs_com/opentable-windowsfeature/999.999.999/, which is already long, and then PMT adds cache/tmp-unpacker20150907-1308-19kvk70/opentable-windowsfeature-999.999.999 to the path, which exasperates the length even more.

PMT has issues with long paths. We'll be fixing that by adding LFN (Long File Name) support to it in a future release. Vote and watch PUP-4866 to know when this is fixed.

It appears that puppet-librarian will also need to be fixed due to the following call:

command.push(*[path.to_s, "--module_repository", module_repository, "--modulepath", path.to_s, "--module_working_dir", path.to_s, "--ignore-dependencies", target])