Opsworks实例无法启动:状态:start_failed:没有这样的cookbook:apt

时间:2016-12-14 13:40:11

标签: json amazon-web-services templates amazon-cloudformation aws-opsworks

我创建了一个创建opsworks资源的cloudformation模板:stack,layer,app和instance。我将我的食谱添加到S3并测试了我的模板,除opsworks实例外,所有资源都已成功创建,我收到此错误:

CREATE_FAILED   AWS::OpsWorks::Instance     MyInstance  ff45a8d0-9adf-40a4-a049-f2329a9fa1f0 failed. Status=start_failed

任何人都可以告诉我应该在哪里检查,原因是什么? 此外,我已经尝试了这么多实例类型,内存优化但仍然得到错误。请帮忙。非常感谢你。

以下是日志:

[2016-12-15T13:58:12+00:00] INFO: directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f] created directory /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f
[2016-12-15T13:58:12+00:00] INFO: Processing directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 92)
[2016-12-15T13:58:12+00:00] INFO: directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags] created directory /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags
[2016-12-15T13:58:12+00:00] INFO: Processing directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/nodes] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 97)
[2016-12-15T13:58:12+00:00] INFO: directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/nodes] created directory /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/nodes
[2016-12-15T13:58:12+00:00] INFO: Processing template[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/client.rb] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 106)
[2016-12-15T13:58:12+00:00] INFO: template[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/client.rb] created file /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/client.rb
[2016-12-15T13:58:12+00:00] INFO: template[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/client.rb] updated file contents /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/client.rb
[2016-12-15T13:58:12+00:00] INFO: Processing file[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/attribs.json] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 114)
[2016-12-15T13:58:12+00:00] INFO: file[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/attribs.json] created file /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/attribs.json
[2016-12-15T13:58:12+00:00] INFO: file[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/attribs.json] updated file contents /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/attribs.json
[2016-12-15T13:58:12+00:00] INFO: Processing directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_app] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
[2016-12-15T13:58:12+00:00] INFO: directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_app] created directory /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_app
[2016-12-15T13:58:12+00:00] INFO: Processing directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_instance] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
[2016-12-15T13:58:12+00:00] INFO: directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_instance] created directory /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_instance
[2016-12-15T13:58:12+00:00] INFO: Processing file[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_instance/script.json] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 208)
[2016-12-15T13:58:12+00:00] INFO: file[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_instance/script.json] created file /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_instance/script.json
[2016-12-15T13:58:12+00:00] INFO: file[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_instance/script.json] updated file contents /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_instance/script.json
[2016-12-15T13:58:12+00:00] INFO: Processing directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_layer] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
[2016-12-15T13:58:12+00:00] INFO: directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_layer] created directory /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_layer
[2016-12-15T13:58:12+00:00] INFO: Processing file[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_layer/node.json] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 208)
[2016-12-15T13:58:12+00:00] INFO: file[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_layer/node.json] created file /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_layer/node.json
[2016-12-15T13:58:12+00:00] INFO: file[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_layer/node.json] updated file contents /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_layer/node.json
[2016-12-15T13:58:12+00:00] INFO: Processing directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_stack] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
[2016-12-15T13:58:12+00:00] INFO: directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_stack] created directory /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_stack
[2016-12-15T13:58:12+00:00] INFO: Processing file[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_stack/a0dc4b91-63dc-4947-95c2-f28d2fae00fb.json] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 208)
[2016-12-15T13:58:12+00:00] INFO: file[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_stack/a0dc4b91-63dc-4947-95c2-f28d2fae00fb.json] created file /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_stack/a0dc4b91-63dc-4947-95c2-f28d2fae00fb.json
[2016-12-15T13:58:12+00:00] INFO: file[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_stack/a0dc4b91-63dc-4947-95c2-f28d2fae00fb.json] updated file contents /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_stack/a0dc4b91-63dc-4947-95c2-f28d2fae00fb.json
[2016-12-15T13:58:12+00:00] INFO: Processing directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_command] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
[2016-12-15T13:58:12+00:00] INFO: directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_command] created directory /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_command
[2016-12-15T13:58:12+00:00] INFO: Processing file[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_command/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f.json] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 208)
[2016-12-15T13:58:12+00:00] INFO: file[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_command/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f.json] created file /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_command/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f.json
[2016-12-15T13:58:12+00:00] INFO: file[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_command/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f.json] updated file contents /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_command/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f.json
[2016-12-15T13:58:12+00:00] INFO: Processing directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_user] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
[2016-12-15T13:58:12+00:00] INFO: directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_user] created directory /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_user
[2016-12-15T13:58:12+00:00] INFO: Processing directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_elastic_load_balancer] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
[2016-12-15T13:58:12+00:00] INFO: directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_elastic_load_balancer] created directory /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_elastic_load_balancer
[2016-12-15T13:58:12+00:00] INFO: Processing directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_rds_db_instance] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
[2016-12-15T13:58:12+00:00] INFO: directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_rds_db_instance] created directory /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_rds_db_instance
[2016-12-15T13:58:12+00:00] INFO: Processing directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_ecs_cluster] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
[2016-12-15T13:58:12+00:00] INFO: directory[/var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_ecs_cluster] created directory /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags/aws_opsworks_ecs_cluster
[2016-12-15T13:58:12+00:00] WARN: Skipping final node save because override_runlist was given
[2016-12-15T13:58:12+00:00] INFO: Chef Run complete in 30.522850769 seconds
[2016-12-15T13:58:12+00:00] INFO: Skipping removal of unused files from the cache
[2016-12-15T13:58:12+00:00] INFO: Running report handlers
[2016-12-15T13:58:12+00:00] INFO: Report handlers complete

