Provisioning nodes on Hetzner with ubuntu-18.04 consistently failed for me at the remote-exec step that installs apt packages.
The most conspicuous error message said:
Could not get lock /var/lib/apt/lists/lock
And further up in the log:
Specified filename /var/{lib/{dpkg,apt/lists},cache/apt/archives}/lock does not exist.
This fix
The "Specified filename .. does not exist" error message can be replicated by running fuser against a non-existent file. fuser is invoked in the first inline script item
#!/bin/sh is added by default to remote-exec's inline scripts
On the nodes that were created, /bin/sh is a symlink to dash
I couldn't find an alternate, smart way to do the equivalent of brace expansion in dash, so this PR simply spells out all the lock files that the curly braces expand to.
Switched to multiline-string because the line got uncomfortably long after expanding.
Context
Provisioning nodes on Hetzner with ubuntu-18.04 consistently failed for me at the remote-exec step that installs apt packages.
The most conspicuous error message said:
And further up in the log:
This fix
fuser
against a non-existent file.fuser
is invoked in the first inline script item#!/bin/sh
is added by default to remote-exec's inline scripts/bin/sh
is a symlink todash
dash
doesn't appear to support expanding curly bracesI couldn't find an alternate, smart way to do the equivalent of brace expansion in dash, so this PR simply spells out all the lock files that the curly braces expand to.
Switched to multiline-string because the line got uncomfortably long after expanding.