Ubiquity installer issue: inserting values into debconf and writing to a file during installation

Colin Watson cjwatson at ubuntu.com
Tue Apr 29 20:04:53 BST 2008


On Thu, Apr 24, 2008 at 12:06:48PM +0200, Pieter van Zyl wrote:
> Using debconf:
> ----------------------
> If I try to insert the selected values into debconf I get the following
> error:
> 
> exception caught in process_line:
> Traceback (most recent call last):
>   File "/usr/lib/ubiquity/ubiquity/filteredcommand.py", line 112, in
> process_line
>     return self.dbfilter.process_line()
>   File "/usr/lib/ubiquity/ubiquity/debconffilter.py", line 260, in
> process_line
>     if not input_widgets[0].run(priority, question):
>   File "/usr/lib/ubiquity/ubiquity/components/scib.py", line 38, in run
>     self.store_packages_to_install_in_debconf(list)
>   File "/usr/lib/ubiquity/ubiquity/components/scib.py", line 106, in
> store_packages_to_install_in_debconf
>     self.preseed_bool(name, self.yesInstall)
>   File "/usr/lib/ubiquity/ubiquity/filteredcommand.py", line 293, in
> preseed_bool
>     self.preseed(name, 'true', seen)
>   File "/usr/lib/ubiquity/ubiquity/filteredcommand.py", line 284, in
> preseed
>     self.db.register('debian-installer/dummy', name)
>   File "/usr/lib/python2.5/site-packages/debconf.py", line 60, in
> <lambda>
>     lambda *args, **kw: self.command(command, *args, **kw))
>   File "/usr/lib/python2.5/site-packages/debconf.py", line 96, in
> command
>     raise DebconfError(status, data)
> DebconfError: (20, 'Incorrect number of arguments')
> 
> No idea why this happens.

In future, a useful debugging technique is to run ubiquity with
'ubiquity --debug' and looking through /var/log/installer/debug; this
will have a trace of all debconf interaction, so you can see what's
actually being passed down.

> I am iterating through a list and trying to add the package name and the
> value true into debconf. Example (packageX,True)

This is a slightly odd thing to do. All debconf values should be
namespaced, so for instance ubiquity's internal question names are
ubiquity/somethingorother. Your code will be setting questions without
slashes in their names, which is unusual.

(This is not the cause of your problem, just a style point.)

> code:
> for package in list:
>            
>             self.yesInstall = True
> 
>             name = str(package)
>             name = name.strip(name)
>             name = unicode(name)

Your problem is 'name = name.strip(name)'. This takes the string name,
removes all the characters in name from it, and returns the result,
predictably the empty string. This then confuses debconf. Perhaps you
meant:

            name = unicode(package).strip()

... although I imagine just 'name = package.strip()' would do fine too.

> Writing the selected values to a file:
> -----------------------------------------------
> 
> 
> If I iterate through the selected packages and try to write them to a
> file I get this error:
>        
> self.output_file =
> open('/usr/lib/ubiquity/ubiquity/frontend/package_list_to_install.txt',
> 'w')
> IOError [Errno 13] permission denied:
> '/usr/lib/ubiquity/ubiquity/frontend/package_list_to_install.txt'
> 
> 
> The file I try to create and write to:
> self.output_file =
> open('/usr/lib/ubiquity/ubiquity/frontend/package_list_to_install.txt',
> 'w')
> 
> Any ideas on how to fix this? I have tried to create the file and have
> it on the live cd and I still get that error. Do I need to set
> permissions or the mode?

Much of the installer runs as non-root, and you need to be root to
write to /usr/lib/ubiquity/ubiquity/frontend. However, that's not
somewhere you should be writing temporary data files anyway. Create a
directory in /tmp for yourself and put them there.

Cheers,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]



More information about the Ubuntu-installer mailing list