FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 12-13-2007, 01:24 AM
Nick Boyce
 
Default aptitude has poor exit status behaviour

In the course of scripting some aptitude upgrade activity I've found
that (Etch) aptitude's error handling [cough] falls short of optimum
behaviour. In particular it returns an exit status of zero in various
failure situations, which is unhelpful, to say the least.

For example:

Although it helpfully returns 1 if you tell it nonsense ...

# aptitude hshshsh
Unknown command "hshshsh"
aptitude 0.2.15.9
==> exit status 1

... and 'aptitude update' as non-root fails with 255 ...

$ aptitude update
E: Could not open lock file /var/lib/apt/lists/lock -
open (13 Permission denied)
E: Couldn't lock list directory..are you root?
==> exit status 255

... if you're behind a proxy firewall (such as inside my employer's
network) then various kinds of failure all exit with 0 ...

Here's 'aptitude update' as root but with the required firewall proxy
not specified in /etc/apt/apt.conf :

# aptitude update
Err http://ftp.de.debian.org etch Release.gpg
Could not resolve 'ftp.de.debian.org'
Err http://security.debian.org etch/updates Release.gpg
Could not resolve 'security.debian.org'
Ign http://ftp.de.debian.org etch Release
Ign http://ftp.de.debian.org etch/main Packages/DiffIndex
Err http://ftp.de.debian.org etch/main Packages
Could not resolve 'ftp.de.debian.org'
Ign http://security.debian.org etch/updates Release
Ign http://security.debian.org etch/updates/main Packages/DiffIndex
Ign http://security.debian.org etch/updates/contrib Packages/DiffIndex
Err http://security.debian.org etch/updates/main Packages
Could not resolve 'security.debian.org'
Err http://security.debian.org etch/updates/contrib Packages
Could not resolve 'security.debian.org'
Reading package lists...
==> exit status 0

Here's 'aptitude update' with the firewall proxy specified but an
incorrect username/password :

# aptitude update
Ign http://ftp.de.debian.org etch Release.gpg
Ign http://security.debian.org etch/updates Release.gpg
Ign http://ftp.de.debian.org etch Release
Ign http://security.debian.org etch/updates Release
Ign http://ftp.de.debian.org etch/main Packages/DiffIndex
Ign http://security.debian.org etch/updates/main Packages/DiffIndex
Err http://ftp.de.debian.org etch/main Packages
403 Forbidden
Ign http://security.debian.org etch/updates/contrib Packages/DiffIndex
Err http://security.debian.org etch/updates/main Packages
403 Forbidden
Err http://security.debian.org etch/updates/contrib Packages
403 Forbidden
Reading package lists... Done
==> exit status 0

Here's "aptitude update" with the firewall proxy specified but
the previously valid password has expired :
# aptitude update
Ign http://ftp.de.debian.org etch Release.gpg
Ign http://security.debian.org etch/updates Release.gpg
Ign http://ftp.de.debian.org etch Release
Ign http://security.debian.org etch/updates Release
Ign http://ftp.de.debian.org etch/main Packages/DiffIndex
Ign http://security.debian.org etch/updates/main Packages/DiffIndex
Err http://ftp.de.debian.org etch/main Packages
407 Proxy Authentication Required
Ign http://security.debian.org etch/updates/contrib Packages/DiffIndex
Err http://security.debian.org etch/updates/main Packages
407 Proxy Authentication Required
Err http://security.debian.org etch/updates/contrib Packages
407 Proxy Authentication Required
Reading package lists... Done
==> exit status 0

At least that's what happens with my company's firewall. Surely
'aptitude' should be able to do better than that ?

I did a quick test with 'apt-get' on Sarge, and found it returns exit
status 100 in at least some of these situations (I didn't test all of
them), so there seems to have been some regression here :