[2016-12-15T13:58:13+00:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /var/chef
One version per cookbook
data_bags at /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/data_bags
nodes at /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/nodes

[2016-12-15T13:58:13+00:00] INFO: Forking chef instance to converge...
[2016-12-15T13:58:13+00:00] INFO: *** Chef 12.16.42 ***
[2016-12-15T13:58:13+00:00] INFO: Platform: x86_64-linux
[2016-12-15T13:58:13+00:00] INFO: Chef-client pid: 3500
[2016-12-15T13:58:14+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/script.localdomain
[2016-12-15T13:58:14+00:00] INFO: Setting the run_list to ["recipe[cassandra-php-driver::setup]", "recipe[security::setup]"] from CLI options
[2016-12-15T13:58:14+00:00] INFO: Run List is [recipe[cassandra-php-driver::setup], recipe[security::setup]]
[2016-12-15T13:58:14+00:00] INFO: Run List expands to [cassandra-php-driver::setup, security::setup]
[2016-12-15T13:58:14+00:00] INFO: Starting Chef Run for script.localdomain
[2016-12-15T13:58:14+00:00] INFO: Running start handlers
[2016-12-15T13:58:14+00:00] INFO: Start handlers complete.
[2016-12-15T13:58:14+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found: 
[2016-12-15T13:58:14+00:00] INFO: HTTP Request Returned 412 Precondition Failed: No such cookbook: apt

================================================================================
Error Resolving Cookbooks for Run List:
================================================================================

Missing Cookbooks:
------------------
No such cookbook: apt

Expanded Run List:
------------------
* cassandra-php-driver::setup
* security::setup

Platform:
---------
x86_64-linux

[2016-12-15T13:58:14+00:00] ERROR: Running exception handlers
[2016-12-15T13:58:14+00:00] ERROR: Exception handlers complete
[2016-12-15T13:58:14+00:00] FATAL: Stacktrace dumped to /var/chef/runs/a679dc7b-3cbf-4d43-9bc8-5ae0223d3b5f/local-mode-cache/cache/chef-stacktrace.out
[2016-12-15T13:58:14+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-12-15T13:58:14+00:00] ERROR: 412 "Precondition Failed"
[2016-12-15T13:58:14+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

1 个答案:

答案 0 :(得分:1)

从错误消息中,听起来您的传真食谱依赖项(apt)不存在于您的食谱库中。

显然是AWS OpsWorks' Berkshelf支持在版本之间发生了变化。只有Chef 11.10 OpsWorks版本有built-in Berkshelf support,但随后被从Chef 12 OpsWorks版本中删除。

如果您的CloudFormation管理的OpsWorks堆栈使用的是Chef版本12,并且您没有在其他地方使用Berkshelf打包您的cookbook依赖项,我建议您指定Chef版本11.10,或者遵循{{3中指定的流程在本地打包您的cookbook依赖项的文档,并使用打包的cookbook存储库作为您的自定义cookbook源。