Bug#774803: gitweb: dpkg trigger cycle via apache2

2015-01-07 Thread Niels Thykier
On 2015-01-07 21:29, Jonathan Nieder wrote:
> Hi Niels,
> 
> Niels Thykier wrote:
> 
>> Debian `dpkg' package management program version 1.17.23 (amd64).
> [...]
>>  chain of packages whose triggers are or may be responsible:
>>   gitweb -> gitweb
>>  packages' pending triggers which are or may be unresolvable:
>>   gitweb: /usr/share/apache2/apache2-maintscript-helper
> [...]
>> This simulates an upgrade scenario, where apache2 might be
>> temporarily deconfigured while gitweb remains configured.  If this
>> happens, dpkg is unable to recover as the cycle due to "await" trigger
>> AND the dependency requires both packages to be configured.
> 
> Puzzling.  What prevents the following upgrade path?
> 
>  1. deconfigure gitweb
>  2. configure apache2
>  3. configure gitweb
> 

Indeed, it seems to solve the issue by doing it manually.  I believe a
second call to dpkg --configure --pending will in fact "just work(tm)".
 So yes,  there is a recovery.  That said, it can still cause an
unpleasant upgrade.

> I'm probably missing something obvious, I'm confused at where the
> cycle is here.  It seems like gitweb depends on apache2 but not vice
> versa.
> 
> Thanks,
> Jonathan
> 

It was discussed in length in [1], when Johannes tried to devise a
script for detecting this cycles.  I suspect that might be a vastly
better read than what my memory can produce atm. :)

~Niels

[1] https://lists.debian.org/debian-dpkg/2014/12/msg00015.html


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#774803: gitweb: dpkg trigger cycle via apache2

2015-01-07 Thread Jonathan Nieder
Hi Niels,

Niels Thykier wrote:

> Debian `dpkg' package management program version 1.17.23 (amd64).
[...]
>  chain of packages whose triggers are or may be responsible:
>   gitweb -> gitweb
>  packages' pending triggers which are or may be unresolvable:
>   gitweb: /usr/share/apache2/apache2-maintscript-helper
[...]
> This simulates an upgrade scenario, where apache2 might be
> temporarily deconfigured while gitweb remains configured.  If this
> happens, dpkg is unable to recover as the cycle due to "await" trigger
> AND the dependency requires both packages to be configured.

Puzzling.  What prevents the following upgrade path?

 1. deconfigure gitweb
 2. configure apache2
 3. configure gitweb

I'm probably missing something obvious, I'm confused at where the
cycle is here.  It seems like gitweb depends on apache2 but not vice
versa.

Thanks,
Jonathan


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#774803: gitweb: dpkg trigger cycle via apache2

2015-01-07 Thread Niels Thykier
Package: gitweb
Version: 1:2.1.4-2
Severity: serious
Control: block 774794 by -1

Hi,

The gitweb package has a trigger cycle via apache2.

Steps to reproduce the cycle (in a Jessie/sid chroot):
"""
# apt-get install apache2 gitweb
# dpkg --version | grep ' version 1.17' && \
  dpkg --unpack /var/cache/apt/archives/apache2_*.deb && \
  dpkg --configure --pending
Debian `dpkg' package management program version 1.17.23 (amd64).
(Reading database ... 13131 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.10-9_amd64.deb ...
Unpacking apache2 (2.4.10-9) over (2.4.10-9) ...
Setting up apache2 (2.4.10-9) ...
invoke-rc.d: policy-rc.d denied execution of restart.
dpkg: cycle found while processing triggers:
 chain of packages whose triggers are or may be responsible:
  gitweb -> gitweb
 packages' pending triggers which are or may be unresolvable:
  gitweb: /usr/share/apache2/apache2-maintscript-helper
dpkg: error processing package gitweb (--configure):
 triggers looping, abandoned
Errors were encountered while processing:
 gitweb
"""

This simulates an upgrade scenario, where apache2 might be
temporarily deconfigured while gitweb remains configured.  If this
happens, dpkg is unable to recover as the cycle due to "await" trigger
AND the dependency requires both packages to be configured.

Known solutions:

 * Use no-await triggers.  *CAVEAT*: not always applicable.  Known suitable
   use cases includes "cache" handling, where the cache is allowed to be
   out of date tempoarily.
 * Reduce the dependency to Recommends.  *CAVEAT*: Rarely applicable.
 * Rewrite the solution to avoid triggers entirely. *CAVEAT*: May be
   non-trivial and likely to involve updates to all packages relying on
   the trigger.

The trigger on apache2 (via the
"/usr/share/apache2/apache2-maintscript-helper" file) is defined at
[1].

~Niels

[1] 
http://repo.or.cz/w/git/debian.git/blob/a1b6464b17d4672d0ea56b0815a1da7d82693404:/debian/gitweb.triggers


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org