# apt-get update
Err http://security.debian.org sarge/updates/main Packages
407 Proxy Authentication Required
Err http://de.samba.org sarge/samba Packages
407 Proxy Authentication Required
[...]
Failed to fetch
http://de.samba.org/samba/ftp/Binary_Packages/Debian/dists
/sarge/samba/binary-i386/Packages.gz
407 Proxy Authentication Required
Reading Package Lists...
E: Some index files failed to download, they have been ignored,
or old ones used instead.
==> exit status 100

I found 3 related bug reports against aptitude, all apparently still open :

http://bugs.debian.org/233129
[wishlist; from Feb.2004; aptitude exits with zero on dialup connection
failure]

http://bugs.debian.org/282408
[minor; from Nov.2004; aptitude exits with zero if installation fails or
is cancelled by the user after downloading packages]

http://bugs.debian.org/445035
[important: from Oct.2007; aptitude exits with zero if installation
fails because nonexistent package requested]


Does anyone think another bug report is called for ?
It looks as though it's known that the error handling behaviour
needs attention but it's not high on anybody's TODO list.

And is there a better list to post this to ? A check shows only
debian-dpkg(-bugs) or debian-qa(-packages) as being likely.

Any comments welcome.

Cheers,
Nick Boyce


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 12-13-2007, 03:05 AM
Andrew Sackville-West
 
Default aptitude has poor exit status behaviour

On Thu, Dec 13, 2007 at 02:24:15AM +0000, Nick Boyce wrote:
> In the course of scripting some aptitude upgrade activity I've found
> that (Etch) aptitude's error handling [cough] falls short of optimum
> behaviour. In particular it returns an exit status of zero in various
> failure situations, which is unhelpful, to say the least.

I think it's sort of a tricky problem. Just because a particular host
couldn't be resolved, or some other problem doesn't necessarily mean
that aptitude itself has failed. Granted, it makes scripting difficult
if you can't check the exit status. I'm curious to know if it produces
error codes when there are actual packaging problems (like a dpkg
error).

snip some aptitude error output.

>
> I did a quick test with 'apt-get' on Sarge, and found it returns exit
> status 100 in at least some of these situations (I didn't test all of
> them), so there seems to have been some regression here :

apt-get is a different program. There's not a regression unless the
lack of error codes appears in apt-get in etch and later.

...snip apt-get output

>
> I found 3 related bug reports against aptitude, all apparently still open :
>
> http://bugs.debian.org/233129
> [wishlist; from Feb.2004; aptitude exits with zero on dialup connection
> failure]
>
> http://bugs.debian.org/282408
> [minor; from Nov.2004; aptitude exits with zero if installation fails or
> is cancelled by the user after downloading packages]
>
> http://bugs.debian.org/445035
> [important: from Oct.2007; aptitude exits with zero if installation
> fails because nonexistent package requested]
>
>
> Does anyone think another bug report is called for ?

without reading them, no. It may be that some discussion on those
bugs, or a ping, is in order, but not necessarily. see below.

> It looks as though it's known that the error handling behaviour
> needs attention but it's not high on anybody's TODO list.
>
> And is there a better list to post this to ? A check shows only
> debian-dpkg(-bugs) or debian-qa(-packages) as being likely.

well, the developer of aptitude is known to read this list and respond
to aptitude issues, so he'll likely see this.

Like any of these projects, it's a volunteer thing and if it's not a
priority for the devs, then it won't get done. If you can provide
patches, I'm sure you'll get attention.

It can, I know, be frustrating, especially if you are relying on a
package and don't have the resources to contribute yourself. But
sometimes, all it takes is a willingness to discuss the issue
rationally and calmly with the dev and see what's what. It may be that
he doesn't fully understand that people want this feature. Likewise,
he may have good reasons to *not* implement what you're looking for.


A
 
Old 12-13-2007, 03:36 AM
Daniel Burrows
 
Default aptitude has poor exit status behaviour

