[users at bb.net] [SPAM] How to debug why the buildmaster won't start a build?

alan somers asomers at gmail.com
Sun Jun 18 04:37:13 UTC 2017


GitHubPullRequestPoller is not the problem.  It's the ChangeFilters.
And there are actually two problems:
1) My pull request scheduler never triggers a build, even though it
looks like the ChangeFilter ought to match.
2) My push scheduler triggers a build for every push, even on branches
I don't care about.  I setup a branch_fn in my ChangeFilter, but I
guess it isn't working.

I was able to work around issues by changing my configuration, but I
don't understand why the original configuration didn't work.  Could
someone please help me understand why this doesn't work:

schedulers.AnyBranchScheduler(
                       name="%s pull requests" % self.project_name(),
                       change_filter=util.ChangeFilter(
                           project=self.project_name(),
                           category='pull'),
                       treeStableTimer=15,
                       builderNames=self.builder_names())

But this does:

schedulers.AnyBranchScheduler(
                       name="%s pull requests" % self.project_name(),
                       change_filter=util.ChangeFilter(
                           project=self.project_name(),
                           branch_re = re.compile("refs/pull/[0-9]*/merge")),
                       treeStableTimer=15,
                       builderNames=self.builder_names())

My twistd.log file shows that the Change objects did have their
category fields set to 'pull', but the first ChangeFilter wouldn't
match them.

2017-06-17 22:22:53-0600 [-] injected change
Change(revision=u'8ac7bfc80c9f481ff0d519622ccf2c70793a5863',
who=u'asomers', branch=u'refs/pull/7/merge', comments=u'GitHub Pull
Request #7 (4 commits)', when=1497759773, category=u'pull',
project=u'asomers/mio-aio',
repository=u'https://github.com/asomers/mio-aio', codebase=u'')

Similarly, my push scheduler's ChangeFilter was matching every branch
when I used a branch_fn, but it does the right thing when I use a
branch_re instead.  Could somebody please tell me what's wrong with
this?

def branches(self):
        # Match stuff like refs/heads/master, refs/heads/staging,
        # refs/heads/trying, refs/tags/v1.2.3, or refs/tags/v1.2.3-beta1
        pat = re.compile(r"""
            ^refs/
            (
                (
                    heads/
                    (
                        master|trying|staging
                    )
                ) |
                (
                    tags/v\d+\.\d+\.\d+.*
                )
            )
            $""", re.X)
        lambda branch: pat.match(branch) != None
