voxpupuli/puppet-corosync

Could not autoload puppet/provider/cs_property/pcs:

Closed this issue · 11 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet:
    puppet --version
    4.10.4
  • Ruby:
    Ruby comes with puppet-agent:
    /opt/puppetlabs/puppet/lib/ruby/2.1.0
  • Distribution:
    Xenial 16.04.2
  • Module version:

2016-09-16 - Release 5.0.0

How to reproduce (e.g Puppet code you use)

corosync::service { 'pacemaker':
version => '0',
}
include corosync
create_resources(cs_property,$properties)

What are you seeing

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Could not autoload puppet/type/cs_property: Could not autoload puppet/provider/cs_property/pcs: Unable to find corosync module in modulepath /etc/puppetlabs/code/environments/common:/etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules at /etc/puppetlabs/code/environments/internlnet/modules/profiles/manifests/ha/pacemaker.pp:15:3 on node fw03.asd2.internl.net

What behaviour did you expect instead

no errors during the run.

Output log

The same as the error message.

Any additional information you'd like to impart

I was having a similar error and was able to resolve by doing two things:

  1. Running puppet on the puppet server against itself
  2. Updating ruby-load-path in /etc/puppetlabs/puppetserver/conf.d/puppetserver.conf - I am currently trying to figure out a way to not need to make the puppetserver.conf update.
# configuration for the JRuby interpreters
jruby-puppet: {
    # Where the puppet-agent dependency places puppet, facter, etc...
    # Puppet server expects to load Puppet from this location
    #ruby-load-path: [/opt/puppetlabs/puppet/lib/ruby/vendor_ruby]
    ruby-load-path: [/opt/puppetlabs/puppet/lib/ruby/vendor_ruby, /opt/puppetlabs/puppet/cache/lib]

Unable to find corosync module in modulepath /etc/puppetlabs/code/environments/common:/etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules at /etc/puppetlabs/code/environments/internlnet/modules/profiles/manifests/ha/pacemaker.pp:15:3 on node fw03.asd2.internl.net

@Vinclame, it seems to be an environment issue on the server side, not an issue with the corosync module. Can you confirm?

unfortunately I can't test this anymore. I've another job.

Hi, I have the same problem:

  • Puppet-Agent: 4.10.9
  • OS: RHEL 7.3

Problem:
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cs_location: Could not autoload puppet/provider/cs_location/crm: Unable to find corosync module in modulepath /etc/puppetlabs/code/environments/common:/etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules:/usr/share/puppet/modules at /etc/puppetlabs/code/environments/mattermost/site/profile/manifests/corosync.pp:39:3

After a second puppet run there is no more issue.

Hello,
I have got the same issue. Anyone can point me to the solution?
What do you mean by:
Running puppet on the puppet server against itself ?

Thanks
My error:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cs_location: Could not autoload puppet/provider/cs_location/crm: Unable to find corosync module in modulepath /etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules at /etc/puppetlabs/code/environments/DI_689/modules/profile/manifests/corosync.pp:26:3 on node testing-ha-01

Nevermind. Apparently this error came from a resource called twice with same name within the module. Corrected that the error disappeared.

It looks like Puppet::Module.find('corosync', Puppet[:environment].to_s) cannot find the module when using a custom environment.

I will look into it.

towo commented

Just triggered this while not changing anything with the configuration code, but updating the system with the puppet master. Possibly a version issue with Puppet, and when dealing with the crm property.

towo commented

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cs_property: Could not autoload puppet/provider/cs_property/crm: Unable to find corosync module in modulepath /etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules (file: /etc/puppetlabs/code/environments/issue_4968/modules/profile/manifests/pacemaker.pp, line: 11, column: 3)

Okay, seems like my modulepath is borked leading to the issues, possibly not relephant, then.

towo commented

After some fiddling around, I noticed that at least with 5.3, one can simply replace

Puppet::Module.find('corosync', Puppet[:environment].to_s)

with

Puppet::Module.find('corosync')

and it works.

find will use the :current_environment symbol when the environment parameter is nil, and that seems to work a-ok. I've bumped it into a PR (#442).

I had this problem, while also using a 'custom' environment. By custom I mean one not called production, and I was able to fix it by also deploying my code to the production environment. Hopefully this helps your investigation.