maas-cluster-controller.postinst failing with an unterminated sed error

Bug #1167660 reported by Diogo Matsubara on 2013-04-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
maas (Ubuntu)
Medium
Diogo Matsubara

Bug Description

maas-cluster-controller package is failing to install with the following error:

Setting up maas-cluster-controller (0.2+1.2+bzr1373+dfsg-0+1373+168~ppa0~quantal
1) ...
sed: -e expression #1, char 23: unterminated `s' command
dpkg: error processing maas-cluster-controller (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin ...

I added set -x to the /var/lib/dpkg/info/maas-cluster-controller.postint script and re-run the command. Below is the output.

Notice there are two bugs here:

 + RET= http://192.168.21.5/MAAS which contains an leading whitespace

and the bug that's causing the error on line 86 of maas-cluster-controller.postinst:

        sed -i "s|MAAS_URL=.*|MAAS_URL="$RET"|" /etc/maas/maas_cluster.conf

which works when it's like: sed -i "s|MAAS_URL=.*|MAAS_URL='$RET'|" /etc/maas/maas_cluster.conf

ubuntu@autopkgtest:~$ sudo apt-get install maas-cluster-controller
Reading package lists... Done
Building dependency tree
Reading state information... Done
maas-cluster-controller is already the newest version.
The following packages were automatically installed and are no longer required:
  linux-headers-3.5.0-22 linux-headers-3.5.0-22-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up maas-cluster-controller (0.2+1.2+bzr1373+dfsg-0+1373+168~ppa0~quantal1) ...
+ . /usr/share/debconf/confmodule
+ [ ! ]
+ PERL_DL_NONLAZY=1
+ export PERL_DL_NONLAZY
+ [ ]
+ exec /usr/share/debconf/frontend /var/lib/dpkg/info/maas-cluster-controller.postinst configure
+ . /usr/share/debconf/confmodule
+ [ ! 1 ]
+ [ -z ]
+ exec
+ [ ]
+ exec
+ DEBCONF_REDIR=1
+ export DEBCONF_REDIR
+ db_version 2.0
+ _db_cmd VERSION 2.0
+ _db_internal_IFS=

+ IFS=
+ printf %s\n VERSION 2.0
+ IFS=

+ IFS=
 read -r _db_internal_line
+ RET=2.0
+ return 0
+ [ configure = configure ]
+ [ -z ]
+ create_log_dir
+ [ ! -d /var/lib/maas ]
+ [ ! -d /var/log/maas/oops ]
+ chown -R maas:maas /var/lib/maas/
+ chown -R maas:maas /var/log/maas
+ chmod -R 775 /var/log/maas/oops
+ configure_maas_tgt
+ local tgtcfg=/etc/tgt/targets.conf
+ [ -d /etc/tgt/conf.d/ ]
+ mkdir -p /etc/tgt/conf.d/ /var/lib/maas/ephemeral/
+ ln -sf /var/lib/maas/ephemeral/tgt.conf /etc/tgt/conf.d/maas.conf
+ [ configure = configure ]
+ [ -z ]
+ dpkg --compare-versions lt 0.1+bzr1239+dfsg-0ubuntu1
+ create_log_dir
+ [ ! -d /var/lib/maas ]
+ [ ! -d /var/log/maas/oops ]
+ chown -R maas:maas /var/lib/maas/
+ chown -R maas:maas /var/log/maas
+ chmod -R 775 /var/log/maas/oops
+ db_get maas-cluster-controller/maas-url
+ _db_cmd GET maas-cluster-controller/maas-url
+ _db_internal_IFS=

+ IFS=
+ printf %s\n GET maas-cluster-controller/maas-url
+ IFS=

+ IFS=
 read -r _db_internal_line
+ RET= http://192.168.21.5/MAAS
+ return 0
+ [ -n http://192.168.21.5/MAAS ]
+ sed -i s|MAAS_URL=.*|MAAS_URL= http://192.168.21.5/MAAS| /etc/maas/maas_cluster.conf
sed: -e expression #1, char 23: unterminated `s' command
dpkg: error processing maas-cluster-controller (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 maas-cluster-controller
E: Sub-process /usr/bin/dpkg returned an error code (1)

Related branches

Raphaël Badin (rvb) wrote :

This also affects the precise and quantal packaging branches so it's probably worth fixing it there too.

Diogo Matsubara (matsubara) wrote :

I merge proposed the fixes to quantal and precise.sru packaging branches.

Changed in maas (Ubuntu):
status: New → In Progress
assignee: nobody → Diogo Matsubara (matsubara)
Andres Rodriguez (andreserl) wrote :

This os only se en when theres a leading whitespace un that particular variable which wouldnt normally happen

Changed in maas (Ubuntu):
importance: Undecided → Medium
Changed in maas (Ubuntu):
status: In Progress → Fix Committed
Changed in maas (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers