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

File resource can't handle HTTP redirects when server does not accept HEAD requests

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Duplicate
    • PUP 5.3.3
    • None
    • None
    • None
    • Needs Assessment

    Description

      If URL is redirect and server does not handle HEAD requests (like in that case Amazon API who returns 403 when URL after redirect gets HEAD request), Puppet fails with unhelpful message:

      /opt/puppetlabs/bin/puppet apply /tmp/1.pp        
      Notice: Compiled catalog for hydra.devrandom.pl in environment production in 0.01 seconds
      Error: Could not retrieve information from environment production source(s) https://github.com/XANi/go-dpp/releases/download/v0.0.4/dpp.aarch64
      Error: /Stage[main]/Main/File[/tmp/dpp]/ensure: change from 'absent' to 'present' failed: Could not retrieve information from environment production source(s) https://github.com/XANi/go-dpp/releases/download/v0.0.4/dpp.aarch64
      

      no redirect file works fine

       File {
           ensure => present
           }
       
      file { '/tmp/dpp':
          source => 'https://github.com/XANi/go-dpp/releases/download/v0.0.4/dpp.aarch64',
          mode => "644",
          checksum => "sha256",
          checksum_value => '6bda5ca841bf47d81283ee5b73b030c3b82e33e6817d8bb36a1e1006c1b5dd81',
          backup => false,
      }
      file { '/tmp/rnd':
          source => 'http://192.168.1.1/rnd',
          mode => "644",
          checksum => "sha256",
          checksum_value => '19248907fa84d23721987abf90f9f7cbac44c547fd38ef2c0ce31e194eb4d9ed',
          backup => false,
      }
      

      this was present in 4.8.x version too so it seems like something broken since http was added

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              xani Mariusz Gronczewski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support