'Bad header line' error when trying to use apt

Bug #26083 reported by Stuart Bishop
30
This bug affects 3 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Won't Fix
Medium
Unassigned
Declined for Jaunty by Robbie Williamson
Declined for Karmic by Robbie Williamson
Lucid
Won't Fix
Undecided
Unassigned

Bug Description

apt-get upgrade reports:

Get:1 http://archive.ubuntu.com breezy-backports/universe meld
1.1.2-0ubuntu1~breezy1 [361kB]
Err http://archive.ubuntu.com breezy-backports/main rhythmbox 0.9.1-1ubuntu3~breezy1
  Bad header line [IP: 82.211.81.182 80]
Fetched 361kB in 11s (32.8kB/s)
Failed to fetch
http://archive.ubuntu.com/ubuntu/pool/main/r/rhythmbox/rhythmbox_0.9.1-1ubuntu3~breezy1_i386.deb
 Bad header line [IP: 82.211.81.182 80]
E: Unable to fetch some archives, maybe run apt-get update or try with
--fix-missing?

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

If you can still reproduce the problem, please run the following command:
$ sudo apt-get install rhythmbox -o Debug::Acquire::http=true 2> /tmp/apt-fetch.log
and attach the file /tmp/apt-fetch.log to this bugreport.

Revision history for this message
Stuart Bishop (stub) wrote :