s = [schedulers.AnyBranchScheduler(
                       # We call it "master" for lack of a better name, though
                       # it may build a few other branches too
                       name="%s %s" % (self.project_name(), "master"),
                       change_filter=util.ChangeFilter(
                           project=self.project_name(),
                           branch_fn=self.branches()),
                       treeStableTimer=15,
                       builderNames=self.builder_names()),

Thanks,
-Alan

On Tue, Jun 13, 2017 at 9:44 AM, Pierre Tardy <tardyp at gmail.com> wrote:
> Ah that is right. GitHubPullrequestPoller is for me considered experiemental
> and usable only for people which have difficulties setting up the hooks.
>
> You should rather configure the hooks, as your bot is available on the
> internet.
> http://docs.buildbot.net/latest/manual/cfg-wwwhooks.html#github-hook
>
> Pierre
>
> On Tue, Jun 13, 2017 at 5:39 PM alan somers <asomers at gmail.com> wrote:
>>
>> Yeah, those builds from 15min ago caught me by surprise.  They were
>> created by the AnyBranchScheduler for the staging branch, which makes
>> me suspect that the real problem is with the pull request scheduler.
>> Perhaps it doesn't reschedule a build when somebody squashes commits?
>> Just a guess.  I can probably test that theory by digging through
>> enough logs, but I don't have time ATM.
>>
>> -Alan
>>
>> On Tue, Jun 13, 2017 at 9:24 AM, Pierre Tardy <tardyp at gmail.com> wrote:
>> > If you see the message "adding buildset 183 to database" I would expect
>> > that
>> > buildrequests are created.
>> >
>> > If I look at your database:
>> >
>> > last ten buildsets: all are completed
>> > https://alan.ci/buildbot/api/v2/buildsets?order=-bsid&limit=10
>> >
>> > last ten buildrequests: all are completed
>> >
>> > https://alan.ci/buildbot/api/v2/buildrequests?order=-buildrequestid&limit=10
>> >
>> > So I would say that your builds are actually run.
>> > maybe your scheduler is not scheduling what you want?
>> >
>> > I can see in your UI that some builds started 15min ago. is this
>> > resolved?
>> >
>> > On Tue, Jun 13, 2017 at 5:01 PM alan somers <asomers at gmail.com> wrote:
>> >>
>> >> Nope, no buildrequests either.
>> >> https://alan.ci/buildbot/#/builders/5
>> >>
>> >> The only worker is a DockerLatentWorker.  I've verified that the
>> >> buildmaster can talk to the Docker server, and I can't find any
>> >> docker-related error messages in twistd.log.  So I think the problem
>> >> is that the master isn't generating any BuildRequests.  What might be
>> >> causing that?
>> >>
>> >> -Alan
>> >>
>> >> On Tue, Jun 13, 2017 at 8:57 AM, Pierre Tardy <tardyp at gmail.com> wrote:
>> >> > The home page only show the running builds.
>> >> > in the builder page, there is the list of buildrequests.
>> >> >
>> >> > A reason why a master won't start them might be
>> >> > - there is no worker available
>> >> > - there is a nextWorker or a nextBuild callback which returns None or
>> >> > []
>> >> >
>> >> > In the case those checks do not help, the code where you can start to
>> >> > add
>> >> > debug logs is:
>> >> >
>> >> >
>> >> > https://github.com/buildbot/buildbot/blob/master/master/buildbot/process/buildrequestdistributor.py#L189
>> >> >
>> >> > Regards
>> >> > Pierre
>> >> >
>> >> > On Tue, Jun 13, 2017 at 4:49 PM alan somers <asomers at gmail.com>
>> >> > wrote:
>> >> >>
>> >> >> No, the home page shows no pending builds.
>> >> >>
>> >> >> On Tue, Jun 13, 2017 at 8:46 AM, Neil Gilmore
>> >> >> <ngilmore at grammatech.com>
>> >> >> wrote:
>> >> >> > Alan,
>> >> >> >
>> >> >> > Does your setup have a web UI? If so, are you seeing builds being
>> >> >> > queued?
>> >> >> > Big difference between a queued build not starting and builds not
>> >> >> > getting
>> >> >> > queued at all...
>> >> >> >
>> >> >> > Neil Gilmore
>> >> >> > grammatech.com
>> >> >> >
>> >> >> >
>> >> >> > On 6/12/2017 11:12 PM, alan somers wrote:
>> >> >> >>
>> >> >> >> I have a buildmaster with one DockerLatentWorker and two
>> >> >> >> builders.
>> >> >> >> Each builder has two change sources: a GitPoller and a
>> >> >> >> GitHubPullrequestPoller.  Each builder also has two schedulers:
>> >> >> >> an
>> >> >> >> AnyBranchScheduler for a few select branches and an
>> >> >> >> AnyBranchScheduler
>> >> >> >> for pull requests.  I also have Github hooks setup to push commit
>> >> >> >> notifications into the buildmaster.  There is a WorkerLock with a
>> >> >> >> maxCount of 1 that is shared by one step of both builders'
>> >> >> >> BuilderConfigs.
>> >> >> >>
>> >> >> >> Everything was working fine until today, but now the buildmaster
>> >> >> >> never
>> >> >> >> attempts to kick off a build.  I can see from twistd.log that the
>> >> >> >> GitHub hook is still working, and I see log entries like "added
>> >> >> >> buildset 183 to database".  However, whereas normally that entry
>> >> >> >> would
>> >> >> >> be followed up by a "starting build" entry, now there is nothing.
>> >> >> >> There aren't any errors; there's just nothing at all.
>> >> >> >>
>> >> >> >> How can I debug this problem?  I have Manhole working, but I
>> >> >> >> don't
>> >> >> >> know what to look for.  Any advice would be appreciated.
>> >> >> >>
>> >> >> >> Buildless in Boulder,
>> >> >> >> -Alan
>> >> >> >> _______________________________________________
>> >> >> >> users mailing list
>> >> >> >> users at buildbot.net
>> >> >> >> https://lists.buildbot.net/mailman/listinfo/users
>> >> >> >
>> >> >> >
>> >> >> > _______________________________________________
>> >> >> > users mailing list
>> >> >> > users at buildbot.net
>> >> >> > https://lists.buildbot.net/mailman/listinfo/users
>> >> >> _______________________________________________
>> >> >> users mailing list
>> >> >> users at buildbot.net
>> >> >> https://lists.buildbot.net/mailman/listinfo/users


More information about the users mailing list