Ticket #1684 (closed enhancement: fixed)

Opened 2 years ago

Last modified 22 months ago

Buildbot doesn't detect a broken configuration file

Reported by: kostja Owned by:
Priority: major Milestone: 0.8.+
Version: 0.8.2 Keywords: simple
Cc: bill@…

Description (last modified by dustin) (diff)

If there are two

c['status'].append(html.WebStatus(...))

lines in the configuration file, like below:

from buildbot.status import html
c['status'].append(html.WebStatus(http_port=8010,allowForce=True))

which are very easy to add by mistake, by just uncommenting allowForce line in the sample config, buildbot checkconfig completes successfully, and buildbot successfully starts, but is unable to see any of its slaves.

An error is produced into the log, but the message is quite cryptic:

        twisted.internet.error.CannotListenError: Couldn't listen on any:8010: [Errno 98] Address already in use.

Change History

comment:1 Changed 2 years ago by dustin

  • Type changed from undecided to enhancement
  • Description modified (diff)
  • Milestone changed from undecided to 0.8.3

This should have some kind of check in the early parts of the loadConfig process.

comment:2 Changed 2 years ago by dustin

  • Keywords simple added
  • Milestone changed from 0.8.3 to 0.8.+

comment:3 Changed 2 years ago by in3xes

This is reproducible with latest version? I can see all the slaves and they are working fine.

In my config file I put the below bit twice.

from buildbot.status import html
c['status'].append(html.WebStatus(http_port=8010, allowForce=True))

buildbot started with same error mentioned and it is working.

comment:4 Changed 2 years ago by dustin

That it worked after giving the error message is good news (and probably due to a difference in error handling somewhere else?)

We still should catch this particular misconfiguration earlier and give a more reasonable error message.

comment:5 Changed 22 months ago by dustin

  • Cc bill@… added

So this would be fixed in master/buildbot/master.py, in the loadConfig method.

The straightforward way to do this would be to look for any WebStatus instances in status, and check that their ports do not overlap (a Python set might be useful for the check).

The more flexible way to do this might be to add a checkConfig method to IStatusReceiver, and pass it the entire list of other status receivers. Then the WebStatus checkConfig method could scan the list for other WebStatus instances with the same port.

The latter solution would be good for change sources, too - we have a lot of bugs where multiple GitPoller instances are using the same repository directory, presenting almost exactly the same problem -- just a different parameter name!

comment:6 Changed 22 months ago by bdbaddog

comment:7 Changed 22 months ago by bdbaddog

Updated code in branch per feedback.

comment:8 Changed 22 months ago by Dustin J. Mitchell

  • Status changed from new to closed
  • Resolution set to fixed

Merge branch 'bug_1684' of  git://github.com/bdbaddog/buildbot

  • 'bug_1684' of  git://github.com/bdbaddog/buildbot: More changes to patch recommended by djmitche Fixed bug 1684. Multiple conflicting WebStatus?'s will now raise an exception. Also generically IStatusReceiver and buildbot.status.base.StatusReceiver? now provide a checkConfig(list_of_all_statuses) method which status providers can use to check for conflicting configurations

Fixes #1684. Merge includes some whitespace cleanup.

Changeset: 2893b708060ac737c2dbfd11cc3e69a1088e6989

Note: See TracTickets for help on using tickets.