User::Agent throwing bogus "Bad hostname" errors after a while

Bug #33524 reported by Reinhard Tartler
10
Affects Status Importance Assigned to Milestone
libwww-perl (Debian)
Fix Released
Unknown
libwww-perl (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

apt-cacher spits Internal Server Errors 500 - "Bad Hostname" after being in use for some time. Looking at the debian bts, this seems to be a bug in libwww-perl, which is used by apt-cacher.

Revision history for this message
In , Marc Haber (mh+debian-bugs) wrote : Re: Bug#332748: apt-cacher: gets confused after some time, returns error 500

On Sat, Oct 08, 2005 at 01:12:08PM +0200, Marc Haber wrote:
> See attached log of a failed aptitude update run, and the working one
> after restarting apt-cacher (2400 lines).

This is not related to: data expiring ("EXPIRED") - apt-cacher has
successfully handled that case this morning, and it is not related to
CLEANUPREFRESH (the broken state was today entered at 14:00 which is
not near a CLEANUPREFRESH event).

Greetings
Marc

--
-----------------------------------------------------------------------------
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835

Revision history for this message
In , Eduard Bloch (edi-gmx) wrote :

Moin Marc!
Marc Haber schrieb am Samstag, den 08. Oktober 2005:

> Package: apt-cacher
> Severity: normal
>
> Hi,
>
> after being in use for some time (like on a computer idling over
> night, which uses hourly cron-apt to check for new updates),
> apt-cacher gets confused and starts returning error 500. After
> terminating and restarting apt-cacher, everything is fine.
>
> See attached log of a failed aptitude update run, and the working one
> after restarting apt-cacher (2400 lines).

I do not understand where it comes from. Following this report, the
errors are reported by the http client module, the fetcher part. But it
does not make any sense. The HTTP user agent object is created
separated in every forked process.

Further, I think there are bad things happening with your connection,
see
Sat Oct 8 13:01:18 2005|127.0.0.1|debug: Header sent: 500 (Internal Server Error) Can't connect to debian.debian.zugschlus.de:80 (Bad hostname 'debian.debian.zugschlus.de')

So where does the DNS error come from? Broken nscd or something like
that? libc6 upgrade without restartint services?

Eduard.

--
Immerhin meint die Filmförderungsanstalt, im Jahr 2002 seien 59
Millionen CD-Rohlinge von 5,9 Millionen Nutzern mit Filmen bespielt
worden, im Durchschnitt also zwölf Rohlinge pro Anwender.
                -- <http://www.heise.de/newsticker/data/see-08.04.03-000/>

Revision history for this message
In , Marc Haber (mh+debian-bugs) wrote :

On Sun, Oct 09, 2005 at 05:33:47PM +0200, Eduard Bloch wrote:
> > See attached log of a failed aptitude update run, and the working one
> > after restarting apt-cacher (2400 lines).
>
> I do not understand where it comes from. Following this report, the
> errors are reported by the http client module, the fetcher part. But it
> does not make any sense. The HTTP user agent object is created
> separated in every forked process.
>
> Further, I think there are bad things happening with your connection,
> see
> Sat Oct 8 13:01:18 2005|127.0.0.1|debug: Header sent: 500 (Internal Server Error) Can't connect to debian.debian.zugschlus.de:80 (Bad hostname 'debian.debian.zugschlus.de')
>
> So where does the DNS error come from? Broken nscd or something like
> that? libc6 upgrade without restartint services?

Today's failure happened out of the blue when no administration work
was done - none on the system running apt-cacher, and none on the
system running the full service resolver for the apt-cacher box. The
connection and DNS servers were fine, shown by mail services
processing incoming messages without delay.

Greetings
Marc

--
-----------------------------------------------------------------------------
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835

Revision history for this message
In , Eduard Bloch (edi-gmx) wrote :

retitle 332748 User::Agent throwing bogus "Bad hostname" errors after a while
reassign 332748 libwww-perl
thanks

Marc Haber schrieb am Sonntag, den 09. Oktober 2005:

> On Sun, Oct 09, 2005 at 05:33:47PM +0200, Eduard Bloch wrote:
> > > See attached log of a failed aptitude update run, and the working one
> > > after restarting apt-cacher (2400 lines).
> >
> > I do not understand where it comes from. Following this report, the
> > errors are reported by the http client module, the fetcher part. But it
> > does not make any sense. The HTTP user agent object is created
> > separated in every forked process.
> >
> > Further, I think there are bad things happening with your connection,
> > see
> > Sat Oct 8 13:01:18 2005|127.0.0.1|debug: Header sent: 500 (Internal Server Error) Can't connect to debian.debian.zugschlus.de:80 (Bad hostname 'debian.debian.zugschlus.de')
> >
> > So where does the DNS error come from? Broken nscd or something like
> > that? libc6 upgrade without restartint services?
>
> Today's failure happened out of the blue when no administration work
> was done - none on the system running apt-cacher, and none on the
> system running the full service resolver for the apt-cacher box. The
> connection and DNS servers were fine, shown by mail services
> processing incoming messages without delay.

I am reassigning this report to LWP since it throws those errors and we
cannot see the reason. I don't think this is a fault in apt-cacher code,
because all it does is:

use LWP::User::Agent -> start a daemon -> accept a connection -> fork ->
-> create the LWP::User::Agent object in the child and use it.

The child processes should not have much in common, the bug most come
either from Perl itself or from some internal failure in the LWP modules
in the parent process, since all child processes forked from it after a
certain moment show the same symptoms.

Eduard.
--
Wer wirklich noch einen 4.x-Browser benutzt, dem kann leider nicht mehr
geholfen werden. Die haben soviele Sicherheitsloecher, da koennten wir per
www.linuxtag.org, Exploit und etwas Scriptmagic einen neuen Browser von
Remote installieren.
                                              // Michael Kleinhenz, lt2k-ml

Revision history for this message
Reinhard Tartler (siretart) wrote :

apt-cacher spits Internal Server Errors 500 - "Bad Hostname" after being in use for some time. Looking at the debian bts, this seems to be a bug in libwww-perl, which is used by apt-cacher.

Revision history for this message
Reinhard Tartler (siretart) wrote :

I'm using apt-cacher to point to archive.ubuntu.com. I noticed that it has 2 A records. After editing /etc/hosts to mention only one A record, the problem didn't occur

Revision history for this message
Simon Law (sfllaw) wrote :

Reinhard,

Can you still reproduce it?

If so, can you use `strace -Ff -e network -p <pid>` and attach it
to the right apt-cacher process? Perhaps we can see why it isn't
resolving the hostname properly?

Thanks.

Changed in libwww-perl:
status: Unconfirmed → Needs Info
Revision history for this message
Reinhard Tartler (siretart) wrote :

I'm sorry, I don't use apt-cacher any longer, and cannot easily test this :(

Simon Law (sfllaw)
Changed in libwww-perl:
status: Needs Info → Unconfirmed
Changed in libwww-perl:
status: New → Incomplete
Revision history for this message
Connor Imes (ckimes) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New".
This applies to the Ubuntu part, a Debian triager can decide what to do with the Debian report.
Thanks again!

Changed in libwww-perl:
status: Incomplete → Invalid
Revision history for this message
In , Antonio Radici (antonio-dyne) wrote :

tag 332748 +unreproducible moreinfo
notfound 332748 5.820-1
thanks

Hi,
can you still reproduce this? my apt-cacher is working fine,
probably this was fixed in one of the latest LWP releases?

Cheers
Antonio

Changed in libwww-perl:
status: New → Incomplete
Changed in libwww-perl (Debian):
status: Incomplete → Fix Released
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.