On Thu, Dec 13, 2007 at 02:24:15AM +0000, Nick Boyce <nick@glimmer.demon.co.uk> was heard to say:
> Does anyone think another bug report is called for ?
> It looks as though it's known that the error handling behaviour
> needs attention but it's not high on anybody's TODO list.

I'm currently busy working on other parts of the program. If you want
this in a hurry your best bet is to either send a working patch to a bug
report or (if such a patch already exists) to harass me via email until
I apply it. :-) Preferably all such harassment should be conducted via
emails sent to bug reports so that it gets archived with the bug and
filtered into my debbugs folder.

> And is there a better list to post this to ? A check shows only
> debian-dpkg(-bugs) or debian-qa(-packages) as being likely.

The most appropriate list would be aptitude-devel@lists.alioth.debian.org.
deity@lists.debian.org would be the closest alternative.

Daniel


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 12-13-2007, 12:56 PM
Nick Boyce
 
Default aptitude has poor exit status behaviour

Andrew Sackville-West wrote:
> On Thu, Dec 13, 2007 at 02:24:15AM +0000, Nick Boyce wrote:
>
>> (Etch) aptitude's error handling [cough] falls short of optimum
>> behaviour. In particular it returns an exit status of zero in various
>> failure situations
[...]
>> I did a quick test with 'apt-get' on Sarge, and found it returns exit
>> status 100 in at least some of these situations (I didn't test all of
>> them), so there seems to have been some regression here :
>
> apt-get is a different program. There's not a regression unless the
> lack of error codes appears in apt-get in etch and later.

Agreed it's a different program (though I would guess it shares at least
some code) - but what I meant was a regression in system functionality
as a whole, rather than in 'aptitude' specifically. Sorry if I abused
the term.

Cheers,
Nick Boyce
--
'If you don't pray in my school, I won't think in your church'


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 12-13-2007, 12:57 PM
Nick Boyce
 
Default aptitude has poor exit status behaviour

Daniel Burrows wrote:
> On Thu, Dec 13, 2007 at 02:24:15AM +0000, Nick Boyce <nick@glimmer.demon.co.uk> was heard to say:
>
>> Does anyone think another bug report is called for ?
>> It looks as though it's known that the error handling behaviour
>> needs attention but it's not high on anybody's TODO list.
>
> I'm currently busy working on other parts of the program.

Understood - no [undue] pressure intended

> ... If you want this in a hurry your best bet is to either
> send a working patch to a bug report or (if such a patch
> already exists) to harass me via email until I apply it. :-)

Okay ... I'll have a go at coding a fix ... I'm not familiar with
developing for Debian, but that sounds like it might be within my
capability

> Preferably all such harassment should be conducted via
> emails sent to bug reports

I'd be inclined to add to one of the existing bugs (probably the newest
one, 445035) - but would you rather have separate bugs for each
different circumstance where a non-zero exit status is required ?

>> And is there a better list to post this to ?
>
> The most appropriate list would be aptitude-devel@lists.alioth.debian.org.
> deity@lists.debian.org would be the closest alternative.

aaaah ... didn't realise 'lists.alioth.d.o' existed. I'll drop a note to
aptitude-devel when I file or update a bug report.

Thanks,
Nick Boyce
--
'If you don't pray in my school, I won't think in your church'


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 12-13-2007, 02:58 PM
Daniel Burrows
 
Default aptitude has poor exit status behaviour

On Thu, Dec 13, 2007 at 01:57:55PM +0000, Nick Boyce <nick@glimmer.demon.co.uk> was heard to say:
> Daniel Burrows wrote:
> > ... If you want this in a hurry your best bet is to either
> > send a working patch to a bug report or (if such a patch
> > already exists) to harass me via email until I apply it. :-)
>
> Okay ... I'll have a go at coding a fix ... I'm not familiar with
> developing for Debian, but that sounds like it might be within my
> capability

I have some partial notes on building aptitude up at
http://algebraicthunk.net/~dburrows/projects/aptitude/compiling .
Please let me know if there's anything I forgot to mention there.

