phablet-network-setup doesn't wait for DNS when installing ssh

Bug #1175806 reported by Alan Pope 🍺🐧🐱 πŸ¦„
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Phablet Tools
Fix Released

Bug Description

run "phablet-network-setup -i" and it will start trying to install ssh before the network is fully up. So you get this:-

Network file is /etc/NetworkManager/system-connections/Canonical
Provisioning network file to device
adbd is already running as root
7 KB/s (296 bytes in 0.040s)

Network setup complete
Installing ssh
Network not ready, sleeping
Network not ready, sleeping
Network not ready, sleeping
2 KB/s (112 bytes in 0.039s)
Err raring Release.gpg
  Something wicked happened resolving '' (-11 - System error)
Err raring Release.gpg
  Something wicked happened resolving '' (-11 - System error)
Err raring Release.gpg

Perhaps it could wait a little longer for DNS to setup before it ploughs through to apt-get update and install openssh?

Related branches

Revision history for this message
Paul Larson (pwlars) wrote :

I've hit this also. I tried adding a loop that just did ping -c1 and waited for it to succeed, but I still get the "something wicked happened" error, which is completely unhelpful. I talked to Colin about it last week at the sprint and he mentioned that he had recently sent a patch upstream to debian that would have it return an errno, and hopefully a more descriptive error.

In the meantime, the way I've been working around this in my scripts is to simply call it once without the -i, sleep 30, then call it with the -i.

Changed in phablet-tools:
status: New → Confirmed
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:phablet-tools at revision 90, scheduled for release in phablet-tools, milestone Unknown

Changed in phablet-tools:
status: Confirmed → Fix Committed
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Unfortunately this isn't completely fixed. The script now waits for network before issuing the apt commands to install ssh. However it's not sufficient to wait for network, the issue is that the DNS resolution doesn't work if you sneak in an apt command immediately after the network comes up but before DNS works. It happens frequently enough to be annoying here. Simply adding a sleep _after_ the network has successfully been detected is a simple fix. A better fix would detect if dns works by doing something simple like "host" on-device before issuing the apt commands.

Changed in phablet-tools:
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