I can't reproduce this any more - looks like some sort of a transient issue
(possibly something bad stuck in my ISP's NetCache)

Revision history for this message
Michael Vogt (mvo) wrote :

(In reply to comment #2)
> I can't reproduce this any more - looks like some sort of a transient issue
> (possibly something bad stuck in my ISP's NetCache)

Thanks, do you mind if I close it until it can be reproduced again? The error
message looks like either the archive server or a cache in the way acted strange.

Revision history for this message
Stuart Bishop (stub) wrote :

Sure - close it. The debug info will be here for anyone who happens to get the
same error message in the future.

Revision history for this message
Stuart Bishop (stub) wrote :

I managed get this error again with the debug output (attached)

Revision history for this message
Stuart Bishop (stub) wrote :

Created an attachment (id=5035)
stderr from "sudo apt-get update -o Debug::Acquire::http=true"

Revision history for this message
Stuart Bishop (stub) wrote :

Created an attachment (id=5110)
apt-update gives bad header when the cache is cold

When I first run apt-update in the morning, I get bad header errors. Here is
the debug log with the errors.

Revision history for this message
Stuart Bishop (stub) wrote :

Created an attachment (id=5111)
apt-get update works fine after the cache is primed

The second and subsequent times I run apt-get update, there are no errors.

Revision history for this message
Munzir Taha (منذر طه) (munzirtaha) wrote : Bad header line with apt-get update on dapper drake

munzir@ubuntu:~$ sudo apt-get update -o Debug::Acquire::http=true 2> /tmp/apt-fetch.log
Password:
Get: 1 http://archive.ubuntu.com dapper Release.gpg [189B]
Get: 2 http://security.ubuntu.com dapper-security Release.gpg [189B]
Get: 3 http://archive.ubuntu.com dapper-updates Release.gpg [189B]
Hit http://security.ubuntu.com dapper-security Release
Get: 4 http://archive.ubuntu.com dapper-backports Release.gpg [189B]
Hit http://archive.ubuntu.com dapper Release
Hit http://archive.ubuntu.com dapper-updates Release
Hit http://security.ubuntu.com dapper-security/main Packages
Hit http://archive.ubuntu.com dapper-backports Release
Hit http://security.ubuntu.com dapper-security/restricted Packages
Hit http://security.ubuntu.com dapper-security/universe Packages
Hit http://security.ubuntu.com dapper-security/multiverse Packages
Ign http://archive.ubuntu.com dapper/main Packages
Ign http://archive.ubuntu.com dapper/restricted Packages
Ign http://archive.ubuntu.com dapper/universe Packages
Ign http://archive.ubuntu.com dapper/multiverse Packages
Ign http://archive.ubuntu.com dapper-updates/main Packages
Ign http://archive.ubuntu.com dapper-updates/restricted Packages
Ign http://archive.ubuntu.com dapper-updates/universe Packages
Ign http://archive.ubuntu.com dapper-updates/multiverse Packages
Ign http://archive.ubuntu.com dapper-backports/main Packages
Ign http://archive.ubuntu.com dapper-backports/restricted Packages
Ign http://archive.ubuntu.com dapper-backports/universe Packages
Ign http://archive.ubuntu.com dapper-backports/multiverse Packages
Errhttp://archive.ubuntu.com dapper/main Packages
  Bad header line [IP: 82.211.81.182 80]
Errhttp://archive.ubuntu.com dapper/restricted Packages
  Bad header line [IP: 82.211.81.182 80]
Errhttp://archive.ubuntu.com dapper/universe Packages
  Bad header line [IP: 82.211.81.182 80]
Errhttp://archive.ubuntu.com dapper/multiverse Packages
  Got a single header line over 360 chars [IP: 82.211.81.182 80]
Errhttp://archive.ubuntu.com dapper-updates/main Packages
  Got a single header line over 360 chars [IP: 82.211.81.182 80]
Hit http://archive.ubuntu.com dapper-updates/restricted Packages
Hit http://archive.ubuntu.com dapper-updates/universe Packages
Hit http://archive.ubuntu.com dapper-updates/multiverse Packages
Hit http://archive.ubuntu.com dapper-backports/main Packages
Hit http://archive.ubuntu.com dapper-backports/restricted Packages
Hit http://archive.ubuntu.com dapper-backports/universe Packages
Hit http://archive.ubuntu.com dapper-backports/multiverse Packages
Fetched 4B in 2m51s (0B/s)
Reading package lists... Done

Revision history for this message
Munzir Taha (منذر طه) (munzirtaha) wrote : apt-get update Debug::Acquire::http=true

Not sure what's wrong with the header but if I can guess I would say the Content-Length could be the problem.

Revision history for this message
Carthik Sharma (carthik) wrote : Re: 'Bad header line' error trying to update breezy/dapper

Changing to confirmed.

Changed in apt:
status: Unconfirmed → Confirmed
Revision history for this message
IC Raibow (icrbow) wrote :

The bug has struck me on dapper 6.06(.1) with nginx as web server on frontend and newer nginx on backand.
It don't appear then connecting directrly to a newer one on localhost.

Revision history for this message
Daniel Harvey (daniel.harvey) wrote :

I get this running dapper with apt 0.6.43.3ubuntu when running apt-get on the package linux-image-686.

As requested by Michael, I have attached the stdout and stderr for the apt-get debug.

If you would like me to test anything else, please let me know.

It does not happen on every package, just some - so I will hold off manually upgrading in case you want me to test something.

Cheers.

Revision history for this message
Daniel Harvey (daniel.harvey) wrote :

Standard error debug related to the previous comment above.

Revision history for this message
Daniel Harvey (daniel.harvey) wrote :

I can't reproduce this any more... something in the archive changed over the last week, and it now works. For the record, up until then it was 100% reproducible for the linux-image-686 package as described above.

...

Revision history for this message
Peter Miller (pmiller-opensource) wrote :

I also get this on Dapper.
When I use telnet, it is easy to see that the header it is complaining about is generated by Apache.
In my case, the first three characters of the Content-Encoding: header are garbage.
This may be an apache bug.

Revision history for this message
Austin Jones (ajones345) wrote :

I am also getting 'bad header line' and 'got a single header line over 360 chars' in both my ubuntu 8.10 and my linux mint 7.0 while using apt/synaptic. It usually only appears while downloading anything related to KDE(though there are some exceptions)...

Changed in apt (Ubuntu):
assignee: Michael Vogt (mvo) → Austin Jones (ajones345)
assignee: Austin Jones (ajones345) → Michael Vogt (mvo)
Revision history for this message
Austin Jones (ajones345) wrote :

Darnit, now my brand new Ubuntu 9.04 installation is having the same problem! Does a proxy have something to do with this?

summary: - 'Bad header line' error trying to update breezy/dapper
+ 'Bad header line' error when trying to use apt
Revision history for this message
Austin Jones (ajones345) wrote :

I REALLY would like to see this fixed at least in Karmic because this error is what usually almost instantly turns me away from ubuntu/Linux in general.

Revision history for this message
JuanDA (juandeandres) wrote :

I have this problem after upgrade from 9.04 to 9.10.

Revision history for this message
Thomas (teclab-at) wrote :

I've got similar errors - the header problem and this:

Err http://gb.archive.ubuntu.com karmic-updates/main libgssapi-krb5-2 1.7dfsg~beta2-1ubuntu0.5
 Got a single header line over 360 chars

the whole update process is currently stucked ...

thx

Revision history for this message
Bump (bump55) wrote :

same problem in kubuntu 10.04 LTS

Revision history for this message
Juha Kallioinen (juha-kallioinen) wrote :

I've recently run into this problem with apt (in 32 bit 10.04 and 10.10) and http deb-url's.

For me the reason was that I was trying to download more than 4 gigabytes of packages with one single apt-get from one repository. All the packages were originating from the same server/url (I had my own trivial repository).

In my case the real problem is that apt uses unsigned long variables for counters and file size and the variables overflow after 4 gigs have been downloaded. For the subsequent packages the payload is treated as a part of the http headers and that's why I got Bad header line and the single header line over 360 characters errors.

I don't see this problem in 64 bit installations.

 Juha

Revision history for this message
Bump (bump55) wrote :

I made a clean installation of kubuntu 10.10 and for now it goes ok.

Changed in apt (Ubuntu):
assignee: Michael Vogt (mvo) → nobody
Changed in apt (Ubuntu Lucid):
status: New → Won't Fix
Changed in apt (Ubuntu):
status: Confirmed → Won't Fix
milestone: ubuntu-6.06 → none
Revision history for this message
statistic (m-t-lindsay) wrote :

This bug is still an issue for normal use cases, the 360 character limit is causing issues with some repositories. This thread gave me a way to work around it though using that debug parameter you listed showed me which request and header was the problem. In the end I ran my requests through a varnish server stripping cookies out of the response. Maybe ignore cookie headers since they seem to be the offending header line, and probably will be the only one that is. Better solution would probably to raise the maximum length allowed. I've attached the relevant log that shows the problem.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.