Connecting to Postgres database hosted by cloud provider - anything special we need to know?

Hi,
First-time poster here hoping I can get some help.
Good news is that I can get ODK Aggregate running. We have it on an EC2 AWS
Linux instance and pointing to an EC2 RDS Postgresql database. All great.
However, when set up a new EC2 AWS Linux instance and point it at a
Postgres DB hosted on a cloud hosting site (where we have a lot of other
postgis stuff waiting for data) I get the 404 error and the following
entries in catalina.out:

Aug 15, 2016 5:14:51 PM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Exception sending context initialized event to listener instance of
class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'hierarchicalRoleRelationships' defined in ServletContext
resource [/WEB-INF/applicationContext-security.xml]: Invocation of init
method failed; nested exception is
org.opendatakit.common.persistence.exception.ODKDatastoreException:
org.springframework.transaction.CannotCreateTransactionException: Could not
open JDBC Connection for transaction; nested exception is
org.postgresql.util.PSQLException: The connection attempt failed.

I have checked schema names, db users and passwords and all seem OK. I can
connect OK to the same DB using e.g. PGadmin.

Any assistance given would be gratefully received!

Myles

You perhaps need to open some ports in a firewall, or set up static ips
(elastic IP addresses).

Try using the postgres command line tool on your AWS webserver to contact
the database. First as root (super-user) (to work through any firewall or
static IP issues), then as whatever username and password you configured
for ODK Aggregate. For the later, be sure you have created the username in
the database (see the generated .sql script).

··· On Wed, Aug 17, 2016 at 1:22 AM, Myles McDonagh wrote:

Hi,
First-time poster here hoping I can get some help.
Good news is that I can get ODK Aggregate running. We have it on an EC2
AWS Linux instance and pointing to an EC2 RDS Postgresql database. All
great.
However, when set up a new EC2 AWS Linux instance and point it at a
Postgres DB hosted on a cloud hosting site (where we have a lot of other
postgis stuff waiting for data) I get the 404 error and the following
entries in catalina.out:

Aug 15, 2016 5:14:51 PM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Exception sending context initialized event to listener instance
of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'hierarchicalRoleRelationships' defined in ServletContext
resource [/WEB-INF/applicationContext-security.xml]: Invocation of init
method failed; nested exception is org.opendatakit.common.
persistence.exception.ODKDatastoreException: org.springframework.
transaction.CannotCreateTransactionException: Could not open JDBC
Connection for transaction; nested exception is org.postgresql.util.PSQLException:
The connection attempt failed.

I have checked schema names, db users and passwords and all seem OK. I can
connect OK to the same DB using e.g. PGadmin.

Any assistance given would be gratefully received!

Myles

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Mitch, I've been helping Myles with this. I'm able to access the database from the command line which makes me think the issue is with how the ODK is connecting. We do not have the ability to see or change security settings with the database. The provider does require the connection to use SSL.

--Aaron

··· On Wednesday, August 17, 2016 at 12:20:44 PM UTC-5, Mitch wrote: > You perhaps need to open some ports in a firewall, or set up static ips (elastic IP addresses). > > > Try using the postgres command line tool on your AWS webserver to contact the database. First as root (super-user) (to work through any firewall or static IP issues), then as whatever username and password you configured for ODK Aggregate. For the later, be sure you have created the username in the database (see the generated .sql script). > > > > > > > On Wed, Aug 17, 2016 at 1:22 AM, Myles McDonagh wrote: > > Hi, > First-time poster here hoping I can get some help. > Good news is that I can get ODK Aggregate running. We have it on an EC2 AWS Linux instance and pointing to an EC2 RDS Postgresql database. All great. > However, when set up a new EC2 AWS Linux instance and point it at a Postgres DB hosted on a cloud hosting site (where we have a lot of other postgis stuff waiting for data) I get the 404 error and the following entries in catalina.out: > > > > Aug 15, 2016 5:14:51 PM org.apache.catalina.core.StandardContext listenerStart > SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener > org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hierarchicalRoleRelationships' defined in ServletContext resource [/WEB-INF/applicationContext-security.xml]: Invocation of init method failed; nested exception is org.opendatakit.common.persistence.exception.ODKDatastoreException: org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.postgresql.util.PSQLException: The connection attempt failed. > > > I have checked schema names, db users and passwords and all seem OK. I can connect OK to the same DB using e.g. PGadmin. > > > Any assistance given would be gratefully received! > > > Myles > > > > > > > -- > > You received this message because you are subscribed to the Google Groups "ODK Developers" group. > > To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit-developers+unsubscribe@googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. > > > > > > -- > > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com

You likely need to hand-edit the jdbc.properties file.

See

