[2.0rc2] package installation fails when default gateway is not set

Bug #1607112 reported by Nobuto Murata on 2016-07-27
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Medium
Andres Rodriguez

Bug Description

Package installation fails when default gateway is not set. I intentionally don't set default gateway as I would like to install MAAS in isolated environment from the Internet.

[/var/lib/dpkg/info/maas-region-controller.postinst]
get_default_route_ip() {
    while read Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT
    do
        [ "$Mask" = "00000000" ] && break
    done < /proc/net/route
    interface="$Iface"
    ipaddr=$(LC_ALL=C /sbin/ip -4 addr list dev "$interface" scope global)
    ipaddr=${ipaddr#* inet }
    ipaddr=${ipaddr%%/*}
    echo $ipaddr
}

+ get_default_route_ip
+ read Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT
+ [ Mask = 00000000 ]
+ read Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT
+ [ 00FFFFFF = 00000000 ]
+ read Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT
+ [ 00FFFFFF = 00000000 ]
+ read Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT
+ interface=
+ LC_ALL=C /sbin/ip -4 addr list dev scope global
Device "" does not exist.
+ ipaddr=
+ ipaddr=

$ sudo dpkg --configure -a
Setting up maas-region-controller (2.0.0~rc2+bzr5156-0ubuntu1~16.04.2) ...
Device "" does not exist.
dpkg: error processing package maas-region-controller (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of maas:
 maas depends on maas-region-controller (= 2.0.0~rc2+bzr5156-0ubuntu1~16.04.2); however:
  Package maas-region-controller is not configured yet.

dpkg: error processing package maas (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 maas-region-controller
 maas

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:a5:5d:d8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.10/24 brd 192.168.100.255 scope global ens3
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fea5:5dd8/64 scope link
       valid_lft forever preferred_lft forever

$ ip r
10.0.8.0/24 via 192.168.100.1 dev ens3
192.168.100.0/24 dev ens3 proto kernel scope link src 192.168.100.10

Related branches

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

Duplicates of this bug

Other bug subscribers