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

Error executing action create on resource memcached.yml #351

Open
laertispappas opened this issue Nov 29, 2015 · 2 comments
Open

Error executing action create on resource memcached.yml #351

laertispappas opened this issue Nov 29, 2015 · 2 comments

Comments

@laertispappas
Copy link

Error executing action create on resource 'template[/srv/www/test-app-app/shared/config/memcached.yml]'

NoMethodError

undefined method `[]' for nil:NilClass

Cookbook Trace:

/var/lib/aws/opsworks/cache.stage2/cookbooks/rails/recipes/configure.rb:51:in `block (3 levels) in from_file'

Resource Declaration:

In /var/lib/aws/opsworks/cache.stage2/cookbooks/rails/recipes/configure.rb

37: template "#{deploy[:deploy_to]}/shared/config/memcached.yml" do
38: source "memcached.yml.erb"
39: cookbook 'rails'
40: mode "0660"
41: group deploy[:group]
42: owner deploy[:user]
43: variables(
44: :memcached => deploy[:memcached] || {},
45: :environment => deploy[:rails_env]
46: )
47:
48: notifies :run, "execute[restart Rails app #{application}]"
49:
50: only_if do
51: deploy[:memcached][:host].present? && File.directory?("#{deploy[:deploy_to]}/shared/config/")
52: end
53: end
54: end

@laertispappas
Copy link
Author

Solved by adding a custom JSON to stack for memcahce attribute:
{
"deploy": {
"allpolls-app": {
"database": {
"adapter": "postgresql",
"encoding": "unicode",
"host": "....rds.amazonaws.com",
"port": "1234",
"database": "test_production",
"pool": "5",
"username": "...",
"password": "..."
},
"redis":
{
"host": "....amazonaws.com",
"port": "..."
},
"memcached":
{
}
}
}
}

@sethfloydjr
Copy link

Im seeing the same issue but adding the custom json as above has not worked for me.

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