Replacing file errors: getaddrinfo: No such host is known

314 views
Skip to first unread message

pskov...@gmail.com

unread,
Jan 16, 2014, 1:24:50 PM1/16/14
to puppet...@googlegroups.com
Hi guys,

I am new to Puppet and have a very strange error that I cannot seem to solve. I am using Puppet Master 3.4.1 with Apache/Passenger config in CentOS and my Puppet Agent in Windows. 

When I try to create a file that doesn't exist using Puppet, it works fine. In this case, I am simply creating C:\test.txt file.

C:\>puppet agent -t
Info: Retrieving plugin
Info: Caching catalog for sstm-mntr01.colo.svg.local
Info: Applying configuration version '1389894672'
Notice: /Stage[main]/Createfile/File[testfile]/ensure: defined content as '{md5} 803d1a275b8c8c4cc084d54c78c2ed61'
Notice: Finished catalog run in 2.39 seconds

All is well. Now, if I edit the file and save it, and rerun the above command, I get this:

C:\>puppet agent -t
Info: Retrieving plugin
Info: Caching catalog for sstm-mntr01.colo.svg.local
Info: Applying configuration version '1389894672'
Notice: /Stage[main]/Createfile/File[testfile]/content:

Error: Could not back up C:/test.txt: getaddrinfo: No such host is known.
Error: Could not back up C:/test.txt: getaddrinfo: No such host is known.
Error: /Stage[main]/Createfile/File[testfile]/content: change from {md5}fb4bb40e
a8ac9631aa3ad463e41e239e to {md5}803d1a275b8c8c4cc084d54c78c2ed61 failed: Could
not back up C:/test.txt: getaddrinfo: No such host is known.
Notice: Finished catalog run in 1.77 seconds

The module is very simple:

# pwd
/etc/puppet/modules/createfile/manifests
# cat init.pp
 class createfile ($file_arg = undef, $content_arg = undef) {
      case $operatingsystem {
        windows: {
          $default_filename = [ "C:\\test.txt" ]
          $default_content = $fqdn
        }
      }

      if $file_arg == undef {
        $file_real = $default_filename
        }
      else {
        $file_real = $file_arg
      }

      if $content_arg == undef {
        $content_real = $default_content
        }
      else {
        $content_real = $content_arg
      }

      file { 'testfile':
        path    => $file_real,
        ensure  => file,
        content => $content_real
      }
   }

Any ideas what this could be? I can resolve all hosts, master and agent from all servers. I don't even know what it's doing trying to do a getaddrinfo?!

Thanks
Alex

Jose Luis Ledesma

unread,
Jan 16, 2014, 1:46:19 PM1/16/14
to puppet...@googlegroups.com
Could be something about filebucket? Perhaps launching the agent with debug gives some hint

pskov...@gmail.com

unread,
Jan 16, 2014, 3:24:49 PM1/16/14
to puppet...@googlegroups.com
What's filebucket? Don't think I've been introduced to that yet....

Debug or verbose isn't giving anything useful :(

pskov...@gmail.com

unread,
Jan 17, 2014, 9:07:39 AM1/17/14
to puppet...@googlegroups.com
I am an idiot. The issue was indeed with filebucket configuration in site.pp, which was copied over from another server. As soon as I changed it, it started working!

Thanks Jose!
Reply all
Reply to author
Forward
0 new messages