Encrypted-attribute cookbook relies on Chef::REST?


Hit an issue when trying to read an encrypted attribute using @zuazo_onddo’s useful cookbook.

On one node sits my DB, with auto-generated encrypted passwords, however my automated client connections are on another node. This seemed to be a simple enough solution on the client:

# Install Encrypted Attributes gem
include_recipe 'encrypted_attributes'
# Expose the public key for encryption
include_recipe 'encrypted_attributes::expose_key'

# Include the #secure_password method from the openssl cookbook
self.class.send(:include, Opscode::OpenSSL::Password)

# Include the Encrypted Attributes cookbook helpers
self.class.send(:include, Chef::EncryptedAttributesHelpers)

# Encrypted Attributes will be grabbed from a remote node
def retrieve_mysql_password(user)
  key = "server_#{user}_password"
  dev_server =  node['my-app']['db-server']
  encrypted_attribute_read_from_node("#{db_server}", ['mysql-core', key])

However Chef doesn’t agree (compile-time failure):

  uninitialized constant Chef::REST

  Relevant File Content:

Being new to Chef, I couldn’t find my way to the source of the issue, any suggestions? I’m aware that I could go the databag route, but given my previous point I’d rather stay within my comfort zone if at all possible for now…


Hi mossy,

  uninitialized constant Chef::REST

This error was fixed in master by Eric Blevins a couple of weeks ago.

I just released version 0.9.0 of the gem with the fix.

I hope this helps with your problem.


I shall upgrade later today, try it out and then let you know. Thanks Zauzo


OK. Any feedback is welcome.

The cookbook is a bit old and may need some updating. Don’t hesitate to open an issue if you encounter any problem:


Will do. The issue was parked for the short term, but is on the critical path so will be revisited in the next few days.


Works, many thanks!