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

Windows: Invalid Relationship #569

Closed
dzeleski opened this issue Oct 26, 2016 · 12 comments
Closed

Windows: Invalid Relationship #569

dzeleski opened this issue Oct 26, 2016 · 12 comments
Labels

Comments

@dzeleski
Copy link
Contributor

dzeleski commented Oct 26, 2016

Currently trying to install sensu on windows 2012R2. Getting the following error:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: File[C:/opt/sensu/conf.d] { require => Package[Sensu] }, because Package[Sensu] doesn't seem to be in the catalog

We wrap the sensu module around our own, but our hiera data looks like this:

win_monitoring:
   sensu:
      config:
         version: '0.26.3-1'
         install_repo: true
         purge: true
         rabbitmq_host: hostname
         rabbitmq_password: secret
         rabbitmq_port: 5672
         rabbitmq_vhost: '/sensu'
         use_embedded_ruby: true
         manage_services: false

We then splat the config into the sensu class:

  class { 'sensu':
    * => $config,
  }

We are using sensu core as well, any ideas on what might be wrong or what im missing? There isn't any real info on the forge or here as to how to deploy the windows client so I might be missing something silly.

Edit: the other thing I did try was to directly classify this node via the PE console using the sensu class directly and got the same error.

Edit2: trace

Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: File[C:/opt/sensu/conf.d] { require => Package[Sensu] }, because Package[Sensu] doesn't seem to be in the catalog C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/indirector/rest.rb:208:in `is_http_200?' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/indirector/rest.rb:106:in `find' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/indirector/indirection.rb:194:in `find' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/configurer.rb:377:in `block in retrieve_new_catalog' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util.rb:386:in `block in thinmark' C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.1.0/benchmark.rb:294:in `realtime' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util.rb:385:in `thinmark' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/configurer.rb:376:in `retrieve_new_catalog' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/configurer.rb:78:in `retrieve_catalog' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/configurer.rb:147:in `prepare_and_retrieve_catalog' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/configurer.rb:281:in `run_internal' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/configurer.rb:186:in `block in run' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/context.rb:65:in `override' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet.rb:240:in `override' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/configurer.rb:185:in `run' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:45:in `block (4 levels) in run' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent/locker.rb:21:in `lock' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:45:in `block (3 levels) in run' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:98:in `with_client' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:42:in `block (2 levels) in run' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:65:in `run_in_fork' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:41:in `block in run' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:179:in `call' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:179:in `controlled_run' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/agent.rb:39:in `run' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/application/agent.rb:353:in `onetime' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/application/agent.rb:331:in `run_command' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:344:in `block in run' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util.rb:540:in `exit_on_fail' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/application.rb:344:in `run' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/command_line.rb:128:in `run' C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/command_line.rb:72:in `execute' C:/Program Files/Puppet Labs/Puppet/puppet/bin/puppet:5:in `<main>'

Thanks,
Dylan

@jaxxstorm
Copy link
Contributor

Can you confirm the commit ID you're using for the module?

I merged this a couple days back which should fix this: https://github.com/sensu/sensu-puppet/pull/544/files

@jaxxstorm jaxxstorm added the bug label Oct 27, 2016
@dzeleski
Copy link
Contributor Author

Im actually using the forge for this. Currently 2.1.0 which is the most recent version available. I assume that commit has not been pushed up as a new version? I can pull that commit down directly from git and test.

@dzeleski
Copy link
Contributor Author

@jaxxstorm Ok pulled commit: 30ffce5

Getting this now:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: no parameter named 'sentinels' at /etc/puppet
labs/code/environments/lab/modules/sensu/manifests/redis/config.pp:32 on Sensu_redis_config[<REMOVED>]
 at /etc/puppetlabs/code/environments/lab/modules/sensu/manifests/redis/config.pp:32 on node <REMOVED>

@jaxxstorm
Copy link
Contributor

@dzeleski did you restart your puppetmaster? Any changes to types/providers usually require a restart due to an old bug

