dayglojesus / managedmac

Comprehensive Puppet module for OS X.
http://dayglojesus.github.io/managedmac/
Apache License 2.0
62 stars 21 forks source link

Could not autoload puppet/type/mobileconfig: no such file to load #80

Closed grahamgilbert closed 9 years ago

grahamgilbert commented 9 years ago
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload puppet/type/mobileconfig: no such file to load -- cfpropertylist on node vmz0qv5oyszr
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

This is with a master running the latest version of Puppet Server on Ubuntu 14 and a 10.10.3 client, both with the sqlite3 and CFPropertyList gems installed.

From the client:

$ gem list | grep "CFPropertyList"
CFPropertyList (2.3.1, 2.2.8)
Ginja commented 9 years ago

Latest version of Puppet Server, do you mean 4? If so how did you install the gem on the server? It uses Clojure, and just briefly looking at the installer, it looks like it comes with wrapper scripts for cli tools such as: ruby, irb, gem, and foreground. My thoughts are that the gem isn't in the right GEM_PATH.

Brian may know more. I'm out of the Puppet game ;)

grahamgilbert commented 9 years ago

No, I mean https://github.com/puppetlabs/puppet-server. I just ran gem install. I'm not much of a ruby guy, how would I get that it's in the right GEM_PATH?

Ginja commented 9 years ago

Right, sorry. That's what I meant by version 4.

Just read this:

Gems

If you have server-side Ruby code in your modules, Puppet Server will run it via JRuby. Generally speaking, this only affects custom parser functions and report processors. For the vast majority of cases, this shouldn't pose any problems, as JRuby is highly compatible with vanilla Ruby.

Installing And Removing Gems

We isolate the Ruby load paths that are accessible to Puppet Server's JRuby interpreter, so that it doesn't load any gems or other code that you have installed on your system Ruby. If you want Puppet Server to load additional gems, use the Puppet Server-specific gem command to install them.

Try using the following to install the necessary gems on the server:

https://github.com/puppetlabs/puppet-server/blob/master/documentation/gems.markdown

grahamgilbert commented 9 years ago

Yep, as you said that I RTFM again and it looks like the right path. I'll update the issue when I have more.

grahamgilbert commented 9 years ago

That's it! For prosperity, here's what I needed to do:

$ puppetserver gem install jdbc-sqlite3
$ puppetserver gem install CFPropertyList
dayglojesus commented 9 years ago

Thanks, guys -- IDKT.

dayglojesus commented 9 years ago

One comment...

I don't think you need the sqlite3 gem on the master/server/whatevah. Unlike CFPropertylist (which gets used everywhere), the code that requires sqlite3 is the Macauthdb and that should only ever get loaded on client.

poolski commented 9 years ago

Hate to reopen old issues, but I'm still having this problem, having tried all of the fixes in this thread. I'm using 0.7.0 of this module.

dayglojesus commented 9 years ago

If I understand this issue as it's being described, this is not a problem with the managedmac Puppet module, but rather that the Puppet 4 "Puppet Server" (not Puppet Master) can't load the required Ruby gems. Correct?

What platform are you running the Puppet Server on?

dayglojesus commented 9 years ago

What happens when you run... puppetserver gem list or sudo puppetserver gem list? Do you see the sqlite3 or jdbc-sqlite3 gem?

This documentation might be helpful...

https://github.com/puppetlabs/puppet-server/blob/master/documentation/gems.markdown

poolski commented 9 years ago

Hey, here's what I have installed

# puppetserver gem list           

*** LOCAL GEMS ***

CFPropertyList (2.3.1)
deep_merge (1.0.1)
jar-dependencies (0.1.13)
jdbc-sqlite3 (3.8.10.1)
jruby-openssl (0.9.7 java)
json (1.8.0 java)
rake (10.1.0)
rdoc (4.1.2)

# puppetserver --version
puppetserver version: 1.1.1
dayglojesus commented 9 years ago

Can you paste the exact error you are getting? Also, is it from the server or client?

poolski commented 9 years ago

It's on the client:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload puppet/type/mobileconfig: no such file to load -- puppet/managedmac/common on node macbook.network.net
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run.
dayglojesus commented 9 years ago

Right. Okay, I can reproduce this, but the error you are getting is different than the one reported in this thread by @grahamgilbert -- completely different -- he reported an issue with a missing gem.

Your issue is closer to #62 .

This error was fixable in Puppet 3 by running:

  1. sudo puppet config set pluginsync true on both client and master
  2. puppet agent -t on the master

But this doesn't appear to solve the issue with Puppet 4's puppetserver AFAICT.

At present, I am not sure why, but it has to do a Ruby load path. This is the salient portion of the error:

Could not autoload puppet/type/mobileconfig: no such file to load -- puppet/managedmac/common

Which basically means, Ruby (or maybe Puppet) can't load puppet/managedmac/common, but when I check the plugin cache on the server and client, that file is there. This code should work and the library should load.

I need to determine whether or this can be fixed in Puppet somehow or whether I need to fix this in my own code with some ugly hack.

When I have more to say, I will post back, but this issue deserves it's own thread.

I will close this and re-open under a new issue.

HTH

dayglojesus commented 9 years ago

New issue opened for this. Feel free to comment.