Failed to restart buildbot wizard

I am running Buildbot version 0.8.8 on Windows7.

I have a config file ( master.cfg

) that creates all builders using a little trick. I read an XML file from subversion which lists all the steps for developers. Something like:

<Builder name="BuilderA" description="Builds the A project">
    <Command name="Clean">-v -t realclean -p my\\projA</Command>
    <Command name="Release">-v -t release -p my\\projA</Command>
</Builder>

<Builder name="BuilderB" description="Builds the B project">
    <Command name="Clean">-v -t realclean -p my\\projB</Command>
    <Command name="Release">-v -t release -p my\\projB</Command>
</Builder>

      

The idea is that any developer can change the XML file in the subversion and then buildmaster can be restarted to have the new buildbot config.

I run buildbot using the command: buildbot start C:\master_dir

The problem I'm running into is that when I try to build restart

buildbot it complains that buildmaster is not working . Digging deep into the sources, I found that when I tried to open the file, twisted.pid

it didn't work in buildbot\scripts\stop.py:34

.

pidfile = os.path.join(basedir, 'twistd.pid')
try:
    with open(pidfile, "rt") as f:
        pid = int(f.read().strip())
except:
    if not config['quiet']:
        print "buildmaster not running"
    return 0

      

I have no idea what this file is twisted.pid

and why is buildbot looking for this? Any help or ideas would be appreciated. Thank.

+3


source to share


2 answers


I have the same problem. There doesn't seem to be a file being created on windows twistd.pid

. I'm not sure where the error is coming from, but I reported a bug for the buildbot command: http://trac.buildbot.net/ticket/3512

As a workaround, I have now added to my master.cfg:

import os
if not os.path.exists("twistd.pid"):
    with open("twistd.pid", "w") as pidfile:
        pidfile.write("{}".format(os.getpid()))

      



EDIT: Actually, it seems that the PID file is not deleted after stopping ... So I try more with this:

else:
    realpid = os.getpid()
    filepid = 0
    with open("twistd.pid", "r") as pidfile:
        filepid = int(pidfile.read())
    if filepid == 0 or filepid != realpid:
        with open("twistd.pid", "w") as pidfile:
            pidfile.write("{}".format(realpid))

      

This seems to work, but you get an error if you try to stop buildbot when it is not really running, as the PID file will give the wrong PID and will try to kill it.

+1


source


The information you have provided so far does not show that everything is actually wrong.

twistd.pid

- process id file buildmaster. Its existence indicates that the build master is running. Its absence indicates that the builder is not working.

Restarting buildmaster means stopping it and then starting it. stop it does buildbot check for pid buildmaster. If there is no pid file, then it informs you that the builder is not running and continues to run it.



So: -

  • This message is quite ok if you don't know what the builder is when you restart it and observe this message. Do you know this?

  • The message is harmless information, unless the build wizard is started. Did you know that it won't start?

If you know that buildmaster was running when buildbot said it wasn’t, and that it didn’t start when you tried to restart it, then the first thing you would like to know is exactly which command you ran to restart the builder and in which directory did you run it?

0


source







All Articles