@dzeleski
Copy link
Contributor Author

dzeleski commented Nov 6, 2016

waaaa? really? I had no idea that was a thing. Im on vacation until the 14th, if I have a second ill give that a shot but if not I may not update this until then, appreciate your input!

@jaxxstorm
Copy link
Contributor

Here's the puppetlabs ticket for it :)

https://projects.puppetlabs.com/issues/8750

@dzeleski
Copy link
Contributor Author

dzeleski commented Nov 6, 2016

wow ive not run into that until possibly now. Interesting, thanks for the info. Ill try and give our lab master a restart tomorrow and see what happens.

@r0b0tAnthony
Copy link
Contributor

Hey getting this error as well on Windows 7 running puppet 3.8.4.

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Inval id parameter sentinels on Sensu_redis_config[PHOSPHENE09-PC.nyc.phosphenefx.com] at /etc/puppet/environments/development/modules/sensu/manifests/redis/config.pp :43 on node phosphene09-pc.nyc.phosphenefx.com Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run

Have already tried restarting twice to no avail. Should we also be skipping redis setup entirely in init.pp if I'm only installing client?

@jaxxstorm
Copy link
Contributor

@r0b0tAnthony can you post some config? sentinels is undef by default, so this shouldn't be happening if you're restarted:

https://github.com/sensu/sensu-puppet/blob/master/manifests/init.pp#L376

@dzeleski
Copy link
Contributor Author

@jaxxstorm Not getting that error after a restart but now its failing on either creating the sensu user, or if I disable manage user it cannot find the sensu user or use the built in administrator user.

With manage_user set to false:

Error: Could not find user Sensu
Error: /Stage[main]/Sensu::Package/File[C:/opt/sensu/conf.d]/owner: change from BUILTIN\Administrators to Sensu failed:
Could not find user Sensu

true:

Error: User update failed: (in OLE method `SetInfo': )
    OLE error code:800708C5 in Active Directory
      The password does not meet the password policy requirements. Check the minimum password length, password complexit
y and password history requirements.

    HRESULT error code:0x80020009
      Exception occurred.
Wrapped exception:
(in OLE method `SetInfo': )
    OLE error code:800708C5 in Active Directory
      The password does not meet the password policy requirements. Check the minimum password length, password complexit
y and password history requirements.

    HRESULT error code:0x80020009
      Exception occurred.
Error: /Stage[main]/Sensu::Package/User[Sensu]/ensure: change from absent to present failed: User update failed: (in OLE
 method `SetInfo': )
    OLE error code:800708C5 in Active Directory
      The password does not meet the password policy requirements. Check the minimum password length, password complexit
y and password history requirements.

    HRESULT error code:0x80020009
      Exception occurred.

The biggest issue is that I cannot find any documentation on how to setup a windows client, I also dug through some of the code and I dont see any parameters on setting the sensu user/password for the service account. I can obviously create a sensu user but I feel like the sensu module should be able to handle that no?

Also my module that I wrote to get around this issue registers the sensu service as local system, is there any reason why this shouldnt be done? Most solutions I see on windows should be totally happy as a local system service.

  exec {'create_sensu_client_service':
    command  => 'new-service -name sensu-client -BinaryPathName "c:\\opt\\sensu\\bin\\sensu-client.exe" -DisplayName "Sensu Client"',
    unless   => 'if (Get-Service sensu-client -ErrorAction SilentlyContinue) {exit 0} else {exit 1}',
    provider => powershell,
    require  => Dsc_package["sensu-${sensu_version}.msi"],
  }

@dschaaff
Copy link

I'm also experiencing an error related to sentinels, which I have left at the module defaults

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid parameter sentinels on Sensu_redis_config[pp.intellisis.com] at /etc/puppet/environments/production/modules/sensu/manifests/redis/config.pp:43 on node example
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

@jaxxstorm
Copy link
Contributor

@dschaaff restart your puppetmaster
@dzeleski can you open a new issue for your new error regarding windows issues, seems this is resolved by the types and providers leakage issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants