Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-1389

Windows File: Error: ReplaceFile is unable to find file (or file resources generating 0 byte files): replace_file errors

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: PUP 3.4.1, PUP 3.4.2
    • Fix Version/s: PUP 3.4.3
    • Component/s: None
    • Labels:
    • Environment:

      Windows 2012 R2, Hyper-V Server 2012r2

    • Template:
    • Story Points:
      2
    • Sprint:
      Week 2014-1-8 to 2014-1-15, Week 2014-1-15 to 2014-1-21, Week 2014-1-22 to 2014-1-29

      Description

      Module to reproduce the issue is here:
      https://github.com/openstack-hyper-v/puppet-jenkins/

      Specifically the slave.pp file and the windows file components found in it.

      Notice: /Stage[main]/Jenkins::Slave/File[C:\ProgramData\jenkins-slave\jenkins-slave.xml]/content:
       
      Info: FileBucket got a duplicate file {md5}d41d8cd98f00b204e9800998ecf8427e
      Info: /Stage[main]/Jenkins::Slave/File[C:\ProgramData\jenkins-slave\jenkins-slave.xml]: Filebucketed
       C:/ProgramData/jenkins-slave/jenkins-slave.xml to puppet with sum d41d8cd98f00b204e9800998ecf8427e
      Error: ReplaceFile(C:/ProgramData/jenkins-slave/jenkins-slave.xml, C:/ProgramData/jenkins-slave/jenkins-slave.xml20140107-2944-124j5d4):  The system cannot find the file specified.
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/util/windows/file.rb:14:in `replace_file'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/util.rb:456:in `replace_file'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/type/file.rb:720:in `write'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/type/file/content.rb:150:in `sync'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/transaction/resource_harness.rb:193:in `sync'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/transaction/resource_harness.rb:130:in `sync_if_needed'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/transaction/resource_harness.rb:82:in `block in perform_changes'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/transaction/resource_harness.rb:81:in `each'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/transaction/resource_harness.rb:81:in `perform_changes'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/transaction/resource_harness.rb:18:in `evaluate'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/transaction.rb:174:in `apply'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/transaction.rb:187:in `eval_resource'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/transaction.rb:117:in `call'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/transaction.rb:117:in `block (2 levels) in evaluate'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/util.rb:327:in `block in thinmark'
      C:/Program Files (x86)/Puppet Labs/Puppet/sys/ruby/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/util.rb:326:in `thinmark'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/transaction.rb:117:in `block in evaluate'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/graph/relationship_graph.rb:118:in `traverse'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/transaction.rb:108:in `evaluate'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/resource/catalog.rb:164:in `block in apply'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/util/log.rb:149:in `with_destination'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/transaction/report.rb:108:in `as_logging_destination'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/resource/catalog.rb:163:in `apply'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/configurer.rb:125:in `block in apply_catalog'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/util.rb:161:in `block in benchmark'
      C:/Program Files (x86)/Puppet Labs/Puppet/sys/ruby/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/util.rb:160:in `benchmark'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/configurer.rb:124:in `apply_catalog'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/configurer.rb:192:in `run'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:44:in `block (4 levels) in run'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/agent/locker.rb:20:in `lock'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:44:in `block (3 levels) in run'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:114:in `with_client'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:41:in `block (2 levels) in run'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:79:in `run_in_fork'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:40:in `block in run'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:179:in `call'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:179:in `controlled_run'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:38:in `run'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/application/agent.rb:355:in `onetime'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/application/agent.rb:321:in `run_command'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:364:in `block (2 levels) in run'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:470:in `plugin_hook'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:364:in `block in run'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/util.rb:478:in `exit_on_fail'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:364:in `run'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/util/command_line.rb:137:in `run'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/lib/puppet/util/command_line.rb:91:in `execute'
      C:/Program Files (x86)/Puppet Labs/Puppet/puppet/bin/puppet:4:in `<main>'
      Error: /Stage[main]/Jenkins::Slave/File[C:\ProgramData\jenkins-slave\jenkins-slave.xml]/content: change from {md5}d41d8cd98f00b204e9800998ecf8427e to {md5}7fdfe67c86f483cc0f89d5842da3aab6 failed:
      ReplaceFile(C:/ProgramData/jenkins-slave/jenkins-slave.xml, C:/ProgramData/jenkins-slave/jenkins-slave.xml20140107-2944-124j5d4):  The system cannot find the file specified.
      Notice: /Stage[main]/Jenkins::Slave/Exec[sc_create_service]: Dependency File[C:\ProgramData\jenkins-slave\jenkins-slave.exe] has failures: true
      Notice: /Stage[main]/Jenkins::Slave/Exec[sc_create_service]: Dependency File[C:\ProgramData\jenkins-slave\jenkins-slave.xml] has failures: true
      Warning: /Stage[main]/Jenkins::Slave/Exec[sc_create_service]: Skipping because of failed dependencies
      

      Error occurs if file present or not.

      icacls on files causing issues

      C:\ProgramData\jenkins-slave>icacls jenkins-slave.exe
      jenkins-slave.exe BUILTIN\Administrators:(M,WDAC,WO)
                        HV-COMPUTE09\None:(RX,W)
                        Everyone:(RX,W)
                        NT AUTHORITY\SYSTEM:(F)
       
      Successfully processed 1 files; Failed processing 0 files
       
      C:\ProgramData\jenkins-slave>icacls jenkins-slave.xml
      jenkins-slave.xml NT AUTHORITY\SYSTEM:(I)(F)
                        BUILTIN\Administrators:(I)(F)
                        BUILTIN\Users:(I)(RX)
       
      Successfully processed 1 files; Failed processing 0 files
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ppouliot Peter Pouliot
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support