{"action":"created","issue":{"url":"https://api.github.com/repos/ajgon/opsworks_ruby/issues/180","repository_url":"https://api.github.com/repos/ajgon/opsworks_ruby","labels_url":"https://api.github.com/repos/ajgon/opsworks_ruby/issues/180/labels{/name}","comments_url":"https://api.github.com/repos/ajgon/opsworks_ruby/issues/180/comments","events_url":"https://api.github.com/repos/ajgon/opsworks_ruby/issues/180/events","html_url":"https://github.com/ajgon/opsworks_ruby/issues/180","id":346295494,"node_id":"MDU6SXNzdWUzNDYyOTU0OTQ=","number":180,"title":"database.yml creation with no RDS instance attached","user":{"login":"zeroedin","id":13666,"node_id":"MDQ6VXNlcjEzNjY2","avatar_url":"https://avatars1.githubusercontent.com/u/13666?v=4","gravatar_id":"","url":"https://api.github.com/users/zeroedin","html_url":"https://github.com/zeroedin","followers_url":"https://api.github.com/users/zeroedin/followers","following_url":"https://api.github.com/users/zeroedin/following{/other_user}","gists_url":"https://api.github.com/users/zeroedin/gists{/gist_id}","starred_url":"https://api.github.com/users/zeroedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeroedin/subscriptions","organizations_url":"https://api.github.com/users/zeroedin/orgs","repos_url":"https://api.github.com/users/zeroedin/repos","events_url":"https://api.github.com/users/zeroedin/events{/privacy}","received_events_url":"https://api.github.com/users/zeroedin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-31T17:55:00Z","updated_at":"2018-07-31T19:13:15Z","closed_at":"2018-07-31T19:13:15Z","author_association":"NONE","body":"### Expected Behavior\r\nA `database.yml` gets created in `config/database.yml`no matter if a RDS instance is attached to stack, provided that `app['shortname']['framework'] = rails` is set as explained in https://opsworks-ruby.readthedocs.io/en/latest/attributes.html#database\r\n\r\n### Actual Behavior\r\nNo `database.yml` gets created when an RDS instance is not attached, setup fails on app deploy.  \r\n\r\n\r\nIs the documentation for this action correct?  Or do I have something misconfigured?\r\n\r\n### Custom JSON\r\n```json\r\n\"xxx\": {\r\n  \"global\": {\r\n    \"rollback_on_error\": false,\r\n    \"environment\": \"staging\",\r\n    \"symlinks\": {\r\n      \"system\": \"public/system\",\r\n      \"pids\": \"tmp/pids\",\r\n      \"log\": \"log\",\r\n      \"config/secrets.yml\": \"config/secrets.yml\",\r\n      }\r\n  },\r\n  \"database\": {\r\n    \"adapter\": \"postgresql\",\r\n    \"username\": \"xxx\",\r\n    \"password\": \"xxx\",\r\n    \"host\": \"xxx\",\r\n    \"database\": \"xxx\"\r\n    },\r\n  \"framework\": {\r\n    \"adapter\": \"rails\"\r\n  },\r\n  \"appserver\": {\r\n    \"adapter\": \"passenger\"\r\n  },\r\n  \"webserver\": {\r\n    \"adapter\": \"apache2\"\r\n    }\r\n}\r\n             \r\n```\r\n\r\n### Chef log including error\r\n```\r\n================================================================================\r\nError executing action `deploy` on resource 'deploy[xxx]'\r\n================================================================================\r\n \r\nMixlib::ShellOut::ShellCommandFailed\r\n------------------------------------\r\nExpected process to exit with [0], but received '1'\r\n---- Begin output of case $(/usr/local/bin/bundle exec rake db:version 2>&1) in *\"ActiveRecord::NoDatabaseError\"*) /usr/local/bin/bundle exec rake db:setup;; *) /usr/local/bin/bundle exec rake db:migrate;; esac ----\r\nSTDOUT: `/root` is not writable.\r\nBundler will use `/tmp/bundler/home/root' as your home directory temporarily.\r\nSTDERR: rake aborted!\r\nCannot load `Rails.application.database_configuration`:\r\nCould not load database configuration. No such file - [\"config/database.yml\"]\r\n/srv/www/xxx/shared/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/application/configuration.rb:110:in `database_configuration'\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ajgon/opsworks_ruby/issues/comments/409335335","html_url":"https://github.com/ajgon/opsworks_ruby/issues/180#issuecomment-409335335","issue_url":"https://api.github.com/repos/ajgon/opsworks_ruby/issues/180","id":409335335,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTMzNTMzNQ==","user":{"login":"zeroedin","id":13666,"node_id":"MDQ6VXNlcjEzNjY2","avatar_url":"https://avatars1.githubusercontent.com/u/13666?v=4","gravatar_id":"","url":"https://api.github.com/users/zeroedin","html_url":"https://github.com/zeroedin","followers_url":"https://api.github.com/users/zeroedin/followers","following_url":"https://api.github.com/users/zeroedin/following{/other_user}","gists_url":"https://api.github.com/users/zeroedin/gists{/gist_id}","starred_url":"https://api.github.com/users/zeroedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeroedin/subscriptions","organizations_url":"https://api.github.com/users/zeroedin/orgs","repos_url":"https://api.github.com/users/zeroedin/repos","events_url":"https://api.github.com/users/zeroedin/events{/privacy}","received_events_url":"https://api.github.com/users/zeroedin/received_events","type":"User","site_admin":false},"created_at":"2018-07-31T19:13:15Z","updated_at":"2018-07-31T19:13:15Z","author_association":"NONE","body":"This was because I did not deregister the RDS instance from the stack after deleting it, which caused the RDS layer to still exist.  \r\n\r\n`options[:rds].blank?` in `applicable_for_configuration?` would still return false.\r\n\r\nClosing this issue so anyone that might also run into this can find the solution."}}
{"actor":{"display_login":"zeroedin"}}