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

Cannot obtain a source that uses http with basic web auth

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: PUP 4.8.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • QA Risk Assessment:
      Needs Assessment

      Description

      When I try and access a source from a simple apache server using basic authentication with .htaccess and .htpassword puppet does not retrieve the source.

      Below is output of me running the puppet agent -t with the error. I then show I use that exact same URL to try and retrieve the file and it works while puppet failed.

      [root@smartin-test opt]# puppet agent -t
      Info: Using configured environment 'production'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Loading facts
      Info: Caching catalog for smartin-test
      Info: Applying configuration version '1489003424'
      Notice: /Stage[main]/Phr_uploads/Exec[ead-wait]/returns: executed successfully
      Error: /Stage[main]/Phr_uploads/File[/opt/tomcat-uploads/webapps/ead/WEB-INF/web.xml]: Could not evaluate: Could not retrieve information from environment production source(s) http://serv-foreman:PW@172.16.120.155:81/dev/smartin-test/uploads/ead.xml
      Notice: /Stage[main]/Phr_uploads/Exec[qapthr36-wait]/returns: executed successfully
      Error: /Stage[main]/Phr_uploads/File[/opt/tomcat-uploads/webapps/qapthr36/WEB-INF/web.xml]: Could not evaluate: Could not retrieve information from environment production source(s) http://serv-foreman:PW@172.16.120.155:81/dev/smartin-test/uploads/qapthr36.xml
      Info: Class[Phr_uploads]: Unscheduling all events on Class[Phr_uploads]
      Notice: Applied catalog in 304.80 seconds
      [root@smartin-test opt]# wget http://serv-foreman:PW@172.16.120.155:81/dev/smartin-test/uploads/qapthr36.xml
      --2017-03-08 20:17:31--  http://serv-foreman:*password*@172.16.120.155:81/dev/smartin-test/uploads/qapthr36.xml
      Connecting to 172.16.120.155:81... connected.
      HTTP request sent, awaiting response... 401 Unauthorized
      Connecting to 172.16.120.155:81... connected.
      HTTP request sent, awaiting response... 200 OK
      Length: 3549 (3.5K) [text/xml]
      Saving to: 'qapthr36.xml'
       
      100%[======================================================================================================================================================================================================================>] 3,549       --.-K/s   in 0s
       
      2017-03-08 20:17:32 (13.1 MB/s) - 'qapthr36.xml' saved [3549/3549]
       
      [root@smartin-test opt]#
      

      These are my access and error logs from apache during the attempt from puppet and wget.

      10.101.1.187 - - [08/Mar/2017:14:44:43 -0600] "HEAD /dev/smartin-test/uploads/ead.xml HTTP/1.1" 401 - "-" "Ruby"
      10.101.1.187 - - [08/Mar/2017:14:44:43 -0600] "HEAD /dev/smartin-test/uploads/ead.xml HTTP/1.1" 401 - "-" "Ruby"
      10.101.1.187 - - [08/Mar/2017:14:44:53 -0600] "HEAD /dev/smartin-test/uploads/qapthr36.xml HTTP/1.1" 401 - "-" "Ruby"
      10.101.1.187 - - [08/Mar/2017:14:44:54 -0600] "HEAD /dev/smartin-test/uploads/qapthr36.xml HTTP/1.1" 401 - "-" "Ruby"
      10.101.1.187 - - [08/Mar/2017:14:47:26 -0600] "GET /dev/smartin-test/uploads/qapthr36.xml HTTP/1.1" 401 381 "-" "Wget/1.14 (linux-gnu)"
      10.101.1.187 - serv-foreman [08/Mar/2017:14:47:26 -0600] "GET /dev/smartin-test/uploads/qapthr36.xml HTTP/1.1" 200 3549 "-" "Wget/1.14 (linux-gnu)"
      

      You can see the wget tried, got the 401 and then sent the request with authentication and got the file. You can see puppet just gets the 401 and never tries with the authentication provided.

      I have also tested removing .htaccess and .htpassword and the file can be retrieved.

      This looks like sources with http authentication are not functioning correctly. I also brought this topic up in the freenode IRC channel and was asked to file a ticket.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                scavmartin Shaun Martin
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Zendesk Support