··· On Sat, Sep 10, 2016 at 2:22 PM, wrote:

Mitch, I've been helping Myles with this. I'm able to access the
database from the command line which makes me think the issue is with how
the ODK is connecting. We do not have the ability to see or change
security settings with the database. The provider does require the
connection to use SSL.

--Aaron

On Wednesday, August 17, 2016 at 12:20:44 PM UTC-5, Mitch wrote:

You perhaps need to open some ports in a firewall, or set up static ips
(elastic IP addresses).

Try using the postgres command line tool on your AWS webserver to
contact the database. First as root (super-user) (to work through any
firewall or static IP issues), then as whatever username and password you
configured for ODK Aggregate. For the later, be sure you have created the
username in the database (see the generated .sql script).

On Wed, Aug 17, 2016 at 1:22 AM, Myles McDonagh myle...@gmail.com wrote:

Hi,
First-time poster here hoping I can get some help.
Good news is that I can get ODK Aggregate running. We have it on an EC2
AWS Linux instance and pointing to an EC2 RDS Postgresql database. All
great.
However, when set up a new EC2 AWS Linux instance and point it at a
Postgres DB hosted on a cloud hosting site (where we have a lot of other
postgis stuff waiting for data) I get the 404 error and the following
entries in catalina.out:

Aug 15, 2016 5:14:51 PM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Exception sending context initialized event to listener instance
of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'hierarchicalRoleRelationships' defined in ServletContext
resource [/WEB-INF/applicationContext-security.xml]: Invocation of init
method failed; nested exception is org.opendatakit.common.
persistence.exception.ODKDatastoreException: org.springframework.
transaction.CannotCreateTransactionException: Could not open JDBC
Connection for transaction; nested exception is org.postgresql.util.PSQLException:
The connection attempt failed.

I have checked schema names, db users and passwords and all seem OK. I
can connect OK to the same DB using e.g. PGadmin.

Any assistance given would be gratefully received!

Myles

--

You received this message because you are subscribed to the Google
Groups "ODK Developers" group.

To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.com

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Another thing to try is to setup an external non-SSL DB and see if
that works. I bet it does and I bet if you add "&ssl=true" to the
connection string in the JDBC properties of your WAR, it'll work.

Yaw

··· -- Need ODK consultants? Nafundi provides form design, server setup, in-field training, and software development for ODK. Go to https://nafundi.com to get started.

On Mon, Sep 12, 2016 at 8:02 PM, Mitch Sundt mitchellsundt@gmail.com wrote:

You likely need to hand-edit the jdbc.properties file.

See
https://github.com/opendatakit/opendatakit/wiki/Aggregate-Deployment-Configuration

On Sat, Sep 10, 2016 at 2:22 PM, ajsmith10381@gmail.com wrote:

Mitch, I've been helping Myles with this. I'm able to access the
database from the command line which makes me think the issue is with how
the ODK is connecting. We do not have the ability to see or change security
settings with the database. The provider does require the connection to
use SSL.

--Aaron

On Wednesday, August 17, 2016 at 12:20:44 PM UTC-5, Mitch wrote:

You perhaps need to open some ports in a firewall, or set up static ips
(elastic IP addresses).

Try using the postgres command line tool on your AWS webserver to
contact the database. First as root (super-user) (to work through any
firewall or static IP issues), then as whatever username and password you
configured for ODK Aggregate. For the later, be sure you have created the
username in the database (see the generated .sql script).

On Wed, Aug 17, 2016 at 1:22 AM, Myles McDonagh myle...@gmail.com wrote:

Hi,
First-time poster here hoping I can get some help.
Good news is that I can get ODK Aggregate running. We have it on an EC2
AWS Linux instance and pointing to an EC2 RDS Postgresql database. All
great.
However, when set up a new EC2 AWS Linux instance and point it at a
Postgres DB hosted on a cloud hosting site (where we have a lot of other
postgis stuff waiting for data) I get the 404 error and the following
entries in catalina.out:

Aug 15, 2016 5:14:51 PM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Exception sending context initialized event to listener instance
of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'hierarchicalRoleRelationships' defined in ServletContext
resource [/WEB-INF/applicationContext-security.xml]: Invocation of init
method failed; nested exception is
org.opendatakit.common.persistence.exception.ODKDatastoreException:
org.springframework.transaction.CannotCreateTransactionException: Could not
open JDBC Connection for transaction; nested exception is
org.postgresql.util.PSQLException: The connection attempt failed.

I have checked schema names, db users and passwords and all seem OK. I
can connect OK to the same DB using e.g. PGadmin.

Any assistance given would be gratefully received!

Myles

--

You received this message because you are subscribed to the Google
Groups "ODK Developers" group.

To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.com

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.