Bug#486558: installation-reports: strange (null) in URL for tasksel for automatic install
It still isn't working. I now get an immediate bad mirror. db_get on mirror/http/mirror is empty, so mirror_root is still null. Below a debconf trace with the new code (no default) and two debug log statements added by me. Boot in auto mode. It clearly shows mirror/http/mirror getting its variable 'mirrors' set, and just as clearly shows the following db_get not returning anything. At the very beginning the same happens for mirror/protocol and that does work, but that still has a default so we just see the preset default being returned. Guess this makes the earlier cloned bug to debconf more severe. Jun 19 09:46:52 debconf: -- SUBST mirror/protocol protocols http, ftp Jun 19 09:46:52 debconf: Adding [protocols] - [http, ftp] Jun 19 09:46:52 debconf: rfc822db_question_set(db,q=mirror/protocol,q=0x8077058) Jun 19 09:46:52 debconf: -- 0 Jun 19 09:46:52 debconf: -- INPUT medium mirror/protocol Jun 19 09:46:52 debconf: Comparing priorities medium (1) with critical (3) Jun 19 09:46:52 debconf: -- 30 question skipped Jun 19 09:46:52 debconf: -- GO Jun 19 09:46:52 debconf: -- 0 ok Jun 19 09:46:52 debconf: -- GET mirror/protocol Jun 19 09:46:52 debconf: -- 0 http Jun 19 09:46:52 debconf: -- GO Jun 19 09:46:52 debconf: -- 0 ok Jun 19 09:46:52 debconf: -- GET mirror/country Jun 19 09:46:52 debconf: -- 0 Jun 19 09:46:52 debconf: -- GET debian-installer/country Jun 19 09:46:52 debconf: -- 0 US Jun 19 09:46:52 debconf: -- SET mirror/country US Jun 19 09:46:52 debconf: rfc822db_question_set(db,q=mirror/country,q=0x80528a0) Jun 19 09:46:52 debconf: -- 0 value set Jun 19 09:46:52 debconf: -- SET mirror/http/countries US Jun 19 09:46:52 debconf: rfc822db_question_set(db,q=mirror/http/countries,q=0x8052300) Jun 19 09:46:52 debconf: -- 0 value set Jun 19 09:46:52 debconf: -- FGET mirror/country seen Jun 19 09:46:52 debconf: -- 0 false Jun 19 09:46:52 debconf: -- FSET mirror/http/countries seen false Jun 19 09:46:52 debconf: -- 0 false Jun 19 09:46:52 debconf: -- INPUT high mirror/http/countries Jun 19 09:46:52 debconf: Comparing priorities high (2) with critical (3) Jun 19 09:46:52 debconf: -- 30 question skipped Jun 19 09:46:52 debconf: -- GO Jun 19 09:46:52 debconf: -- 0 ok Jun 19 09:46:52 debconf: -- GET mirror/http/countries Jun 19 09:46:52 debconf: -- 0 US Jun 19 09:46:52 debconf: -- SET mirror/country US Jun 19 09:46:52 debconf: rfc822db_question_set(db,q=mirror/country,q=0x80528a0) Jun 19 09:46:52 debconf: -- 0 value set Jun 19 09:46:52 debconf: -- GO Jun 19 09:46:52 debconf: -- 0 ok Jun 19 09:46:52 debconf: -- GET mirror/country Jun 19 09:46:52 debconf: -- 0 US Jun 19 09:46:52 debconf: -- SUBST mirror/http/mirror mirrors ftp.us.debian.org, ftp.egr.msu.edu, mirrors.kernel.org, debian.lcs.mit.edu, debian.osuosl.org, debian.crosslink.net, ftp.gtlib.gatech.edu, distro.ibiblio.org, ftp-mirror.internap.com, ftp.c Jun 19 09:46:52 debconf: Adding [mirrors] - [ftp.us.debian.org, ftp.egr.msu.edu, mirrors.kernel.org, debian.lcs.mit.edu, debian.osuosl.org, debian.crosslink.net, ftp.gtlib.gatech.edu, distro.ibiblio.org, ftp-mirror.internap.com, ftp.cerias.purdue.edu Jun 19 09:46:52 debconf: rfc822db_question_set(db,q=mirror/http/mirror,q=0x8076ed8) Jun 19 09:46:52 debconf: -- 0 Jun 19 09:46:52 debconf: -- INPUT high mirror/http/mirror Jun 19 09:46:52 debconf: Comparing priorities high (2) with critical (3) Jun 19 09:46:52 debconf: -- 30 question skipped Jun 19 09:46:52 debconf: -- GO Jun 19 09:46:52 debconf: -- 0 ok Jun 19 09:46:52 debconf: -- INPUT high mirror/http/proxy Jun 19 09:46:52 debconf: Comparing priorities high (2) with critical (3) Jun 19 09:46:52 debconf: -- 30 question skipped Jun 19 09:46:52 debconf: -- GO Jun 19 09:46:52 debconf: -- 0 ok Jun 19 09:46:52 debconf: -- GET mirror/http/proxy Jun 19 09:46:52 debconf: -- 0 Jun 19 09:46:52 debconf: -- GO Jun 19 09:46:52 debconf: -- 0 ok Jun 19 09:46:52 debconf: -- GET mirror/http/mirror Jun 19 09:46:52 debconf: -- 0 Jun 19 09:46:52 choose-mirror[2582]: INFO: mirror: Jun 19 09:46:52 debconf: -- SET mirror/http/hostname Jun 19 09:46:52 debconf: rfc822db_question_set(db,q=mirror/http/hostname,q=0x80523e0) Jun 19 09:46:52 debconf: -- 0 value set Jun 19 09:46:52 choose-mirror[2582]: INFO: root: (null) Jun 19 09:46:52 debconf: -- INPUT critical mirror/bad Jun 19 09:46:52 debconf: -- 0 question will be asked Jun 19 09:46:52 debconf: -- GO Jun 19 09:46:54 debconf: -- 30 backup Jun 19 09:46:54 debconf: -- GET debconf/priority Jun 19 09:46:54 debconf: -- 0 critical signature.asc Description: This is a digitally signed message part.
Bug#247744: Bug#486558: installation-reports: strange (null) in URL for tasksel for automatic install
Frans Pop wrote: Guess this makes the earlier cloned bug to debconf more severe. Properly fixing it is going to be tricky. Debconf does it by having a whole class of noninteractive question elements, that are always created for questions that are not displayed. So it's a simple matter of having a noninteractive select element that handles the special case. cdebconf has no noninteractive elements at all. Elements do not know if they are interactive or not, it only creates elements if the question priority warrants it. Also, debconf has tricky code to handle cases like backing up from a visible element to an invisible one. So just hacking in an element that doesn't display will not work; backing up past it will fail. (This is also why it's hard to make cdebconf skip asking select questions with only one choice.) It would be possible to hardcode the special case directly into command_input(). But, there's no guarantee that a question will actually be asked until GO is called, so this could result in cdebconf setting a value when debconf would not set it. The least invasive approach I've been able to think up is to add a separate queue of noninteractive question actions. Make command_input() add to this queue, command_clear() clear it, and command_go() process it, before it calls mod-frontend-methods.go. Even that could diverge slightly from debconf: If two questions are to be asked, the second is a noninteractive select, and the user backs up from the first, debconf will not change the value of the noninteractive select, while cdebconf would. (It could instead handle the noninteractive questions only if the user didn't back up, but that would just make it instead differ in the case where the noninteractive question is first, and the user backs up from the second question.) I think this would be a small enough difference, in an area that is not well specified, that it would be acceptable though, unlike the current glaring difference.. -- see shy jo signature.asc Description: Digital signature
Bug#247744: Bug#486558: installation-reports: strange (null) in URL for tasksel for automatic install
Attached patch seems to work (mirror works in auto mode), and the small test suite I added shows it does the right thing in all 4 cases. Could use some more testing, and my caveats about this being a hacky and suboptimal approach still apply. -- see shy jo From 2e86f33f8439682894441139873cd917ede4736b Mon Sep 17 00:00:00 2001 From: Joey Hess [EMAIL PROTECTED] Date: Thu, 19 Jun 2008 18:40:13 -0400 Subject: [PATCH] noninteractive select handling * Add a separate queue for noninteractive questions, so that things can be done when these questions would be displayed. This is a bit hackish; debconf's method of letting questions determine if they are interactive or not is really better. But this doesn't need huge changes to cdebconf. * Handle the special case of a noninteractive select with no (or a bad) default the same as debconf does; when such a question is asked, set the value to the first item in the select list. Closes: #486892, #247744 --- packages/cdebconf/debian/changelog | 13 packages/cdebconf/src/commands.c|3 + packages/cdebconf/src/frontend.c| 91 ++- packages/cdebconf/src/frontend.h|5 ++ packages/cdebconf/src/test/select.config| 58 + packages/cdebconf/src/test/select.templates | 22 +++ 6 files changed, 191 insertions(+), 1 deletions(-) create mode 100755 packages/cdebconf/src/test/select.config create mode 100644 packages/cdebconf/src/test/select.templates diff --git a/packages/cdebconf/debian/changelog b/packages/cdebconf/debian/changelog index c24225b..75ec1df 100644 --- a/packages/cdebconf/debian/changelog +++ b/packages/cdebconf/debian/changelog @@ -1,3 +1,16 @@ +cdebconf (0.132) UNRELEASED; urgency=low + + * Add a separate queue for noninteractive questions, so that things can +be done when these questions would be displayed. This is a bit hackish; +debconf's method of letting questions determine if they are interactive or +not is really better. But this doesn't need huge changes to cdebconf. + * Handle the special case of a noninteractive select with no (or a bad) +default the same as debconf does; when such a question is asked, +set the value to the first item in the select list. +Closes: #486892, #247744 + + -- Joey Hess [EMAIL PROTECTED] Thu, 19 Jun 2008 17:18:08 -0400 + cdebconf (0.131) unstable; urgency=low [ Frans Pop ] diff --git a/packages/cdebconf/src/commands.c b/packages/cdebconf/src/commands.c index 878e0b2..a5235c2 100644 --- a/packages/cdebconf/src/commands.c +++ b/packages/cdebconf/src/commands.c @@ -54,6 +54,8 @@ command_input(struct confmodule *mod, char *arg) if (visible) visible = mod-frontend-methods.add(mod-frontend, q); +else +mod-frontend-methods.add_noninteractive(mod-frontend, q); if (q-priority != NULL) free(q-priority); @@ -220,6 +222,7 @@ command_go(struct confmodule *mod, char *arg) mod-frontend-questions = q; } +mod-frontend-methods.go_noninteractive(mod-frontend); ret = mod-frontend-methods.go(mod-frontend); if (ret == CMDSTATUS_GOBACK || mod-backed_up != 0) { diff --git a/packages/cdebconf/src/frontend.c b/packages/cdebconf/src/frontend.c index 59d83fe..3a21bf9 100644 --- a/packages/cdebconf/src/frontend.c +++ b/packages/cdebconf/src/frontend.c @@ -4,6 +4,8 @@ #include database.h #include frontend.h #include question.h +#include template.h +#include strutl.h #include dlfcn.h #include string.h @@ -28,7 +30,7 @@ static int frontend_add(struct frontend *obj, struct question *q) qlast = qlast-next; } /* Question asked twice. debconf ignores the second question and - will we. */ + so will we. */ if (qlast == q) return DC_OK; qlast-next = q; @@ -40,11 +42,88 @@ static int frontend_add(struct frontend *obj, struct question *q) return DC_OK; } +static int frontend_add_noninteractive(struct frontend *obj, struct question *q) +{ + struct question *qlast; + ASSERT(q != NULL); + ASSERT(q-prev == NULL); + ASSERT(q-next == NULL); + + //INFO(INFO_DEBUG, adding noninteractive question); + + qlast = obj-questions_noninteractive; + if (qlast == NULL) + { + obj-questions_noninteractive = q; + } + else + { + while (qlast != q qlast-next != NULL) + { + qlast = qlast-next; + } + qlast-next = q; + q-prev = qlast; + } + + question_ref(q); + + return DC_OK; +} + static int frontend_go(struct frontend *obj) { return DC_OK; } +static int frontend_go_noninteractive(struct frontend *obj) +{ + struct question *q = obj-questions_noninteractive; + + while (q != NULL) { + char *type = q-template-type; + + //INFO(INFO_DEBUG, frontend_go_noninteractive; type %s, type); + + /* This is a hack to make noninteractive selects be set to + * the first item in the select list if their value is not + * set, or is set to something not in the list. This is for + * consistency with
Bug#486558: installation-reports: strange (null) in URL for tasksel for automatic install
Frans Pop wrote: Because we're running at critical priority, the country mirror list is never actually displayed and thus mirror/http/mirror never gets a value; it does have a default value: ftp.debian.org Does the code not still ask the question despite it not being displayed? Running at critical priority should be identical to running at low priority and taking the default for everything. I wonder if we should set the first value of the country list as the selected value here. In most cases this will be a better default than the default at http/mirror, even if that's changed from ftp.d.o. We then get to validate_mirror(), which gets the selected mirror (ftp.d.o) and next calls 'mirror_root(mirror)'. The return value of that is set as directory. This must be the function that returns the (null) value and causes the incorrect wget later. The cause for the null value seems to be that the entry for ftp.d.o in the mirror master list looks like this: Site: ftp.debian.org Alias: saens.debian.org Alias: debian-mirror.cs.umn.edu Type: Push-Primary Archive-architecture: amd64 i386 X-Archive-http: /debian/ X-Archive-ftp: /debian/ The last two lines should not have the X- prefix! Essentially ftp.d.o does not have a mirror_root defined in the master list. Joy changed this in 1.1156: date: 2007-12-07 18:26:14 -0500; author: joy; state: Exp; lines: +2 -2; commented out Archive-* fields for ftp.debian.org, so that it doesn't even appear in lists, other than for sponsorship purposes I'd appreciate some input how to deal with this and also if the needed changes could be made by someone with more C skills than I have. Detecting the problem and failing at runtime can be done (and I've done it), but displaying the mirror/bad error to the user when they just took the default only highlights that the installer is broken, it doesn't really fix the problem. The best way to avoid the problem seems to be to check, at build time, that the default is actually present in the C struct, and if not, abort the build. Alternatively, remove the default entirely, and let debconf pick a default, which should be the first mirror listed in the generated selection list, which is ordered with push-primary mirrors first, so it will be a fairly good mirror. (Modulo issues like ftp.us.debian.org being an often-inconsistent set of multiple mirrors..) However, if what you said in your first paragraph is right, this doesn't happen at critical priority for some reason? -- see shy jo signature.asc Description: Digital signature
Bug#486558: installation-reports: strange (null) in URL for tasksel for automatic install
Hi Joey, I was hoping you'd take a look at this. Thanks! On Wednesday 18 June 2008, Joey Hess wrote: Frans Pop wrote: Because we're running at critical priority, the country mirror list is never actually displayed and thus mirror/http/mirror never gets a value; it does have a default value: ftp.debian.org Does the code not still ask the question despite it not being displayed? Running at critical priority should be identical to running at low priority and taking the default for everything. Well, what I see in questions.dat is that no value is assigned when running at critical prio. I guess that using the default (which it in fact does) is not the same as using the first value that is highlighted in the list if the default is not included in the list. When the question is shown the user explicitly selects the non-default value, but at critical prio that never happens. That could be solved by - do a get for current default - do a metaget for the list - if not default in list, set first value from list as default but I really wanted to get other people's opinion on that before even maybe trying to implement it myself. Possibly it is something that really should be solved at debconf level instead. Cheers, FJP signature.asc Description: This is a digitally signed message part.
Bug#486558: installation-reports: strange (null) in URL for tasksel for automatic install
On Wednesday 18 June 2008, Frans Pop wrote: I guess that using the default (which it in fact does) is not the same as using the first value that is highlighted in the list if the default is not included in the list. When the question is shown the user explicitly selects the non-default value, but at critical prio that never happens. I suspect that in other cases where we use choices generated at runtime we either (1) don't have a default value in the template or (2) do set a valid default from the generated choices before db_input. signature.asc Description: This is a digitally signed message part.
Bug#486558: installation-reports: strange (null) in URL for tasksel for automatic install
(Maybe I should wait a bit before sending...) On Wednesday 18 June 2008, Frans Pop wrote: I suspect that in other cases where we use choices generated at runtime we either (1) don't have a default value in the template or (2) do set a valid default from the generated choices before db_input. Which could also mean that the proper solution here is to simply remove the default from mirror/http/mirror. signature.asc Description: This is a digitally signed message part.
Bug#486558: installation-reports: strange (null) in URL for tasksel for automatic install
Frans Pop wrote: Well, what I see in questions.dat is that no value is assigned when running at critical prio. I guess that using the default (which it in fact does) is not the same as using the first value that is highlighted in the list if the default is not included in the list. When the question is shown the user explicitly selects the non-default value, but at critical prio that never happens. That could be solved by - do a get for current default - do a metaget for the list - if not default in list, set first value from list as default but I really wanted to get other people's opinion on that before even maybe trying to implement it myself. Possibly it is something that really should be solved at debconf level instead. The behavior you describe is different than debconf's behavior in the same situaiton. Debconf will throw out the default value and pick the 1st value if the default is not in the select list. So yes, I think there is a cdebconf bug here (cloning). And I think that bug should be fixed, because it makes d-i more complex by making it behave unnecessarily differently at different priorities. It doesn't make sense to work around the cdebconf bug in choose-mirror by implementing what cdebconf should do. It doesn't make sense to have a default *at all* if the Mirrors.masterlist can be updated to drop the default mirror at any time. Also, the default was only ever used for US. Seem like the (null) bug could have occurred even before ftp.debian.org was broken, when installing in another country. So I'm very much leaning toward dropping the default, and letting cdebconf default to the first mirror in the select list. And possibly improving the sorting of the select list if necessary. -- see shy jo signature.asc Description: Digital signature
Bug#486558: installation-reports: strange (null) in URL for tasksel for automatic install
On Wednesday 18 June 2008, Joey Hess wrote: So I'm very much leaning toward dropping the default, and letting Agreed. cdebconf default to the first mirror in the select list. And possibly improving the sorting of the select list if necessary. I've never really looked at sort order. I know that for NL it is good. If the ftp.country.d.o mirror is sorted first and maybe primary mirrors are sorted above secondaries etc, I think we can leave the rest to chance, or to the existing sort order in the master list (which probably is primary mirrors first?). signature.asc Description: This is a digitally signed message part.
Bug#486558: installation-reports: strange (null) in URL for tasksel for automatic install
Package: installation-reports Boot method: Netinstall CD (ISO) Image version: http://cdimage.debian.org/cdimage/lenny_di_beta2/i386/iso-cd/debian-LennyBeta2-i386-netinst.iso Date: 2008-06-16 Machine: VirtualBox 1.6.2 Processor: Intel Core2 Quad Q9300 @ 2.5 GHz Memory: 256MB Partitions: root on 8GB /dev/hda1, swap on /dev/hda5 Output of lspci -nn and lspci -vnn: Base System Installation Checklist: [O] = OK, [E] = Error (please elaborate below), [ ] = didn't try it Initial boot: [O] Detect network card:[O] Configure network: [O] Detect CD: [O] Load installer modules: [O] Detect hard drives: [O] Partition hard drives: [O] Install base system:[O] Clock/timezone setup: [O] User/password setup:[O] Install tasks: [E] Install boot loader:[ ] Overall install:[ ] Comments/Problems: I tried the automatic install, and everything was fine until I got the following error: Bad archive mirror. Switching to console 4 with Alt-F4 I can see the following command trying to execute: --- Jun 16 19:41:09 choose-mirror[29486]: DEBUG: command: wget -q http://ftp.debian.org(null)/dists/lenny/Release -O - | grep ^Suite: | cut -d' ' -f 2 --- If I test this in a new busybox console with a correct URL, without the '(null)' part, I can connect to the server and retreive a correct listing. Hope this helps, Anders -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#486558: installation-reports: strange (null) in URL for tasksel for automatic install
reassign 486558 choose-mirror 2.24 severity 486558 important tags 486558 confirmed thanks Thanks for the report. On Monday 16 June 2008, Anders Andersson wrote: Comments/Problems: I tried the automatic install, and everything was fine until I got the following error: Bad archive mirror. Switching to console 4 with Alt-F4 I can see the following command trying to execute: Jun 16 19:41:09 choose-mirror[29486]: DEBUG: command: wget -q http://ftp.debian.org(null)/dists/lenny/Release -O - | grep ^Suite: | cut -d' ' -f 2 If I test this in a new busybox console with a correct URL, without the '(null)' part, I can connect to the server and retreive a correct listing. I remember seeing a report about this before. I think I've now figured out what is going wrong. There are two things interacting here. Because we're running at critical priority, the country mirror list is never actually displayed and thus mirror/http/mirror never gets a value; it does have a default value: ftp.debian.org This is in fact a very bad default as ftp.d.o only carries i386/amd64. I wonder if we should set the first value of the country list as the selected value here. In most cases this will be a better default than the default at http/mirror, even if that's changed from ftp.d.o. We then get to validate_mirror(), which gets the selected mirror (ftp.d.o) and next calls 'mirror_root(mirror)'. The return value of that is set as directory. This must be the function that returns the (null) value and causes the incorrect wget later. The cause for the null value seems to be that the entry for ftp.d.o in the mirror master list looks like this: Site: ftp.debian.org Alias: saens.debian.org Alias: debian-mirror.cs.umn.edu Type: Push-Primary Archive-architecture: amd64 i386 X-Archive-http: /debian/ X-Archive-ftp: /debian/ The last two lines should not have the X- prefix! Essentially ftp.d.o does not have a mirror_root defined in the master list. I'd appreciate some input how to deal with this and also if the needed changes could be made by someone with more C skills than I have. Cheers, FJP signature.asc Description: This is a digitally signed message part.
Processed: Re: Bug#486558: installation-reports: strange (null) in URL for tasksel for automatic install
Processing commands for [EMAIL PROTECTED]: reassign 486558 choose-mirror 2.24 Bug#486558: installation-reports: strange (null) in URL for tasksel for automatic install Bug reassigned from package `installation-reports' to `choose-mirror'. severity 486558 important Bug#486558: installation-reports: strange (null) in URL for tasksel for automatic install Severity set to `important' from `normal' tags 486558 confirmed Bug#486558: installation-reports: strange (null) in URL for tasksel for automatic install There were no tags set. Tags added: confirmed thanks Stopping processing here. Please contact me if you need assistance. Debian bug tracking system administrator (administrator, Debian Bugs database) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]