Skip to content

Instantly share code, notes, and snippets.

@tpetchel
Created December 22, 2014 17:21
Show Gist options
  • Save tpetchel/e2b808642860913b6eff to your computer and use it in GitHub Desktop.
Save tpetchel/e2b808642860913b6eff to your computer and use it in GitHub Desktop.
chef-provisioning security group not found
Unfortunately, I seem to be stuck when I run
chef-client --local-mode --runlist 'recipe[web::servers]'
under the Provision a Server section of the walkthrough. I do have us-west-2 specified in my ~/.aws/config file, so it's finding the AMI just fine, but it's still erroring out with this error (see below - it's not finding the security group it expects). Any advice on how I can move past this?
[vagrant@localhost chef-repo]$ chef-client --local-mode --runlist 'recipe[web::servers]'
[2014-12-22T03:31:44+00:00] WARN: No config file found or specified on command line, using command line options.
Starting Chef Client, version 11.18.0.rc.1
resolving cookbooks for run list: ["web::servers"]
Synchronizing Cookbooks:
- web
Compiling Cookbooks...
Converging 3 resources
Recipe: web::servers
* aws_security_group[webserver-ssh] action create
================================================================================
Error executing action `create` on resource 'aws_security_group[webserver-ssh]'
================================================================================
AWS::EC2::Errors::InvalidGroup::NotFound
----------------------------------------
The security group 'sg-41a37024' does not exist
Resource Declaration:
---------------------
# In /home/vagrant/.chef/local-mode-cache/cache/cookbooks/web/recipes/servers.rb
5: aws_security_group 'webserver-ssh' do
6: inbound_rules [{:ports => 22, :protocol => :tcp, :sources => ['0.0.0.0/0'] }]
7: end
8:
Compiled Resource:
------------------
# Declared in /home/vagrant/.chef/local-mode-cache/cache/cookbooks/web/recipes/servers.rb:5:in `from_file'
aws_security_group("webserver-ssh") do
action :create
retries 0
retry_delay 2
guard_interpreter :default
id "webserver-ssh"
security_group_id "sg-41a37024"
cookbook_name "web"
recipe_name "servers"
inbound_rules [{:ports=>22, :protocol=>:tcp, :sources=>["0.0.0.0/0"]}]
end
Running handlers:
[2014-12-22T03:31:48+00:00] ERROR: Running exception handlers
Running handlers complete
[2014-12-22T03:31:48+00:00] ERROR: Exception handlers complete
[2014-12-22T03:31:48+00:00] FATAL: Stacktrace dumped to /home/vagrant/.chef/local-mode-cache/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 3.433701056 seconds
[2014-12-22T03:31:48+00:00] ERROR: aws_security_group[webserver-ssh] (web::servers line 5) had an error: AWS::EC2::Errors::InvalidGroup::NotFound: The security group 'sg-41a37024' does not exist
[2014-12-22T03:31:48+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment