我对AWS OpsWorks有一个奇怪的问题。当我尝试启动t2.micro
实例时,安装失败。但是,如果我尝试启动t2.small
实例或任何大于micro
实例的实例,它就会启动就好了。
我认为这可能是因为没有与micro
实例关联的足够空间,但是我无法在我的日志文件中找到insufficient space
错误。
我的设置似乎在运行npm install
时失败,因为我注意到gulp build
的错误,我与npm install
脚本相关联。以下是我的package.json
文件的脚本部分:
如果有人能帮助我理解为什么我的设置在t2.micro
失败,但是在更大的实例上工作,那将非常感激:)
我已经附加了发生错误的日志文件部分:
[2016-08-12T15:12:29+00:00] INFO: deploy[/srv/www/apollo] cloning repo git@github.com:thomasbaldwin/apollo.git to /srv/www/apollo/shared/cached-copy
[2016-08-12T15:12:30+00:00] INFO: deploy[/srv/www/apollo] checked out branch: HEAD onto: deploy reference: fc18715aaed807f9d9f6e969b4180ace099d3f37
[2016-08-12T15:12:30+00:00] INFO: deploy[/srv/www/apollo] synchronizing git submodules
[2016-08-12T15:12:30+00:00] INFO: deploy[/srv/www/apollo] enabling git submodules
[2016-08-12T15:12:30+00:00] INFO: deploy[/srv/www/apollo] set user to deploy
[2016-08-12T15:12:30+00:00] INFO: deploy[/srv/www/apollo] set group to apache
[2016-08-12T15:12:30+00:00] INFO: deploy[/srv/www/apollo] copied the cached checkout to /srv/www/apollo/releases/20160812151229
[2016-08-12T15:12:30+00:00] INFO: deploy[/srv/www/apollo] set user to deploy
[2016-08-12T15:12:30+00:00] INFO: deploy[/srv/www/apollo] set group to apache
[2016-08-12T15:12:30+00:00] INFO: deploy[/srv/www/apollo] running callback before_migrate
[2016-08-12T15:12:30+00:00] INFO: deploy[/srv/www/apollo] created directories before symlinking: tmp,public,config
[2016-08-12T15:12:30+00:00] INFO: deploy[/srv/www/apollo] linked shared paths into current release: system => public/system, pids => tmp/pids, log => log
[2016-08-12T15:12:30+00:00] INFO: deploy[/srv/www/apollo] made pre-migration symlinks
[2016-08-12T15:12:30+00:00] INFO: deploy[/srv/www/apollo] set user to deploy
[2016-08-12T15:12:30+00:00] INFO: deploy[/srv/www/apollo] set group to apache
[2016-08-12T15:12:30+00:00] INFO: package.json detected. Running npm install --production.
================================================================================
Error executing action `deploy` on resource 'deploy[/srv/www/apollo]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of sudo su - deploy -c 'cd /srv/www/apollo/releases/20160812151229 && npm install --production' 2>&1 ----
STDOUT: npm WARN package.json Apollo@0.1.0 No README data
npm WARN deprecated graceful-fs@3.0.8: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
> Apollo@0.1.0 install /srv/www/apollo/releases/20160812151229
> gulp build
STDERR:
---- End output of sudo su - deploy -c 'cd /srv/www/apollo/releases/20160812151229 && npm install --production' 2>&1 ----
Ran sudo su - deploy -c 'cd /srv/www/apollo/releases/20160812151229 && npm install --production' 2>&1 returned 1
Cookbook Trace:
---------------
/var/lib/aws/opsworks/cache.stage2/cookbooks/opsworks_commons/libraries/shellout.rb:9:in `shellout'
/var/lib/aws/opsworks/cache.stage2/cookbooks/opsworks_nodejs/libraries/nodejs_configuration.rb:6:in `npm_install'
/var/lib/aws/opsworks/cache.stage2/cookbooks/deploy/definitions/opsworks_deploy.rb:151:in `block (3 levels) in from_file'
Resource Declaration:
---------------------
# In /var/lib/aws/opsworks/cache.stage2/cookbooks/deploy/definitions/opsworks_deploy.rb
65: deploy deploy[:deploy_to] do
66: provider Chef::Provider::Deploy.const_get(deploy[:chef_provider])
67: keep_releases deploy[:keep_releases]
68: repository deploy[:scm][:repository]
69: user deploy[:user]
70: group deploy[:group]
71: revision deploy[:scm][:revision]
72: migrate deploy[:migrate]
73: migration_command deploy[:migrate_command]
74: environment deploy[:environment].to_hash
75: purge_before_symlink(deploy[:purge_before_symlink]) unless deploy[:purge_before_symlink].nil?
76: create_dirs_before_symlink(deploy[:create_dirs_before_symlink])
77: symlink_before_migrate(deploy[:symlink_before_migrate])
78: symlinks(deploy[:symlinks]) unless deploy[:symlinks].nil?
79: action deploy[:action]
80:
81: if deploy[:application_type] == 'rails' && node[:opsworks][:instance][:layers].include?('rails-app')
82: restart_command "sleep #{deploy[:sleep_before_restart]} && #{node[:opsworks][:rails_stack][:restart_command]}"
83: end
84:
Compiled Resource:
------------------
# Declared in /var/lib/aws/opsworks/cache.stage2/cookbooks/deploy/definitions/opsworks_deploy.rb:65:in `block in from_file'
deploy("/srv/www/apollo") do
params {:deploy_data=>{"deploy_to"=>"/srv/www/apollo", "chef_provider"=>"Timestamped", "keep_releases"=>5, "current_path"=>"/srv/www/apollo/current", "document_root"=>"", "ignore_bundler_groups"=>["test", "development"], "absolute_document_root"=>"/srv/www/apollo/current/", "rake"=>"rake", "migrate"=>false, "migrate_command"=>"if [ -f Gemfile ]; then echo 'OpsWorks: Gemfile found - running migration with bundle exec' && /usr/local/bin/bundle exec rake db:migrate; else echo 'OpsWorks: no Gemfile - running plain migrations' && rake db:migrate; fi", "rails_env"=>"production", "action"=>"deploy", "user"=>"deploy", "group"=>"apache", "shell"=>"/bin/bash", "home"=>"/home/deploy", "sleep_before_restart"=>0, "stack"=>{"needs_reload"=>false}, "enable_submodules"=>true, "shallow_clone"=>false, "delete_cached_copy"=>true, "purge_before_symlink"=>["log", "tmp/pids", "public/system"], "create_dirs_before_symlink"=>["tmp", "public", "config"], "symlink_before_migrate"=>{"config/opsworks.js"=>"opsworks.js"}, "symlinks"=>{"system"=>"public/system", "pids"=>"tmp/pids", "log"=>"log"}, "environment"=>{"RAILS_ENV"=>nil, "RUBYOPT"=>"", "RACK_ENV"=>nil, "HOME"=>"/home/deploy", "NODE_ENV"=>"production", "S3BUCKET"=>"apollo-cdn", "PLATFORM_APPLICATION_ARN"=>"arn:aws:sns:us-east-1:007683507359:app/APNS/Apollo_Prod"}, "environment_variables"=>{"NODE_ENV"=>"production", "S3BUCKET"=>"apollo-cdn", "PLATFORM_APPLICATION_ARN"=>"arn:aws:sns:us-east-1:007683507359:app/APNS/Apollo_Prod"}, "ssl_support"=>false, "auto_npm_install_on_deploy"=>true, "nodejs"=>{"restart_command"=>"monit restart node_web_app_apollo", "stop_command"=>"monit stop node_web_app_apollo", "port"=>80}, "application"=>"apollo", "application_type"=>"nodejs", "auto_bundle_on_deploy"=>true, "deploying_user"=>nil, "domains"=>["apollo"], "mounted_at"=>nil, "restart_command"=>"echo 'restarting app'", "ssl_certificate"=>nil, "ssl_certificate_key"=>nil, "ssl_certificate_ca"=>nil, "scm"=>{"scm_type"=>"git", "repository"=>"git@github.com:thomasbaldwin/apollo.git", "revision"=>nil, "ssh_key"=>"-----BEGIN RSA PRIVATE KEY-----\nMIIJKAIBAAKCAgEAtyyIeOYMzj5zv8FJqb0xYUHg5aog+Q8KNTKz5y4WXrRa6kR+\nNcQDnU2hu1iRUG5FK8O5XLHR7LSeiW85hvvbOSt8x37qIMJpgSsRZ0/62kQoat0P\nKzbLJlDGPWHbMXx4ryyrmD3+LpuaafEx4GAUyHS9Dm48Q1f0EIP3UTk1CulyasO2\ns7m7Og9ZncZHK6zBHF9BS0fKF2gomI5I5CSti7se5YBAdnAzlav3aeC5sr5oaDgV\n5B957pkofWk3qEVia7lewK8rHqIUEYKrgX9NFbikEonQNfsuGGjWMDU8XmRtNZdz\nwjhPk/pbl3C0T7LhYNpEVdF8kyQBmxkb1vCuwx7R39thcNWTtEhSuYHzGCxbJbl9\nGBcDYkRss4qWk7a9PkG6sWXL4ZO7A8fY2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\n7CGEAgZYXZiBcY8hfJ6czVULJ3n+GqN+JVqUpcOBRasrT/WnlfURU3VH0KPuFAoy\nP05QgYv0jsJiQI36ATEee1ARSPuNeLk8vIuXUXsQ/kZmVLgxWQkzuO184wlRRhTF\n9fqJoPEmoaFMXALEIPh7zYZhdZ5o5YO68l/ChVcnPQFHZBHWpsNQGvgI7NFMOw6I\n4GuqWty0h3W5r2WZi1Vwtu780Yyl1BcOf3Okr8w3JayQIdvB1DI8JIU6PoGmAVNo\nUzwHcLM5FFUppMRlrmebSAjUVbMiCpCjAoIBAFK+2nvsrrRXSD/rbePzdAmn8qw/\nAjOopgBEM7wK0v+6ThkgmDFLG076pQE1Re5e9FamzcWTjxa7A24uCsJczCHP4rJt\nrYOnhmXSMA+Y6VxN7xCwQi1e4rHrjAa9rVpQroPZjvQMANIlBBwfDYKCg0W+L4ay\nygqUxU69hAvZ4KLlzgmnV7XWpYgPUoZhj+/MX/uwX4QFuhw7fUkgb7FQ4ikVnNbg\nbKrKseupc8UJdVqCqmsVWHaLqFvu1JcOYd6YJiYlUg+8iY6a2gCYUOg3FlrceGva\neHTnzSZwJegF6gkoEf6wfyKlkH4W98xvv8k2rLRGToPEhT1D9/E2+b4FxYE=\n-----END RSA PRIVATE KEY-----", "user"=>nil, "password"=>nil}, "database"=>{"host"=>"apollo-rds-instance.cbl4aupzibte.us-east-1.rds.amazonaws.com", "database"=>"apollo", "port"=>3306, "username"=>"thomasbaldwinj", "password"=>"91zFzVoh", "reconnect"=>true, "data_source_provider"=>"rds", "type"=>"mysql"}, "memcached"=>{"host"=>nil, "port"=>11211}}, :app=>"apollo", :name=>nil}
provider Chef::Provider::Deploy::Timestamped
action [:deploy]
updated true
updated_by_last_action true
retries 0
retry_delay 2
deploy_to "/srv/www/apollo"
environment {"RAILS_ENV"=>nil, "RUBYOPT"=>"", "RACK_ENV"=>nil, "HOME"=>"/home/deploy", "NODE_ENV"=>"production", "S3BUCKET"=>"apollo-cdn", "PLATFORM_APPLICATION_ARN"=>"arn:aws:sns:us-east-1:007683507359:app/APNS/Apollo_Prod"}
repository_cache "cached-copy"
purge_before_symlink ["log", "tmp/pids", "public/system"]
create_dirs_before_symlink ["tmp", "public", "config"]
symlink_before_migrate {"config/opsworks.js"=>"opsworks.js"}
symlinks {"system"=>"public/system", "pids"=>"tmp/pids", "log"=>"log"}
revision "HEAD"
remote "origin"
enable_submodules true
scm_provider Chef::Provider::Git
keep_releases 5
enable_checkout true
checkout_branch "deploy"
cookbook_name "deploy"
recipe_name "nodejs"
repo "git@github.com:thomasbaldwin/apollo.git"
user "deploy"
group "apache"
migration_command "if [ -f Gemfile ]; then echo 'OpsWorks: Gemfile found - running migration with bundle exec' && /usr/local/bin/bundle exec rake db:migrate; else echo 'OpsWorks: no Gemfile - running plain migrations' && rake db:migrate; fi"
before_migrate #<Proc:0x0055742c848ac8@/var/lib/aws/opsworks/cache.stage2/cookbooks/deploy/definitions/opsworks_deploy.rb:100>
shared_path "/srv/www/apollo/shared"
destination "/srv/www/apollo/shared/cached-copy"
current_path "/srv/www/apollo/current"
end
[2016-08-12T15:13:50+00:00] INFO: Running queued delayed notifications before re-raising exception
[2016-08-12T15:13:50+00:00] ERROR: Running exception handlers
[2016-08-12T15:13:50+00:00] ERROR: Exception handlers complete
[2016-08-12T15:13:50+00:00] FATAL: Stacktrace dumped to /var/lib/aws/opsworks/cache.stage2/chef-stacktrace.out
[2016-08-12T15:13:51+00:00] ERROR: deploy[/srv/www/apollo] (deploy::nodejs line 65) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of sudo su - deploy -c 'cd /srv/www/apollo/releases/20160812151229 && npm install --production' 2>&1 ----
STDOUT: npm WARN package.json Apollo@0.1.0 No README data
npm WARN deprecated graceful-fs@3.0.8: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
> Apollo@0.1.0 install /srv/www/apollo/releases/20160812151229
> gulp build
STDERR:
---- End output of sudo su - deploy -c 'cd /srv/www/apollo/releases/20160812151229 && npm install --production' 2>&1 ----
Ran sudo su - deploy -c 'cd /srv/www/apollo/releases/20160812151229 && npm install --production' 2>&1 returned 1
[2016-08-12T15:13:51+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
答案 0 :(得分:0)
这很可能意味着gulp-cli没有全局安装。您可能希望查看poise-javascript
和application_javascript
食谱,因为他们有帮助,以使这个更加简单。