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

federation application does not override collective with -T option #95

Open
lukebigum opened this issue Sep 3, 2020 · 2 comments
Open

Comments

@lukebigum
Copy link
Contributor

From choria-legacy/mcollective-choria#576, the -T collective option has been added to the federation application directly. When I try use this, it doesn't appear to override the main_collective setting in /etc/puppetlabs/mcollective/client.cfg.

I do something a little odd; I set a default collective of one that doesn't exist to force the admins to think about what collective they are sending the message to (rather than defaulting to our entire estate):

main_collective = deliberately_broken
[biguml@federator ~]$ mco federation trace nodename -v -T all

The federation application failed to run: Unknown collective 'deliberately_broken' known collectives are '...'

The environment variable MCOLLECTIVE_FED_COLLECTIVE also doesn't seem to work, but that may be a side affect of not importing all the mcorpc code, as you say.

@ripienaar
Copy link
Member

Can you show the backtrace please? I am guessing the configuration is initialized early and then a new client is made with the set collective - but by then its too late, help to see the backtrace

MCOLLECTIVE_FED_COLLECTIVE wouldnt help here thats something else

@lukebigum
Copy link
Contributor Author

Apologies, cut too much off:

Unknown collective 'deliberately_broken' known collectives are '... ... ...' (RuntimeError)
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/choria-mcorpc-support-2.21.1/lib/mcollective/util.rb:237:in `make_subscriptions'  <----
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/choria-mcorpc-support-2.21.1/lib/mcollective/client.rb:93:in `subscribe'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/choria-mcorpc-support-2.21.1/lib/mcollective/client.rb:87:in `createreq'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/choria-mcorpc-support-2.21.1/lib/mcollective/client.rb:171:in `req'
	from /opt/puppetlabs/mcollective/plugins/mcollective/application/federation.rb:43:in `trace_node'
	from /opt/puppetlabs/mcollective/plugins/mcollective/application/federation.rb:155:in `trace_command'
	from /opt/puppetlabs/mcollective/plugins/mcollective/application/federation.rb:229:in `main'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/choria-mcorpc-support-2.21.1/lib/mcollective/application.rb:283:in `run'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/choria-mcorpc-support-2.21.1/lib/mcollective/applications.rb:23:in `run'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/choria-mcorpc-support-2.21.1/bin/mco:33:in `<top (required)>'
	from /usr/bin/mco:23:in `load'
	from /usr/bin/mco:23:in `<main>'

@ripienaar ripienaar transferred this issue from choria-legacy/mcollective-choria Jan 4, 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

2 participants