{"action":"created","issue":{"url":"https://api.github.com/repos/cloudfoundry-community/bosh-bootstrap/issues/298","labels_url":"https://api.github.com/repos/cloudfoundry-community/bosh-bootstrap/issues/298/labels{/name}","comments_url":"https://api.github.com/repos/cloudfoundry-community/bosh-bootstrap/issues/298/comments","events_url":"https://api.github.com/repos/cloudfoundry-community/bosh-bootstrap/issues/298/events","html_url":"https://github.com/cloudfoundry-community/bosh-bootstrap/issues/298","id":53927172,"number":298,"title":"log writing failed. can't be called from trap context","user":{"login":"mkb","id":28497,"avatar_url":"https://avatars.githubusercontent.com/u/28497?v=3","gravatar_id":"","url":"https://api.github.com/users/mkb","html_url":"https://github.com/mkb","followers_url":"https://api.github.com/users/mkb/followers","following_url":"https://api.github.com/users/mkb/following{/other_user}","gists_url":"https://api.github.com/users/mkb/gists{/gist_id}","starred_url":"https://api.github.com/users/mkb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkb/subscriptions","organizations_url":"https://api.github.com/users/mkb/orgs","repos_url":"https://api.github.com/users/mkb/repos","events_url":"https://api.github.com/users/mkb/events{/privacy}","received_events_url":"https://api.github.com/users/mkb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-09T23:11:58Z","updated_at":"2015-04-01T17:43:54Z","closed_at":null,"body":"I frequently see the message `log writing failed. can't be called from trap context` when invoking bosh-bootstrap. Typically I notice it when something fails but I have also seen the message when my command executes successfully.\r\n\r\nOne example:\r\n\r\n \r\n          Started deploy micro bosh\r\n          Started deploy micro bosh > Unpacking stemcell. Done (00:00:02)\r\n          Started deploy micro bosh > Uploading stemcelllog writing failed. can't be called from trap context\r\n        create stemcell failed: Timed out reading instance metadata, please make sure CPI is running on EC2 instance:\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_aws_cpi-1.2798.0/lib/cloud/aws/helpers.rb:14:in `cloud_error'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_aws_cpi-1.2798.0/lib/cloud/aws/cloud.rb:65:in `rescue in current_vm_id'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_aws_cpi-1.2798.0/lib/cloud/aws/cloud.rb:46:in `current_vm_id'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_aws_cpi-1.2798.0/lib/cloud/aws/cloud.rb:422:in `block in create_stemcell'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_common-1.2798.0/lib/common/thread_formatter.rb:49:in `with_thread_name'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_aws_cpi-1.2798.0/lib/cloud/aws/cloud.rb:410:in `create_stemcell'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_cli_plugin_micro-1.2798.0/lib/bosh/deployer/instance_manager.rb:228:in `block (2 levels) in create_stemcell'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_cli_plugin_micro-1.2798.0/lib/bosh/deployer/instance_manager.rb:85:in `step'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_cli_plugin_micro-1.2798.0/lib/bosh/deployer/instance_manager.rb:227:in `block in create_stemcell'\r\n        /Users/mkb/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tmpdir.rb:88:in `mktmpdir'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_cli_plugin_micro-1.2798.0/lib/bosh/deployer/instance_manager.rb:213:in `create_stemcell'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_cli_plugin_micro-1.2798.0/lib/bosh/deployer/instance_manager.rb:118:in `create'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_cli_plugin_micro-1.2798.0/lib/bosh/deployer/instance_manager.rb:98:in `block in create_deployment'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_cli_plugin_micro-1.2798.0/lib/bosh/deployer/instance_manager.rb:92:in `with_lifecycle'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_cli_plugin_micro-1.2798.0/lib/bosh/deployer/instance_manager.rb:98:in `create_deployment'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_cli_plugin_micro-1.2798.0/lib/bosh/cli/commands/micro.rb:179:in `perform'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_cli-1.2798.0/lib/cli/command_handler.rb:57:in `run'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_cli-1.2798.0/lib/cli/runner.rb:56:in `run'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_cli-1.2798.0/lib/cli/runner.rb:16:in `run'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh_cli-1.2798.0/bin/bosh:7:in `<top (required)>'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/bin/bosh:23:in `load'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/bin/bosh:23:in `<main>'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/bin/ruby_executable_hooks:15:in `eval'\r\n        /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/bin/ruby_executable_hooks:15:in `<main>'\r\n        /Users/mkb/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/rake/file_utils.rb:54:in `block in create_shell_runner': Command failed with status (1): [bosh -n micro deploy --update-if-exists /U...] (RuntimeError)\r\n                from /Users/mkb/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/rake/file_utils.rb:45:in `call'\r\n                from /Users/mkb/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/rake/file_utils.rb:45:in `sh'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-bootstrap-0.15.0/lib/bosh-bootstrap/cli/helpers/bundle.rb:18:in `block in run'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.6/lib/bundler.rb:236:in `block in with_clean_env'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.6/lib/bundler.rb:223:in `with_original_env'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.6/lib/bundler.rb:229:in `with_clean_env'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-bootstrap-0.15.0/lib/bosh-bootstrap/cli/helpers/bundle.rb:16:in `run'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-bootstrap-0.15.0/lib/bosh-bootstrap/microbosh.rb:54:in `block in deploy_or_update'\r\n                from /Users/mkb/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/fileutils.rb:125:in `chdir'\r\n                from /Users/mkb/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/fileutils.rb:125:in `cd'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-bootstrap-0.15.0/lib/bosh-bootstrap/microbosh.rb:52:in `deploy_or_update'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-bootstrap-0.15.0/lib/bosh-bootstrap/microbosh.rb:42:in `block in deploy'\r\n                from /Users/mkb/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/fileutils.rb:125:in `chdir'\r\n                from /Users/mkb/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/fileutils.rb:125:in `cd'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-bootstrap-0.15.0/lib/bosh-bootstrap/microbosh.rb:40:in `deploy'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-bootstrap-0.15.0/lib/bosh-bootstrap/cli/commands/deploy.rb:77:in `perform_microbosh_deploy'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-bootstrap-0.15.0/lib/bosh-bootstrap/cli/commands/deploy.rb:24:in `perform'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-bootstrap-0.15.0/lib/bosh-bootstrap/thor_cli.rb:11:in `deploy'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-bootstrap-0.15.0/bin/bosh-bootstrap:13:in `<top (required)>'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/bin/bosh-bootstrap:23:in `load'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/bin/bosh-bootstrap:23:in `<main>'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/bin/ruby_executable_hooks:15:in `eval'\r\n                from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/bin/ruby_executable_hooks:15:in `<main>'\r\n\r\n        mkb@beemo"},"comment":{"url":"https://api.github.com/repos/cloudfoundry-community/bosh-bootstrap/issues/comments/88571453","html_url":"https://github.com/cloudfoundry-community/bosh-bootstrap/issues/298#issuecomment-88571453","issue_url":"https://api.github.com/repos/cloudfoundry-community/bosh-bootstrap/issues/298","id":88571453,"user":{"login":"mdcarlson","id":253412,"avatar_url":"https://avatars.githubusercontent.com/u/253412?v=3","gravatar_id":"","url":"https://api.github.com/users/mdcarlson","html_url":"https://github.com/mdcarlson","followers_url":"https://api.github.com/users/mdcarlson/followers","following_url":"https://api.github.com/users/mdcarlson/following{/other_user}","gists_url":"https://api.github.com/users/mdcarlson/gists{/gist_id}","starred_url":"https://api.github.com/users/mdcarlson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdcarlson/subscriptions","organizations_url":"https://api.github.com/users/mdcarlson/orgs","repos_url":"https://api.github.com/users/mdcarlson/repos","events_url":"https://api.github.com/users/mdcarlson/events{/privacy}","received_events_url":"https://api.github.com/users/mdcarlson/received_events","type":"User","site_admin":false},"created_at":"2015-04-01T17:43:54Z","updated_at":"2015-04-01T17:43:54Z","body":"Ah, good to know.   I do see that the real error is an \"Address in use\" issue.  I'll chase that separately."}}