"change from absent to present failed...no such file or directory"

1,011 views
Skip to first unread message

gangadhar r

unread,
May 8, 2017, 3:14:39 PM5/8/17
to Puppet Users
I have written a simple puppet program and it's throwing an error

Any help from here will be appreciated 

Puppet program:


package { 'ultravnc':
    ensure   => latest,
    provider => 'chocolatey',
  }

  file { 'C:\Program Files\uvnc bvba\UltraVnc':
    ensure => 'present',
    source => 'puppet:///modules/nrhlteamcity/UltraVNC.ini',
  }

  service { 'uvnc_service':
    ensure  => 'running',
}

  Package['ultravnc'] -> File['C:\Program Files\uvnc bvba\UltraVnc'] ~> Service['uvnc_service']

Error:

Applying configuration version '48ad96db3a314f99325dde5f328dab1e54c98a00' Error: Could not set 'file' on ensure: No such file or directory @ dirsmkdir - C:/Program Files/uvnc bvba/UltraVnc2017 0508-5836-rk38fl.lock at /etc/puppetlabs/code/environments/production/site/nrhlteamcity/manifests/ultravnc.pp:13 Error: Could not set 'file' on ensure: No such file or directory @ dirsmkdir - C:/Program Files/uvnc bvba/UltraVnc2017 0508-5836-rk38fl.lock at /etc/puppetlabs/code/environments/production/site/nrhlteamcity/manifests/ultravnc.pp:13 Wrapped exception: No such file or directory @ dirsmkdir - C:/Program Files/uvnc bvba/UltraVnc20170508-5836-rk38fl.lock Error: /Stage[main]/Nrhlteamcity::Ultravnc/File[C:\Program Files\uvnc bvba\UltraVnc]/ensure: change from absent to file failed: Could not set 'file' on ensure: No such file or directory @ dirsmkdir - C:/Program Files/uvnc bvba/UltraVnc201 70508-5836-rk38fl.lock at 

I was expecting the Puppet will get the package and install the ULTRAVNC module which actually creates a directory (C:\Program Files\uvnc bvba\UltraVnc\) and then move the file "UltraVNC.ini" and then start the "service". From the error it looks like the error related to the "file" resource. 

gangadhar r

unread,
May 8, 2017, 3:51:39 PM5/8/17
to Puppet Users

I have noticed the path provided for the "file" resource

"file { 'C:\Program Files\uvnc bvba\UltraVnc':"

As puppet assumes the "\" as escape character so puppet was unable to create the required file for me. I have changed the line to

"file { 'c:/Program Files/uvnc bvba/UltraVnc/UltraVNC.ini':"

Reply all
Reply to author
Forward
0 new messages