apt-get update / fetch.apt_update may never terminate
Bug #1491386 reported by
Stuart Bishop
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Charm Helpers |
New
|
Undecided
|
Unassigned |
Bug Description
The apt-get update helper in charm-helpers goes into a loop if it is unable to run successfully. This is no longer desirable behaviour, as in this case the unit should most likely be put into a blocked state. The current implementation makes it very difficult to recover from a simple configuration error, such as a bad GPG key or an invalid password for a protected apt archive.
To post a comment you must log in.
> The apt-get update helper in charm-helpers goes into a loop if it is unable to run successfully. This is no longer desirable
> behaviour, as in this case the unit should most likely be put into a blocked state.
To be clear, it's not an infinite loop, it's 30 attempts with 10s sleep -> 5 minutes.
The rationale for this loop is for two or more units on the same machine all of which are trying to get the APT lock. IMHO it is not appropriate for a unit that hits this APT lock issue to be blocked. There is no user action required (other than try again).
The retry logic is a bit crude at the moment because there's no way of distinguishing lock failures from any others using just the return code. One could probably tighten it up a bit to e.g. force a C locale, and inspect the error message on stderr.