Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buildbot 2.10.0 ForceScheduler list object has no attribute name #1

Closed
FilBot3 opened this issue Feb 15, 2021 · 1 comment
Closed
Assignees

Comments

@FilBot3
Copy link
Owner

FilBot3 commented Feb 15, 2021

The Details

When trying to use Buildbot with local Python modules, and subsequently back in the main master.cfg, the ForceScheduler gives the following error for commit:

  • def bb_schedulers() -> list:
    """Buildbot Schedulers to run the Builders.
    """
    bb_schedules: list = []
    bb_schedules.append(schedulers.ForceScheduler(
    name="force",
    builderNames=["helloworld"]))
    return bb_schedules

The error output

When running

(buildbot) ➜  buildbot git:(main) ✗ buildbot start master                           
Following twistd.log until startup finished..
The buildmaster startup failed. Please see 'twistd.log' for possible reason.

I get:

2021-02-14 20:24:06-0600 [-] Loading buildbot.tac...
2021-02-14 20:24:07-0600 [-] Loaded.
2021-02-14 20:24:07-0600 [-] twistd 20.3.0 (/home/filbot/Documents/Development/buildbot/venv/buildbot/bin/python 3.9.1) starting up.
2021-02-14 20:24:07-0600 [-] reactor class: twisted.internet.epollreactor.EPollReactor.
2021-02-14 20:24:07-0600 [-] Starting BuildMaster -- buildbot.version: 2.10.0
2021-02-14 20:24:07-0600 [-] Loading configuration from '/home/filbot/Documents/Development/buildbot/master/master.cfg'
2021-02-14 20:24:07-0600 [-] while starting BuildMaster
	Traceback (most recent call last):
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib64/python3.9/site-packages/twisted/internet/defer.py", line 654, in _runCallbacks
	    current.result = callback(current.result, *args, **kw)
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib64/python3.9/site-packages/twisted/internet/defer.py", line 1475, in gotResult
	    _inlineCallbacks(r, g, status)
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib64/python3.9/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
	    result = result.throwExceptionIntoGenerator(g)
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib64/python3.9/site-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
	    return g.throw(self.type, self.value, self.tb)
	--- <exception caught here> ---
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib/python3.9/site-packages/buildbot/master.py", line 244, in startService
	    self.config = yield threads.deferToThreadPool(
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib64/python3.9/site-packages/twisted/python/threadpool.py", line 250, in inContext
	    result = inContext.theWork()
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib64/python3.9/site-packages/twisted/python/threadpool.py", line 266, in <lambda>
	    inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib64/python3.9/site-packages/twisted/python/context.py", line 122, in callWithContext
	    return self.currentContext().callWithContext(ctx, func, *args, **kw)
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib64/python3.9/site-packages/twisted/python/context.py", line 85, in callWithContext
	    return func(*args,**kw)
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib/python3.9/site-packages/buildbot/config.py", line 156, in loadConfig
	    config = MasterConfig.loadFromDict(config_dict, filename)
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib/python3.9/site-packages/buildbot/config.py", line 322, in loadFromDict
	    config.load_schedulers(filename, config_dict)
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib/python3.9/site-packages/buildbot/config.py", line 616, in load_schedulers
	    if s.name in seen_names:
	builtins.AttributeError: 'list' object has no attribute 'name'

However...

When I take out the name=, I then get the following errors.

2021-02-14 20:38:51-0600 [-] Loading buildbot.tac...
2021-02-14 20:38:52-0600 [-] Loaded.
2021-02-14 20:38:52-0600 [-] twistd 20.3.0 (/home/filbot/Documents/Development/buildbot/venv/buildbot/bin/python 3.9.1) starting up.
2021-02-14 20:38:52-0600 [-] reactor class: twisted.internet.epollreactor.EPollReactor.
2021-02-14 20:38:52-0600 [-] Starting BuildMaster -- buildbot.version: 2.10.0
2021-02-14 20:38:52-0600 [-] Loading configuration from '/home/filbot/Documents/Development/buildbot/master/master.cfg'
2021-02-14 20:38:52-0600 [-] error while parsing config file:
	Traceback (most recent call last):
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib64/python3.9/site-packages/twisted/python/threadpool.py", line 266, in <lambda>
	    inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib64/python3.9/site-packages/twisted/python/context.py", line 122, in callWithContext
	    return self.currentContext().callWithContext(ctx, func, *args, **kw)
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib64/python3.9/site-packages/twisted/python/context.py", line 85, in callWithContext
	    return func(*args,**kw)
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib/python3.9/site-packages/buildbot/config.py", line 154, in loadConfig
	    filename, config_dict = loadConfigDict(
	--- <exception caught here> ---
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib/python3.9/site-packages/buildbot/config.py", line 117, in loadConfigDict
	    execfile(filename, localDict)
	  File "/home/filbot/Documents/Development/buildbot/venv/buildbot/lib64/python3.9/site-packages/twisted/python/compat.py", line 247, in execfile
	    exec(code, globals, locals)
	  File "/home/filbot/Documents/Development/buildbot/master/master.cfg", line 45, in <module>
	    c['schedulers'].append(bb.master.bb_schedulers())
	  File "/home/filbot/Documents/Development/buildbot/master/local_builder/master.py", line 34, in bb_schedulers
	    bb_schedules.append(schedulers.ForceScheduler(
	builtins.TypeError: __init__() missing 1 required positional argument: 'name'
	
2021-02-14 20:38:52-0600 [-] Configuration Errors:
2021-02-14 20:38:52-0600 [-]   error while parsing config file: __init__() missing 1 required positional argument: 'name' (traceback in logfile)
2021-02-14 20:38:52-0600 [-] Halting master.
2021-02-14 20:38:52-0600 [-] BuildMaster startup failed
2021-02-14 20:38:52-0600 [-] BuildMaster is stopped
2021-02-14 20:38:52-0600 [-] Main loop terminated.
2021-02-14 20:38:52-0600 [-] Server Shut Down.

I know that parameter is required of the ForceSchedulers, but I don't know why Buildbot is saying these errors.

@FilBot3 FilBot3 self-assigned this Feb 15, 2021
@FilBot3
Copy link
Owner Author

FilBot3 commented Feb 15, 2021

I had to switch from using .append() to .extend() because I'm not adding individual elements, but concatenating lists.

c['schedulers'] = []
c['schedulers'].extend(bb.master.bb_schedulers())
# BUILDERS
c['builders'] = []
c['builders'].extend(bb.master.bb_builders())

@FilBot3 FilBot3 closed this as completed Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant