apt_repository oddity?


#1

The recipe has the code

apt_repository “haproxy” do
uri "http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu"
distribution node[‘lsb’][‘codename’]
components [‘main’]

When chef-solo is run with that recipe, I get

Failed to fetch
http://ppa.launchpad.net/vbernat/haproxy-1.5/dists/precise/main/

Where did the ‘ubuntu’ component of the path go?

mjb.


#2

On Thursday, January 9, 2014 at 1:36 PM, Mark J Bradakis wrote:

The recipe has the code

apt_repository “haproxy” do
uri "http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu"
distribution node[‘lsb’][‘codename’]
components [‘main’]

When chef-solo is run with that recipe, I get

Failed to fetch
http://ppa.launchpad.net/vbernat/haproxy-1.5/dists/precise/main/

Where did the ‘ubuntu’ component of the path go?

mjb.

HTTP redirect:

$ curl -I http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu

HTTP/1.1 301 Moved Permanently
Date: Thu, 09 Jan 2014 21:37:55 GMT
Server: Apache/2.2.14 (Ubuntu)
Location: http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu/
Vary: Accept-Encoding
Content-Type: text/html; charset=iso-8859-1


Daniel DeLeo


#3

On Thursday, January 9, 2014 at 1:38 PM, Daniel DeLeo wrote:

On Thursday, January 9, 2014 at 1:36 PM, Mark J Bradakis wrote:

The recipe has the code

apt_repository “haproxy” do
uri "http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu"
distribution node[‘lsb’][‘codename’]
components [‘main’]

When chef-solo is run with that recipe, I get

Failed to fetch
http://ppa.launchpad.net/vbernat/haproxy-1.5/dists/precise/main/

Where did the ‘ubuntu’ component of the path go?

mjb.

HTTP redirect:

$ curl -I http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu

HTTP/1.1 301 Moved Permanently
Date: Thu, 09 Jan 2014 21:37:55 GMT
Server: Apache/2.2.14 (Ubuntu)
Location: http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu/
Vary: Accept-Encoding
Content-Type: text/html; charset=iso-8859-1


Daniel DeLeo

Oops, responded too soon, the redirect just adds a trailing slash. #DERP. Though adding it might fix your issue.


#4

Daniel DeLeo wrote:

HTTP redirect:

$ curl -I http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu

HTTP/1.1 301 Moved Permanently
Date: Thu, 09 Jan 2014 21:37:55 GMT
Server: Apache/2.2.14 (Ubuntu)
Location: http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu/
Vary: Accept-Encoding
Content-Type: text/html; charset=iso-8859-1

But doing a wget of

http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu/dists/precise/main/binary-amd64/Packages

fetches the file just fine, so I thought that apt_repository would also
be able to find it.

mjb.


#5

You may have to add arch to your apt_repository declaration.

Can you provide the rendered /etc/apt/sources.list.d/haproxy.list file?

As well as the rest of the log line from “Failed to fetch” - or is that it?

On Thu, Jan 9, 2014 at 4:47 PM, Mark J Bradakis mark@bradakis.com wrote:

Daniel DeLeo wrote:

HTTP redirect:

$ curl -I http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu

HTTP/1.1 301 Moved Permanently
Date: Thu, 09 Jan 2014 21:37:55 GMT
Server: Apache/2.2.14 (Ubuntu)
Location: http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu/
Vary: Accept-Encoding
Content-Type: text/html; charset=iso-8859-1

But doing a wget of

http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu/
dists/precise/main/binary-amd64/Packages

fetches the file just fine, so I thought that apt_repository would also be
able to find it.

mjb.


#6

Mike wrote:

Can you provide the rendered /etc/apt/sources.list.d/haproxy.list file?

That was the clue. I removed the old file, let the recipe generate a
new on and it
worked fine.

mjb.