wsharba / opendatakit

Automatically exported from code.google.com/p/opendatakit
0 stars 1 forks source link

BadSqlGrammarException #943

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi there.

I deployed ODK with PostgreSQL 9.0 on RHEL 6.4 to use for a project in South 
Africa.

We developed two forms and data was being uploaded with no problem until 
yesterday when the data gatherers started complaining that they couldn't 
connect to the Aggregate Server.

I logged in and found that Tomcat was not running and restarted it. Again it 
was stable until I logged in to Aggregate after which it crashed. I did a test 
and started Aggregate without login in to the web interface and it was stable 
for 30 minutes till Ilogged in after which it crashed.

The only error I could find in /var/log/tomcat6/catalina.out is this:

    at java.lang.Thread.run(Thread.java:679)
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near ")"
  Position: 248
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:273)
    at com.jolbox.bonecp.PreparedStatementHandle.executeQuery(PreparedStatementHandle.java:172)
    at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:644)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587)
    ... 67 more
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad 
SQL grammar [SELECT "_URI", "_CREATOR_URI_USER", "_CREATION_DATE", 
"_LAST_UPDATE_URI_USER", "_LAST_UPDATE_DATE", "TABLE_ID", "TABLE_KEY", 
"DB_TABLE_NAME", "TYPE", "TABLE_ID_ACCESS_CONTROLS" FROM 
"edm_prod"."__ODKTABLES__TABLE_DEFINITIONS" WHERE "TABLE_ID" IN ();]; nested 
exception is org.postgresql.util.PSQLException: ERROR: syntax error at or near 
")"
  Position: 248

I am a sysadmin and don't know any Java at all but it seems to me like ODK 
generated a malformed SQL statement which executes when ODK Aggregate is viewed.

I have no idea where to even start looking to correct this and any help will be 
much appreciated.

Thanks a million

Lawrence

Original issue reported on code.google.com by qhol...@gmail.com on 26 Nov 2013 at 6:20

GoogleCodeExporter commented 9 years ago
Closing, as I believe this was addressed on the opendatakit@ site.

The underlying issue was fixed in one of the more recent ODK Aggregate 
releases. Upgrading to 1.4.2 should fix the issue.

Original comment by mitchellsundt@gmail.com on 13 Mar 2014 at 8:15