Error building ODK Aggregate with tomcat + postgres + cargo container

Hello,

I've checked out a fresh copy of ODK aggregate and gone through the
instructions at CONFIGURE.txt. I have a project requirement to use
Postgres. So, in order to cut down on build time and start with just
getting Postgres working, the first thing I did before trying to do a mvn
clean and mvn install from the command line was go into the root pom.xml
and comment out the database-specific modules that were not postgres
modules. I don't think I have any other major differences from the regular
ODK build at this time.

When I run mvn install, I get to this line and it fails consistently:

[INFO] --- cargo-maven2-plugin:1.6.0:start (start-container) @
aggregate-postgres ---
[ERROR] Starting container
[org.codehaus.cargo.container.tomcat.Tomcat8xInstalledLocalContainer@d0156e4]
failed, now stopping container

When I look at the log in
aggregate/aggregate-postgres/target/cargo-tree/tomcat8x there is a big long
exception with the final "caused by" like the following:

Caused by: java.sql.SQLException: validationQuery didn't return a row
at
org.apache.commons.dbcp2.PoolableConnection.validate(PoolableConnection.java:303)
at
org.apache.commons.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:357)
at
org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2307)
at
org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2290)
... 37 more

I found the validationQuery in postgres/ and postgres-unit/odk-settings.xml
to be "select schema_name from information_schema.schemata limit 1". I
logged into pgadmin III and ran it against the odk_unit database and the
query runs correctly, returning 1 row. I also double checked that the
username, password were set to odk_unit in the database and the
jdbc.properties files in the odk-postgres*settings projects.

Is there anything additional I need to know about the cargo plugin and how
it's configured? I haven't used it before. Is it pulling the connection
information from those same jdbc.properties files? I'm in the slack
channels, at least #general during PST-CSTish business hours so if you need
clarification or could fill me in on the cargo setup, I'd appreciate it.

Thanks,

Caden

It turns out running the validationQuery in pgAdmin III was misleading.

Owner of the information_schema.schemata table is the postgres user, even
though the odk_unit database is correctly owned by the odk_unit user.

When I logged into pgadmin III I was logged in as postgres so I could run
the query with no problem. I tried logging into psql as odk_unit user, to
run it again and discovered the access problem.

Rather than giving a "data" user "metadata" access that belongs at the
admin level by granting odk_unit access to the metadata table, I changed
the validationQuery to "SELECT 1"

I'm now past the cargo error and on to the Selenium startup errors!

ยทยทยท On Tuesday, February 7, 2017 at 6:20:30 PM UTC-6, C. Howell wrote: > > > Hello, > > I've checked out a fresh copy of ODK aggregate and gone through the > instructions at CONFIGURE.txt. I have a project requirement to use > Postgres. So, in order to cut down on build time and start with just > getting Postgres working, the first thing I did before trying to do a mvn > clean and mvn install from the command line was go into the root pom.xml > and comment out the database-specific modules that were not postgres > modules. I don't think I have any other major differences from the regular > ODK build at this time. > > When I run mvn install, I get to this line and it fails consistently: > > [INFO] --- cargo-maven2-plugin:1.6.0:start (start-container) @ > aggregate-postgres --- > [ERROR] Starting container > [org.codehaus.cargo.container.tomcat.Tomcat8xInstalledLocalContainer@d0156e4] > failed, now stopping container > > When I look at the log in > aggregate/aggregate-postgres/target/cargo-tree/tomcat8x there is a big long > exception with the final "caused by" like the following: > > Caused by: java.sql.SQLException: validationQuery didn't return a row > at > org.apache.commons.dbcp2.PoolableConnection.validate(PoolableConnection.java:303) > at > org.apache.commons.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:357) > at > org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2307) > at > org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2290) > ... 37 more > > I found the validationQuery in postgres/ and > postgres-unit/odk-settings.xml to be "select schema_name from > information_schema.schemata limit 1". I logged into pgadmin III and ran it > against the odk_unit database and the query runs correctly, returning 1 > row. I also double checked that the username, password were set to > odk_unit in the database and the jdbc.properties files in the > odk-postgres*settings projects. > > Is there anything additional I need to know about the cargo plugin and how > it's configured? I haven't used it before. Is it pulling the connection > information from those same jdbc.properties files? I'm in the slack > channels, at least #general during PST-CSTish business hours so if you need > clarification or could fill me in on the cargo setup, I'd appreciate it. > > Thanks, > > Caden > >