[elbe-users] build broken after network move

Olivier Dion dion at linutronix.de
Wed Jul 31 15:48:10 CEST 2019


On 2019-07-29T20:26:02+0200, ew.foe at nassur.net wrote:

> 1. I could not start the existing initvm instances any more.
> This is probably very easy to fix, if you understand "virsh"
> and its ecosystem. I "fixed" this issue by unregistering
> the old initvm and creating a new one. Any hints on how to
> solve this properly?

Usually when the initvm is not responding, doing:
``````````````````````````````````````````````````````````````````````
virsh > destroy initvm
vrish > start initvm
``````````````````````````````````````````````````````````````````````
will force the machine to reboot.  If you still can't attach to it, I
would just create another initvm.  Just make sure to destroy and
undefine it first.  Make also sure that the tcp port used by initvm are
opened

> 2. The build fails with the error message below. However,
> there's no hint to what URL is refusing the connection.

> > I: Configuring libc-bin...
> > I: Configuring systemd...
> > I: Base system installed successfully.
> > ------------------------------------------------------------------------------
> >
> > running cmd +chroot
> > /var/cache/elbe/7a1e03e9-f151-4ab6-9136-208545c66e2a/chroot dpkg
> > --configure -a+
> > ------------------------------------------------------------------------------
> > ------------------------------------------------------------------------------
> >
> > running cmd +chroot
> > /var/cache/elbe/7a1e03e9-f151-4ab6-9136-208545c66e2a/chroot
> > debconf-set-selections <
> > /var/cache/elbe/7a1e03e9-f151-4ab6-9136-208545c66e2a/chroot/var/cache/elbe/preseed.txt+
> > ------------------------------------------------------------------------------
> > ------------------------------------------------------------------------------
> >
> > Build failed
> > Traceback (most recent call last):
> >   File "/usr/lib/python2.7/dist-packages/elbepack/asyncworker.py",
> > line 158, in execute
> >     skip_pbuild=self.skip_pbuilder)
> >   File "/usr/lib/python2.7/dist-packages/elbepack/elbeproject.py",
> > line 517, in build
> >     self.buildenv.import_keys()
> >   File "/usr/lib/python2.7/dist-packages/elbepack/rfs.py", line 245,
> > in import_keys
> >     myKey = urllib2.urlopen(keyurl).read()
> >   File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
> >     return opener.open(url, data, timeout)
> >   File "/usr/lib/python2.7/urllib2.py", line 429, in open
> >     response = self._open(req, data)
> >   File "/usr/lib/python2.7/urllib2.py", line 447, in _open
> >     '_open', req)
> >   File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
> >     result = func(*args)
> >   File "/usr/lib/python2.7/urllib2.py", line 1228, in http_open
> >     return self.do_open(httplib.HTTPConnection, req)
> >   File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open
> >     raise URLError(err)
> > URLError: <urlopen error [Errno 111] Connection refused>
> >
> >
> > Exception:
> > <urlopen error [Errno 111] Connection refused>
> >
> > Build started, waiting till it finishes
> >
> > Build finished !

I don't like this behavior.  If opening an URL failed, the exception
should also print the URL.  This might be improve in the future.


What I would do in this situation is to test the URL outside of Elbe and
if it doesn't work, test it outside of the initvm.

Thus, I would start by logging the URLs to a file.  Simply add the
following at /usr/lib/python2.7/dist-packages/elbepack/rfs.py:255
``````````````````````````````````````````````````````````````````````
with open("/root/url.list", "a") as f:
    f.write("%s\n" % keyurl)
``````````````````````````````````````````````````````````````````````
and restart the daemon:
``````````````````````````````````````````````````````````````````````
# systemctl restart elbe-daemon
``````````````````````````````````````````````````````````````````````

The last URL in /root/url.list is the faulty one.  Make a small script
that use urllib2 and try to open the bad URL:
``````````````````````````````````````````````````````````````````````
#!/usr/bin/env python2
import urllib2
urllib2.urlopen(my_url).read()
``````````````````````````````````````````````````````````````````````
if an exception is thrown, try it outside of the initvm.

With that you should know what's wrong.

The following table is not absolutes, but can helps in the future:
| Elbe | Initvm | Windows | Blame  |
| NO   | OK     | OK      | Elbe   |
| NO   | NO     | OK      | Initvm |
| NO   | NO     | NO      | URL    |

--
Olivier Dion
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen



More information about the elbe-users mailing list