Comments (28)
It's incredible that this still isn't fixed, almost a year later. I've confirmed that this is STILL a problem.
from opsworks-cookbooks.
One thing I would change to @zacstewart's answer is to fix a minor typo from postrgesql
to postgresql
{"deploy":{"app_short_name":{"database":{"adapter":"postgresql","type":"postgresql"}}}}
from opsworks-cookbooks.
We also addressed this internally and a fix will be rolled out very soon.
As you mentioned, the workaround is to either 1) override the deploy["database"]["adapter"] value via custom JSON or in an attribute file or 2) to override the database.yml template.
We will update this issue as soon as the fix is deployed.
from opsworks-cookbooks.
Sigh. This broke our production app (Rails + Postgres on RDS) without warning. I wound up writing a bunch of deployment shell scripts and moving off Opsworks to Autoscalinggroups + cloud init.
from opsworks-cookbooks.
@sudhirj I'm interested in how this broke you. We only send an additional parameter 'type' that wasn't there before.
from opsworks-cookbooks.
A day before the announcement was made, our deploys (with migrations) began to fail. On looking at the logs, we realized that the rake db:migrate
step was failing. This was odd because the app was working fine on production with no issues.
I tried turning the migrations off and deploying. Big mistake. Now the deploy went through fine (And opsworks gave me all green checks) but the app couldn't connect to the database. To top it all off, adding an SSH key to an instance didn't seem to work either.
After much stopping and starting and experimenting with different instances and types and double checking settings (no changes, deploys always succeeded but results in an app that couldn't connect), I gave up and moved off OpsWorks.
That was about 8 hours or downtime, and me sitting up till 3AM trying to get prod back up. Decided I'd rather stick to shell scripts.
from opsworks-cookbooks.
I'm not sure if it was the type parameter or the new IAM role requirement, but something broke connectivity between the app server layer and RDS/Postgres with no warning. No security groups were changed.
from opsworks-cookbooks.
Same problem as pull request #166
from opsworks-cookbooks.
To be explicit with the workaround. I've had to add this JSON to my deployment:
{"deploy":{"api":{"database":{"adapter":"postgresql","type":"postrgesql"}}}}
where api
is the name of my application in OpsWorks.
from opsworks-cookbooks.
or something like this:
{
"deploy": {
"myappname": {
"database": {
"adapter": "postgresql",
"encoding": "unicode",
"host": "myappname.nil.us-east-1.rds.amazonaws.com",
"port": "5432",
"database": "mydatabase",
"pool": "5",
"username": "secretusername",
"password": "secretpass"
}
}
}
}
from opsworks-cookbooks.
So, I've added a clause like the above to my deployment...and it still seems to be falling back to MySQL. Any other ideas? :-)
from opsworks-cookbooks.
So, I've added a clause like the above to my deployment...and it still seems to be falling back to MySQL. Any other ideas? :-)
up ?
from opsworks-cookbooks.
It never did work. I gave up. OpsWorks was an experiment for me. It failed for now. I'll try again when Amazon stops dragging its heels and supports PostgreSQL properly.
from opsworks-cookbooks.
Seems like this is still an issue. The work around works, but make sure you use the app's shortname, and not the name:
{"deploy":{"app_short_name":{"database":{"adapter":"postgresql","type":"postgresql"}}}}
from opsworks-cookbooks.
@johntxi +1
from opsworks-cookbooks.
I just ran into this problem. Like sudhirj said my rake db:migrate keeps failing as well and soon as I turned it off, OpsWorks gave me all green checks. How is this not fixed yet? And is there any other way to migrate my database once it's deployed?
from opsworks-cookbooks.
I have come to the conclusion that, for whatever reason, the OpsWorks team just doesn't care about PostgreSQL support. It's sad, and it pretty much guarantees I can't use that service to simplify things, but such is life.
from opsworks-cookbooks.
Its surprising the PR #166 has not been merged yet. @awsrequena you guys can change the case switch statements later, at least fix this issue fix for the existing users.
from opsworks-cookbooks.
Still nothing?
from opsworks-cookbooks.
I really don't understand why you have to mess with the database.yml in the first place.
from opsworks-cookbooks.
What's the status on this??
from opsworks-cookbooks.
Custom json works just fine. Nothing is broken. See baruchlubinsky's answer advice. Just change the short name to your app sorry name.
from opsworks-cookbooks.
2015 and we are still looking Googling on how to use Postgres with Opsworks.
from opsworks-cookbooks.
Nope. It works without a problem. See @zacstewart's post above. It's exactly how I do it in 5 different stacks.
from opsworks-cookbooks.
@johncblandii Yes it works after you search google and come to this issue.
Anyway there are a bunch of issues including no out of the box support for asset precompiles. It is ok if one spends a few hours searching and solving the problem on your own of course.
from opsworks-cookbooks.
The docs tell you the same thing as this issue.
Create deploy/before_symlink.rb
and put this in there: run "cd #{release_path} && RAILS_ENV=production bundle exec rake assets:precompile"
.
AWS is just normal Chef stuff. It has a larger learning curve if you haven't used it before (say with Engine Yard or similar) but the AWS docs and forums have these details in them.
With that said, I 100% agree some things should be built in. If the RDS database is Postgres, use the PG adapter. Those sort of things just make sense to get built into their system.
from opsworks-cookbooks.
Here're the custom db parts in the AWS docs.
Here're the deployment hooks in the AWS docs.
from opsworks-cookbooks.
closing as this is a very old issue
from opsworks-cookbooks.
Related Issues (20)
- Amazon Linux 2016.09 and opsworks_nodejs HOT 1
- Unicorn master process not receiving QUIT HOT 3
- Ruby 2.4.0 HOT 30
- Node.js >=6.x cookbook setup HOT 1
- Can't download RPM package for nodejs on Amazon Linux 2016.09 HOT 1
- Berkshelf Pre-Built Packages Not Available (3.1.5) HOT 3
- Chef infrastructure issue. HOT 1
- [2017-08-11T13:48:48+00:00] FATAL: Stacktrace dumped to /var/lib/aws/opsworks/cache.stage2/chef-stacktrace.out HOT 1
- Wrong log format for ganglia
- Unable to download opsworks-agent-ruby on Ubuntu 16.04
- Ruby 2.5.0 HOT 8
- Getting Opsworks to use specific Ruby 2.4 version HOT 1
- Ruby 2.6.0 HOT 2
- Problem with S3 and region HOT 2
- ERROR: execute[apt-get update] (aws_opsworks_ecs::setup_ubuntu line 10) had an error: Mixlib::ShellOut::ShellCommandFailed
- Add Ruby 2.7 version
- --no-rdoc is not compatible with RubyGems 3+
- Please provide ruby 2.7 support
- Ruby 3.0 HOT 1
- bundle install error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opsworks-cookbooks.