> > Preferably all such harassment should be conducted via
> > emails sent to bug reports
>
> I'd be inclined to add to one of the existing bugs (probably the newest
> one, 445035) - but would you rather have separate bugs for each
> different circumstance where a non-zero exit status is required ?

If your change doesn't fix the existing bug, please submit a new bug
so I can close it with the upload.

Daniel


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 12-13-2007, 05:49 PM
Joey Hess
 
Default aptitude has poor exit status behaviour

bts tag 233129 d-i
thanks

Daniel Burrows wrote:
> I'm currently busy working on other parts of the program. If you want
> this in a hurry your best bet is to either send a working patch to a bug
> report or (if such a patch already exists) to harass me via email until
> I apply it. :-) Preferably all such harassment should be conducted via
> emails sent to bug reports so that it gets archived with the bug and
> filtered into my debbugs folder.

Please consider yourself harrassed. :-)

In d-i, we've implemented everything we need to get a nice progress bar
during the system's initial update of the Packages files from the
mirror. Except that apt doesn't send progress info for apt-get update
over the status-fd interface (#448908). Happily aptitude does send such
progress info over that interface, but since it doesn't propigate
download failures, lack of which would utterly break d-i, we can't
switch to using aptitude there.

(FWIW, #282408 is no longer on the d-i code path due to other changes,
and if #445035 were fixed, it might break tasksel in some situations
(though I'm sure I could deal with that).)

--
see shy jo
 
Old 12-13-2007, 07:09 PM
Andrew Sackville-West
 
Default aptitude has poor exit status behaviour

On Thu, Dec 13, 2007 at 01:56:53PM +0000, Nick Boyce wrote:
> Andrew Sackville-West wrote:
> > On Thu, Dec 13, 2007 at 02:24:15AM +0000, Nick Boyce wrote:
> >
> >> (Etch) aptitude's error handling [cough] falls short of optimum
> >> behaviour. In particular it returns an exit status of zero in various
> >> failure situations
> [...]
> >> I did a quick test with 'apt-get' on Sarge, and found it returns exit
> >> status 100 in at least some of these situations (I didn't test all of
> >> them), so there seems to have been some regression here :
> >
> > apt-get is a different program. There's not a regression unless the
> > lack of error codes appears in apt-get in etch and later.
>
> Agreed it's a different program (though I would guess it shares at least
> some code) - but what I meant was a regression in system functionality
> as a whole, rather than in 'aptitude' specifically. Sorry if I abused
> the term.

fair enough. meanwhile, looks like you got a fantastic response!

A
 
Old 12-15-2007, 04:42 PM
Daniel Burrows
 
Default aptitude has poor exit status behaviour

On Thu, Dec 13, 2007 at 01:49:07PM -0500, Joey Hess <joeyh@debian.org> was heard to say:
> bts tag 233129 d-i

Hm, that's an interesting one. It looks like the apt fetcher claims
that the update succeeded even when some sources failed, so I have to
iterate the list of download items after the fact like apt-get does
and see if any of them failed.

Daniel


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 12-15-2007, 09:57 PM
Andrei Popescu
 
Default aptitude has poor exit status behaviour

On Sat, Dec 15, 2007 at 09:42:58AM -0800, Daniel Burrows wrote:
> On Thu, Dec 13, 2007 at 01:49:07PM -0500, Joey Hess <joeyh@debian.org> was heard to say:
> > bts tag 233129 d-i
>
> Hm, that's an interesting one. It looks like the apt fetcher claims
> that the update succeeded even when some sources failed, so I have to
> iterate the list of download items after the fact like apt-get does
> and see if any of them failed.

Sorry for jumping in (you *are* discussing this on a user list ), but
IM*VERY*H opinion it sounds like a bug in apt fetcher.

Regards,
Andrei
--
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)
 

Thread Tools




All times are GMT. The time now is 07:03 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org