xTuple.com xTupleU Blog & News Customer Support

How to connect xtuple database to heroku app

Hi,

I am trying to create a heroku app with rails using my xtuple postgresql database. It is working locally. I am able to do sql queries and have it return as json. However, when I push it to heroku, it stops functioning. I included the database credentials(host, port, database, user, password) in my database.yml. I have checked the server configuration(pg_hba.conf and postgresql.conf) and it appears that all ip have already been grant access(host all all 0.0.0.0/0 md5 and listen_addresses ‘*’, respectively). I have also add in the variable DATABASE_URL=postgres://Username:Password@IPAddress:Port/DatabaseName to heroku. If you can let me know what I should do to make it work, that would be great. Please let me know if any questions.

Thanks!
Zhu

I have previously tried Heroku and I believe it suffered from the same issue we have with other hosted postgresql services. We need to be able to have control of the postgres user.

Dave Anderson mentioned this in another post recently. Evidently we would need quite a few changes to the core in order to make things function without the postgres user.

xTuple folks, please correct me if I’m off base.

Scott

Hi Scott,
If you don’t mind, can you give me the link to Dave Anderson’s post regarding this issue. Also, what do you mean by the core? and what would those few changes be? Sorry if I am asking silly questions. If you can let me know, that would be greatly appreciated.

Just a quick note - I get the following error when I try to run ‘heroku run rake db:migrate’ on the command line.

PG::ConnectionBad: could not connect to server: Connection timed out
Is the server running on host “XX.XX.X.X”(in ip address format) and accepting
TCP/IP connections on port XXXX?

Checked on command line locally, and works. So can’t be a typo and Im at a lost now.

Those connection issues are not related to the issues I’m talking about with SUPERUSER. If you cannot connect, it would once again point back to something with your .yml and postgresql.conf/pg_hba.conf setups.

The relevant information from Dave was as follows:

Amazon RDS unfortunately does not work at present as the admin user requires SUPERUSER permissions which RDS does not allow. There are a number of extensions and services required to run a modern xTuple system that currently wont work on a basic PostgreSQL database server/service.

I haven’t tried using RDS/Aurora/Heroku/etc in the past year or so.