Have you seen this error on the ODK Tables unit tests?

Hi ODK Developers,

I’ve done a bunch of Maven refactoring on a fresh copy of ODK we forked
about a week ago. I removed the support for MS SQL and Google App Engine.
The goal is to get the project so you can check it out, run mvn clean
install from the command line, and have a .war file for the Maven profile
you have selected-- MySQL or Postgres. I’m still quite a way off but you
can see the progress at https://github.com/benetech/aggregate. I’m trying
to move code into the standard convention Maven folders.

I’m running into an error on the ODK Tables unit tests. I ran into this a
few times before I started moving the code folders around, but I’m not sure
how I fixed it last time. I am wondering if any of you have seen it before
and if it is a common configuration error. If you have suggestions for
things to try, I’d appreciate it. The non-ODK Tables tests seem to run
fine, then this (it’s a huge error dump, to show all the "Caused by"s)

I’m just including the one error, but I am getting a large percentage of
ODK Tables unit test failures with the same root cause.

Thanks,

Caden

Feb 13, 2017 3:53:13 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 1663ba78-9eda-401d-970c-8d1eaa99e4dc by user aggregate.opendatakit.org:
web-service
Tests run: 12, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 0.359 sec
<<< FAILURE!
testCreateTableAlreadyExists(org.opendatakit.aggregate.odktables.
TableManagerTest) Time elapsed: 0.05 sec <<< ERROR!
java.lang.Exception: Unexpected exception, expected<org.opendatakit.
aggregate.odktables.exception.TableAlreadyExistsException> but was<org.
opendatakit.common.persistence.exception.ODKEntityNotFoundException>
at org.junit.internal.runners.statements.ExpectException.evaluate(
ExpectException.java:28)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.
java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:
27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner
.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner
.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.
java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.
java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(
ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(
ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: org.opendatakit.common.persistence.exception.
ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users
key: aggregate.opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.getEntity(
DatastoreImpl.java:768)
at org.opendatakit.common.security.spring.RegisteredUsersTable.getUserByUri
(RegisteredUsersTable.java:289)
at org.opendatakit.aggregate.odktables.relation.EntityCreator.
newTableDefinitionEntity(EntityCreator.java:172)
at org.opendatakit.aggregate.odktables.TableManager.createTable(
TableManager.java:458)
at org.opendatakit.aggregate.odktables.TableManagerTest.
testCreateTableAlreadyExists(TableManagerTest.java:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(
ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(
FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod
.java:17)
at org.junit.internal.runners.statements.ExpectException.evaluate(
ExpectException.java:19)
… 23 more
Caused by: org.opendatakit.common.persistence.exception.
ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users
key: aggregate.opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.getEntity(
DatastoreImpl.java:763)
… 36 more

testGetTable(org.opendatakit.aggregate.odktables.TableManagerTest) Time
elapsed: 0.051 sec <<< ERROR!
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key: aggregate.opendatakit.org
:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.getEntity(
DatastoreImpl.java:768)
at org.opendatakit.common.security.spring.RegisteredUsersTable.getUserByUri
(RegisteredUsersTable.java:289)
at org.opendatakit.aggregate.odktables.relation.EntityCreator.
newTableDefinitionEntity(EntityCreator.java:172)
at org.opendatakit.aggregate.odktables.TableManager.createTable(
TableManager.java:458)
at org.opendatakit.aggregate.odktables.TableManagerTest.testGetTable(
TableManagerTest.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(
ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(
FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod
.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.
java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:
27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner
.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner
.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.
java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.
java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(
ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(
ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: org.opendatakit.common.persistence.exception.
ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users
key: aggregate.opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.getEntity(
DatastoreImpl.java:763)
… 35 more

testCreateTable(org.opendatakit.aggregate.odktables.TableManagerTest) Time
elapsed: 0.057 sec <<< ERROR!
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key: aggregate.opendatakit.org
:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.getEntity(
DatastoreImpl.java:768)
at org.opendatakit.common.security.spring.RegisteredUsersTable.getUserByUri
(RegisteredUsersTable.java:289)
at org.opendatakit.aggregate.odktables.relation.EntityCreator.
newTableDefinitionEntity(EntityCreator.java:172)
at org.opendatakit.aggregate.odktables.TableManager.createTable(
TableManager.java:458)
at org.opendatakit.aggregate.odktables.TableManagerTest.testCreateTable(
TableManagerTest.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(
ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(
FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod
.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.
java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:
27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner
.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner
.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.
java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.
java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(
ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(
ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: org.opendatakit.common.persistence.exception.
ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users
key: aggregate.opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.getEntity(
DatastoreImpl.java:763)
… 35 more

My first thought is that you haven’t run the before and after scripts to
drop and create the database schema so it has cruft in it. If you are
combining the UI test (aggregate-postgres) and the postgres-unit-tests into
one project, note that we expect the database to be dropped and recreated
between those two sets of tests.

If you are using PostgreSQL, be sure you are running at least 9.4.
There are permissions issues with 9.3 and earlier that might cause problems.

When I just want to build one variant, I edit the top-level pom.xml to
comment out all the modules that I don’t want to build.

The tricky thing with the maven build is the handling of the GWT compile.
When this was first constructed, there was negligible support for multiple
build artifacts within maven. I believe this has now been fleshed out.

Ideally, the aggregate-src project should build both the GWT artifacts and
the jar.
Then the individual projects can reference those and avoid a recompile to
generate the GWT artifacts.

The unit tests for GAE require a custom context, which is why the UI and
unit tests were split out into separate maven projects (and the others just
followed that model to maintain structural parallelism).

··· On Mon, Feb 13, 2017 at 2:31 PM, C. Howell wrote:

Hi ODK Developers,

I’ve done a bunch of Maven refactoring on a fresh copy of ODK we forked
about a week ago. I removed the support for MS SQL and Google App Engine.
The goal is to get the project so you can check it out, run mvn clean
install from the command line, and have a .war file for the Maven profile
you have selected-- MySQL or Postgres. I’m still quite a way off but you
can see the progress at https://github.com/benetech/aggregate. I’m
trying to move code into the standard convention Maven folders.

I’m running into an error on the ODK Tables unit tests. I ran into this a
few times before I started moving the code folders around, but I’m not sure
how I fixed it last time. I am wondering if any of you have seen it before
and if it is a common configuration error. If you have suggestions for
things to try, I’d appreciate it. The non-ODK Tables tests seem to run
fine, then this (it’s a huge error dump, to show all the "Caused by"s)

I’m just including the one error, but I am getting a large percentage of
ODK Tables unit test failures with the same root cause.

Thanks,

Caden

Feb 13, 2017 3:53:13 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 1663ba78-9eda-401d-970c-8d1eaa99e4dc by user aggregate.opendatakit.org
:web-service
Tests run: 12, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 0.359
sec <<< FAILURE!
testCreateTableAlreadyExists(org.opendatakit.aggregate.odktables.
TableManagerTest) Time elapsed: 0.05 sec <<< ERROR!
java.lang.Exception: Unexpected exception, expected<org.opendatakit.aggre
gate.odktables.exception.TableAlreadyExistsException> but was<org.
opendatakit.common.persistence.exception.ODKEntityNotFoundException>
at org.junit.internal.runners.statements.ExpectException.evaluate(
ExpectException.java:28)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.
java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.
java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider
.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.
java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(
ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(
ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:
75)
Caused by: org.opendatakit.common.persistence.exception.ODKEntityNotFou
ndException: Unable to retrieve odk_unit._registered_users key: aggregate.
opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:768)
at org.opendatakit.common.security.spring.RegisteredUsersTable.
getUserByUri(RegisteredUsersTable.java:289)
at org.opendatakit.aggregate.odktables.relation.EntityCreator.n
ewTableDefinitionEntity(EntityCreator.java:172)
at org.opendatakit.aggregate.odktables.TableManager.createTable(
TableManager.java:458)
at org.opendatakit.aggregate.odktables.TableManagerTest.testCre
ateTableAlreadyExists(TableManagerTest.java:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
ectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
ameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
InvokeMethod.java:17)
at org.junit.internal.runners.statements.ExpectException.evaluate(
ExpectException.java:19)
… 23 more
Caused by: org.opendatakit.common.persistence.exception.ODKEntityNotFou
ndException: Unable to retrieve odk_unit._registered_users key: aggregate.
opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:763)
… 36 more

testGetTable(org.opendatakit.aggregate.odktables.TableManagerTest) Time
elapsed: 0.051 sec <<< ERROR!
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key: aggregate.opendatakit.
org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:768)
at org.opendatakit.common.security.spring.RegisteredUsersTable.
getUserByUri(RegisteredUsersTable.java:289)
at org.opendatakit.aggregate.odktables.relation.EntityCreator.n
ewTableDefinitionEntity(EntityCreator.java:172)
at org.opendatakit.aggregate.odktables.TableManager.createTable(
TableManager.java:458)
at org.opendatakit.aggregate.odktables.TableManagerTest.testGetTable(
TableManagerTest.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
ectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
ameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.
java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.
java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider
.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.
java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(
ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(
ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:
75)
Caused by: org.opendatakit.common.persistence.exception.ODKEntityNotFou
ndException: Unable to retrieve odk_unit._registered_users key: aggregate.
opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:763)
… 35 more

testCreateTable(org.opendatakit.aggregate.odktables.TableManagerTest)
Time elapsed: 0.057 sec <<< ERROR!
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key: aggregate.opendatakit.
org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:768)
at org.opendatakit.common.security.spring.RegisteredUsersTable.
getUserByUri(RegisteredUsersTable.java:289)
at org.opendatakit.aggregate.odktables.relation.EntityCreator.n
ewTableDefinitionEntity(EntityCreator.java:172)
at org.opendatakit.aggregate.odktables.TableManager.createTable(
TableManager.java:458)
at org.opendatakit.aggregate.odktables.TableManagerTest.testCreateTable(
TableManagerTest.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
ectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
ameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.
java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.
java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider
.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.
java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(
ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(
ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:
75)
Caused by: org.opendatakit.common.persistence.exception.ODKEntityNotFou
ndException: Unable to retrieve odk_unit._registered_users key: aggregate.
opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:763)
… 35 more


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

It would help to know where the aggregate.opendatakit.org:webservice key is
supposed to be inserted into the _registered_users table to start, assuming
that that is correct. Naively, I’ve been looking for some test script
where it’s inserted into the _registered_users table, but haven’t found
anything like that.

··· On Monday, February 13, 2017 at 4:31:11 PM UTC-6, C. Howell wrote: > > > Hi ODK Developers, > > I've done a bunch of Maven refactoring on a fresh copy of ODK we forked > about a week ago. I removed the support for MS SQL and Google App Engine. > The goal is to get the project so you can check it out, run mvn clean > install from the command line, and have a .war file for the Maven profile > you have selected-- MySQL or Postgres. I'm still quite a way off but you > can see the progress at https://github.com/benetech/aggregate. I'm > trying to move code into the standard convention Maven folders. > > I'm running into an error on the ODK Tables unit tests. I ran into this a > few times before I started moving the code folders around, but I'm not sure > how I fixed it last time. I am wondering if any of you have seen it before > and if it is a common configuration error. If you have suggestions for > things to try, I'd appreciate it. The non-ODK Tables tests seem to run > fine, then this (it's a huge error dump, to show all the "Caused by"s) > > I'm just including the one error, but I am getting a large percentage of > ODK Tables unit test failures with the same root cause. > > Thanks, > > Caden > > > Feb 13, 2017 3:53:13 PM org.opendatakit.common.persistence.engine.pgres. > DatastoreImpl deleteEntity > INFO: Executing DELETE FROM "odk_unit"."_task_lock" WHERE "_URI" = ? with > key 1663ba78-9eda-401d-970c-8d1eaa99e4dc by user aggregate.opendatakit.org > :web-service > Tests run: 12, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 0.359 > sec < testCreateTableAlreadyExists(org.opendatakit.aggregate.odktables. > TableManagerTest) Time elapsed: 0.05 sec < java.lang.Exception: Unexpected exception, expected aggregate.odktables.exception.TableAlreadyExistsException> but was opendatakit.common.persistence.exception.ODKEntityNotFoundException> > at org.junit.internal.runners.statements.ExpectException.evaluate( > ExpectException.java:28) > at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores. > java:26) > at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters. > java:27) > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) > at org.junit.runners.BlockJUnit4ClassRunner.runChild( > BlockJUnit4ClassRunner.java:78) > at org.junit.runners.BlockJUnit4ClassRunner.runChild( > BlockJUnit4ClassRunner.java:57) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) > at org.junit.runners.ParentRunner.run(ParentRunner.java:363) > at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider > .java:252) > at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet( > JUnit4Provider.java:141) > at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider. > java:112) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray( > ReflectionUtils.java:189) > at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke( > ProviderFactory.java:165) > at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider( > ProviderFactory.java:85) > at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess( > ForkedBooter.java:115) > at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java: > 75) > Caused by: org.opendatakit.common.persistence.exception. > ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users > key: aggregate.opendatakit.org:web-service > at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. > getEntity(DatastoreImpl.java:768) > at org.opendatakit.common.security.spring.RegisteredUsersTable. > getUserByUri(RegisteredUsersTable.java:289) > at org.opendatakit.aggregate.odktables.relation.EntityCreator. > newTableDefinitionEntity(EntityCreator.java:172) > at org.opendatakit.aggregate.odktables.TableManager.createTable( > TableManager.java:458) > at org.opendatakit.aggregate.odktables.TableManagerTest. > testCreateTableAlreadyExists(TableManagerTest.java:148) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( > FrameworkMethod.java:50) > at org.junit.internal.runners.model.ReflectiveCallable.run( > ReflectiveCallable.java:12) > at org.junit.runners.model.FrameworkMethod.invokeExplosively( > FrameworkMethod.java:47) > at org.junit.internal.runners.statements.InvokeMethod.evaluate( > InvokeMethod.java:17) > at org.junit.internal.runners.statements.ExpectException.evaluate( > ExpectException.java:19) > ... 23 more > Caused by: org.opendatakit.common.persistence.exception. > ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users > key: aggregate.opendatakit.org:web-service > at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. > getEntity(DatastoreImpl.java:763) > ... 36 more > > > testGetTable(org.opendatakit.aggregate.odktables.TableManagerTest) Time > elapsed: 0.051 sec < org.opendatakit.common.persistence.exception.ODKEntityNotFoundException: > Unable to retrieve odk_unit._registered_users key: aggregate.opendatakit. > org:web-service > at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. > getEntity(DatastoreImpl.java:768) > at org.opendatakit.common.security.spring.RegisteredUsersTable. > getUserByUri(RegisteredUsersTable.java:289) > at org.opendatakit.aggregate.odktables.relation.EntityCreator. > newTableDefinitionEntity(EntityCreator.java:172) > at org.opendatakit.aggregate.odktables.TableManager.createTable( > TableManager.java:458) > at org.opendatakit.aggregate.odktables.TableManagerTest.testGetTable( > TableManagerTest.java:179) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( > FrameworkMethod.java:50) > at org.junit.internal.runners.model.ReflectiveCallable.run( > ReflectiveCallable.java:12) > at org.junit.runners.model.FrameworkMethod.invokeExplosively( > FrameworkMethod.java:47) > at org.junit.internal.runners.statements.InvokeMethod.evaluate( > InvokeMethod.java:17) > at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores. > java:26) > at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters. > java:27) > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) > at org.junit.runners.BlockJUnit4ClassRunner.runChild( > BlockJUnit4ClassRunner.java:78) > at org.junit.runners.BlockJUnit4ClassRunner.runChild( > BlockJUnit4ClassRunner.java:57) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) > at org.junit.runners.ParentRunner.run(ParentRunner.java:363) > at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider > .java:252) > at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet( > JUnit4Provider.java:141) > at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider. > java:112) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray( > ReflectionUtils.java:189) > at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke( > ProviderFactory.java:165) > at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider( > ProviderFactory.java:85) > at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess( > ForkedBooter.java:115) > at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java: > 75) > Caused by: org.opendatakit.common.persistence.exception. > ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users > key: aggregate.opendatakit.org:web-service > at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. > getEntity(DatastoreImpl.java:763) > ... 35 more > > > testCreateTable(org.opendatakit.aggregate.odktables.TableManagerTest) > Time elapsed: 0.057 sec < org.opendatakit.common.persistence.exception.ODKEntityNotFoundException: > Unable to retrieve odk_unit._registered_users key: aggregate.opendatakit. > org:web-service > at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. > getEntity(DatastoreImpl.java:768) > at org.opendatakit.common.security.spring.RegisteredUsersTable. > getUserByUri(RegisteredUsersTable.java:289) > at org.opendatakit.aggregate.odktables.relation.EntityCreator. > newTableDefinitionEntity(EntityCreator.java:172) > at org.opendatakit.aggregate.odktables.TableManager.createTable( > TableManager.java:458) > at org.opendatakit.aggregate.odktables.TableManagerTest.testCreateTable( > TableManagerTest.java:130) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( > FrameworkMethod.java:50) > at org.junit.internal.runners.model.ReflectiveCallable.run( > ReflectiveCallable.java:12) > at org.junit.runners.model.FrameworkMethod.invokeExplosively( > FrameworkMethod.java:47) > at org.junit.internal.runners.statements.InvokeMethod.evaluate( > InvokeMethod.java:17) > at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores. > java:26) > at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters. > java:27) > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) > at org.junit.runners.BlockJUnit4ClassRunner.runChild( > BlockJUnit4ClassRunner.java:78) > at org.junit.runners.BlockJUnit4ClassRunner.runChild( > BlockJUnit4ClassRunner.java:57) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) > at org.junit.runners.ParentRunner.run(ParentRunner.java:363) > at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider > .java:252) > at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet( > JUnit4Provider.java:141) > at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider. > java:112) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray( > ReflectionUtils.java:189) > at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke( > ProviderFactory.java:165) > at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider( > ProviderFactory.java:85) > at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess( > ForkedBooter.java:115) > at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java: > 75) > Caused by: org.opendatakit.common.persistence.exception. > ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users > key: aggregate.opendatakit.org:web-service > at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. > getEntity(DatastoreImpl.java:763) > ... 35 more > > > >

Thank you for the suggestions! I am on Postgres 9.2, so I will try and
update that.

On 9.2, I tried running the postgres commands to drop and recreate the
odk_unit table:

sudo -u postgres psql postgres
create database “odk_unit”;
SELECT datname FROM pg_database WHERE datistemplate = false;
create user “odk_unit” with unencrypted password ‘odk_unit’;
grant all privileges on database “odk_unit” to “odk_unit”;
alter database “odk_unit” owner to “odk_unit”;
\c “odk_unit”;
create schema “odk_unit”;
grant all privileges on schema “odk_unit” to “odk_unit”;

and then I ran just the TableManagerTest.testCreateTable JUnit test from
Eclipse. I got the same "
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service" error. Should I be able to run any
of these unit tests independently after recreating the database? I will
try again after updating to Postgres 9.4.

Thanks,

Caden

··· On Monday, February 13, 2017 at 7:13:39 PM UTC-6, Mitch wrote: > > My first thought is that you haven't run the before and after scripts to > drop and create the database schema so it has cruft in it. If you are > combining the UI test (aggregate-postgres) and the postgres-unit-tests into > one project, note that we expect the database to be dropped and recreated > between those two sets of tests. > > If you are using PostgreSQL, be sure you are running at least 9.4. > There are permissions issues with 9.3 and earlier that might cause > problems. > > When I just want to build one variant, I edit the top-level pom.xml to > comment out all the modules that I don't want to build. > > The tricky thing with the maven build is the handling of the GWT compile. > When this was first constructed, there was negligible support for multiple > build artifacts within maven. I believe this has now been fleshed out. > > Ideally, the aggregate-src project should build both the GWT artifacts and > the jar. > Then the individual projects can reference those and avoid a recompile to > generate the GWT artifacts. > > The unit tests for GAE require a custom context, which is why the UI and > unit tests were split out into separate maven projects (and the others just > followed that model to maintain structural parallelism). > > > > > > On Mon, Feb 13, 2017 at 2:31 PM, C. Howell <ca...@cadenconsulting.com > wrote: > >> >> Hi ODK Developers, >> >> I've done a bunch of Maven refactoring on a fresh copy of ODK we forked >> about a week ago. I removed the support for MS SQL and Google App Engine. >> The goal is to get the project so you can check it out, run mvn clean >> install from the command line, and have a .war file for the Maven profile >> you have selected-- MySQL or Postgres. I'm still quite a way off but you >> can see the progress at https://github.com/benetech/aggregate. I'm >> trying to move code into the standard convention Maven folders. >> >> I'm running into an error on the ODK Tables unit tests. I ran into this >> a few times before I started moving the code folders around, but I'm not >> sure how I fixed it last time. I am wondering if any of you have seen it >> before and if it is a common configuration error. If you have suggestions >> for things to try, I'd appreciate it. The non-ODK Tables tests seem to run >> fine, then this (it's a huge error dump, to show all the "Caused by"s) >> >> I'm just including the one error, but I am getting a large percentage of >> ODK Tables unit test failures with the same root cause. >> >> Thanks, >> >> Caden >> >> >> Feb 13, 2017 3:53:13 PM org.opendatakit.common.persistence.engine.pgres. >> DatastoreImpl deleteEntity >> INFO: Executing DELETE FROM "odk_unit"."_task_lock" WHERE "_URI" = ? with >> key 1663ba78-9eda-401d-970c-8d1eaa99e4dc by user aggregate.opendatakit. >> org:web-service >> Tests run: 12, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 0.359 >> sec <> testCreateTableAlreadyExists(org.opendatakit.aggregate.odktables. >> TableManagerTest) Time elapsed: 0.05 sec <> java.lang.Exception: Unexpected exception, expected> aggregate.odktables.exception.TableAlreadyExistsException> but was> opendatakit.common.persistence.exception.ODKEntityNotFoundException> >> at org.junit.internal.runners.statements.ExpectException.evaluate( >> ExpectException.java:28) >> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores. >> java:26) >> at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters. >> java:27) >> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) >> at org.junit.runners.BlockJUnit4ClassRunner.runChild( >> BlockJUnit4ClassRunner.java:78) >> at org.junit.runners.BlockJUnit4ClassRunner.runChild( >> BlockJUnit4ClassRunner.java:57) >> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) >> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) >> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) >> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) >> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) >> at org.junit.runners.ParentRunner.run(ParentRunner.java:363) >> at org.apache.maven.surefire.junit4.JUnit4Provider.execute( >> JUnit4Provider.java:252) >> at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet( >> JUnit4Provider.java:141) >> at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider >> .java:112) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. >> java:62) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke( >> DelegatingMethodAccessorImpl.java:43) >> at java.lang.reflect.Method.invoke(Method.java:498) >> at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray( >> ReflectionUtils.java:189) >> at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke >> (ProviderFactory.java:165) >> at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider( >> ProviderFactory.java:85) >> at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess( >> ForkedBooter.java:115) >> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java: >> 75) >> Caused by: org.opendatakit.common.persistence.exception. >> ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users >> key: aggregate.opendatakit.org:web-service >> at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. >> getEntity(DatastoreImpl.java:768) >> at org.opendatakit.common.security.spring.RegisteredUsersTable. >> getUserByUri(RegisteredUsersTable.java:289) >> at org.opendatakit.aggregate.odktables.relation.EntityCreator. >> newTableDefinitionEntity(EntityCreator.java:172) >> at org.opendatakit.aggregate.odktables.TableManager.createTable( >> TableManager.java:458) >> at org.opendatakit.aggregate.odktables.TableManagerTest. >> testCreateTableAlreadyExists(TableManagerTest.java:148) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. >> java:62) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke( >> DelegatingMethodAccessorImpl.java:43) >> at java.lang.reflect.Method.invoke(Method.java:498) >> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( >> FrameworkMethod.java:50) >> at org.junit.internal.runners.model.ReflectiveCallable.run( >> ReflectiveCallable.java:12) >> at org.junit.runners.model.FrameworkMethod.invokeExplosively( >> FrameworkMethod.java:47) >> at org.junit.internal.runners.statements.InvokeMethod.evaluate( >> InvokeMethod.java:17) >> at org.junit.internal.runners.statements.ExpectException.evaluate( >> ExpectException.java:19) >> ... 23 more >> Caused by: org.opendatakit.common.persistence.exception. >> ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users >> key: aggregate.opendatakit.org:web-service >> at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. >> getEntity(DatastoreImpl.java:763) >> ... 36 more >> >> >> testGetTable(org.opendatakit.aggregate.odktables.TableManagerTest) Time >> elapsed: 0.051 sec <> org.opendatakit.common.persistence.exception.ODKEntityNotFoundException: >> Unable to retrieve odk_unit._registered_users key: aggregate.opendatakit. >> org:web-service >> at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. >> getEntity(DatastoreImpl.java:768) >> at org.opendatakit.common.security.spring.RegisteredUsersTable. >> getUserByUri(RegisteredUsersTable.java:289) >> at org.opendatakit.aggregate.odktables.relation.EntityCreator. >> newTableDefinitionEntity(EntityCreator.java:172) >> at org.opendatakit.aggregate.odktables.TableManager.createTable( >> TableManager.java:458) >> at org.opendatakit.aggregate.odktables.TableManagerTest.testGetTable( >> TableManagerTest.java:179) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. >> java:62) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke( >> DelegatingMethodAccessorImpl.java:43) >> at java.lang.reflect.Method.invoke(Method.java:498) >> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( >> FrameworkMethod.java:50) >> at org.junit.internal.runners.model.ReflectiveCallable.run( >> ReflectiveCallable.java:12) >> at org.junit.runners.model.FrameworkMethod.invokeExplosively( >> FrameworkMethod.java:47) >> at org.junit.internal.runners.statements.InvokeMethod.evaluate( >> InvokeMethod.java:17) >> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores. >> java:26) >> at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters. >> java:27) >> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) >> at org.junit.runners.BlockJUnit4ClassRunner.runChild( >> BlockJUnit4ClassRunner.java:78) >> at org.junit.runners.BlockJUnit4ClassRunner.runChild( >> BlockJUnit4ClassRunner.java:57) >> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) >> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) >> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) >> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) >> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) >> at org.junit.runners.ParentRunner.run(ParentRunner.java:363) >> at org.apache.maven.surefire.junit4.JUnit4Provider.execute( >> JUnit4Provider.java:252) >> at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet( >> JUnit4Provider.java:141) >> at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider >> .java:112) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. >> java:62) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke( >> DelegatingMethodAccessorImpl.java:43) >> at java.lang.reflect.Method.invoke(Method.java:498) >> at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray( >> ReflectionUtils.java:189) >> at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke >> (ProviderFactory.java:165) >> at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider( >> ProviderFactory.java:85) >> at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess( >> ForkedBooter.java:115) >> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java: >> 75) >> Caused by: org.opendatakit.common.persistence.exception. >> ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users >> key: aggregate.opendatakit.org:web-service >> at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. >> getEntity(DatastoreImpl.java:763) >> ... 35 more >> >> >> testCreateTable(org.opendatakit.aggregate.odktables.TableManagerTest) >> Time elapsed: 0.057 sec <> org.opendatakit.common.persistence.exception.ODKEntityNotFoundException: >> Unable to retrieve odk_unit._registered_users key: aggregate.opendatakit. >> org:web-service >> at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. >> getEntity(DatastoreImpl.java:768) >> at org.opendatakit.common.security.spring.RegisteredUsersTable. >> getUserByUri(RegisteredUsersTable.java:289) >> at org.opendatakit.aggregate.odktables.relation.EntityCreator. >> newTableDefinitionEntity(EntityCreator.java:172) >> at org.opendatakit.aggregate.odktables.TableManager.createTable( >> TableManager.java:458) >> at org.opendatakit.aggregate.odktables.TableManagerTest.testCreateTable( >> TableManagerTest.java:130) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. >> java:62) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke( >> DelegatingMethodAccessorImpl.java:43) >> at java.lang.reflect.Method.invoke(Method.java:498) >> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( >> FrameworkMethod.java:50) >> at org.junit.internal.runners.model.ReflectiveCallable.run( >> ReflectiveCallable.java:12) >> at org.junit.runners.model.FrameworkMethod.invokeExplosively( >> FrameworkMethod.java:47) >> at org.junit.internal.runners.statements.InvokeMethod.evaluate( >> InvokeMethod.java:17) >> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores. >> java:26) >> at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters. >> java:27) >> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) >> at org.junit.runners.BlockJUnit4ClassRunner.runChild( >> BlockJUnit4ClassRunner.java:78) >> at org.junit.runners.BlockJUnit4ClassRunner.runChild( >> BlockJUnit4ClassRunner.java:57) >> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) >> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) >> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) >> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) >> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) >> at org.junit.runners.ParentRunner.run(ParentRunner.java:363) >> at org.apache.maven.surefire.junit4.JUnit4Provider.execute( >> JUnit4Provider.java:252) >> at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet( >> JUnit4Provider.java:141) >> at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider >> .java:112) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. >> java:62) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke( >> DelegatingMethodAccessorImpl.java:43) >> at java.lang.reflect.Method.invoke(Method.java:498) >> at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray( >> ReflectionUtils.java:189) >> at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke >> (ProviderFactory.java:165) >> at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider( >> ProviderFactory.java:85) >> at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess( >> ForkedBooter.java:115) >> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java: >> 75) >> Caused by: org.opendatakit.common.persistence.exception. >> ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users >> key: aggregate.opendatakit.org:web-service >> at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. >> getEntity(DatastoreImpl.java:763) >> ... 35 more >> >> >> >> -- >> 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 >

The web-service user is the DAEMON_USER (see


)

It sounds like the spring beans security initialization is not being
executed.

The user configuration is enforced within the RoleHierarchyImpl object in
its afterPropertiesSet() (bean load) method.

··· On Tue, Feb 14, 2017 at 10:36 AM, C. Howell wrote:

Thank you for the suggestions! I am on Postgres 9.2, so I will try and
update that.

On 9.2, I tried running the postgres commands to drop and recreate the
odk_unit table:

sudo -u postgres psql postgres
create database “odk_unit”;
SELECT datname FROM pg_database WHERE datistemplate = false;
create user “odk_unit” with unencrypted password ‘odk_unit’;
grant all privileges on database “odk_unit” to “odk_unit”;
alter database “odk_unit” owner to “odk_unit”;
\c “odk_unit”;
create schema “odk_unit”;
grant all privileges on schema “odk_unit” to “odk_unit”;

and then I ran just the TableManagerTest.testCreateTable JUnit test from
Eclipse. I got the same " org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service" error. Should I be able to run
any of these unit tests independently after recreating the database? I
will try again after updating to Postgres 9.4.

Thanks,

Caden

On Monday, February 13, 2017 at 7:13:39 PM UTC-6, Mitch wrote:

My first thought is that you haven’t run the before and after scripts to
drop and create the database schema so it has cruft in it. If you are
combining the UI test (aggregate-postgres) and the postgres-unit-tests into
one project, note that we expect the database to be dropped and recreated
between those two sets of tests.

If you are using PostgreSQL, be sure you are running at least 9.4.
There are permissions issues with 9.3 and earlier that might cause
problems.

When I just want to build one variant, I edit the top-level pom.xml to
comment out all the modules that I don’t want to build.

The tricky thing with the maven build is the handling of the GWT compile.
When this was first constructed, there was negligible support for multiple
build artifacts within maven. I believe this has now been fleshed out.

Ideally, the aggregate-src project should build both the GWT artifacts
and the jar.
Then the individual projects can reference those and avoid a recompile to
generate the GWT artifacts.

The unit tests for GAE require a custom context, which is why the UI and
unit tests were split out into separate maven projects (and the others just
followed that model to maintain structural parallelism).

On Mon, Feb 13, 2017 at 2:31 PM, C. Howell ca...@cadenconsulting.com wrote:

Hi ODK Developers,

I’ve done a bunch of Maven refactoring on a fresh copy of ODK we forked
about a week ago. I removed the support for MS SQL and Google App Engine.
The goal is to get the project so you can check it out, run mvn clean
install from the command line, and have a .war file for the Maven profile
you have selected-- MySQL or Postgres. I’m still quite a way off but you
can see the progress at https://github.com/benetech/aggregate. I’m
trying to move code into the standard convention Maven folders.

I’m running into an error on the ODK Tables unit tests. I ran into this
a few times before I started moving the code folders around, but I’m not
sure how I fixed it last time. I am wondering if any of you have seen it
before and if it is a common configuration error. If you have suggestions
for things to try, I’d appreciate it. The non-ODK Tables tests seem to run
fine, then this (it’s a huge error dump, to show all the "Caused by"s)

I’m just including the one error, but I am getting a large percentage of
ODK Tables unit test failures with the same root cause.

Thanks,

Caden

Feb 13, 2017 3:53:13 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ?
with key 1663ba78-9eda-401d-970c-8d1eaa99e4dc by user aggregate.
opendatakit.org:web-service
Tests run: 12, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 0.359
sec <<< FAILURE!
testCreateTableAlreadyExists(org.opendatakit.aggregate.odktables.
TableManagerTest) Time elapsed: 0.05 sec <<< ERROR!
java.lang.Exception: Unexpected exception, expected<org.opendatakit.
aggregate.odktables.exception.TableAlreadyExistsException> but was<org.
opendatakit.common.persistence.exception.ODKEntityNotFoundException>
at org.junit.internal.runners.statements.ExpectException.evaluate(
ExpectException.java:28)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores
.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.
java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
t4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray
(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.
invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java
:75)
Caused by: org.opendatakit.common.persistence.exception.ODKEntityNotFou
ndException: Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:768)
at org.opendatakit.common.security.spring.RegisteredUsersTable.
getUserByUri(RegisteredUsersTable.java:289)
at org.opendatakit.aggregate.odktables.relation.EntityCreator.n
ewTableDefinitionEntity(EntityCreator.java:172)
at org.opendatakit.aggregate.odktables.TableManager.createTable(
TableManager.java:458)
at org.opendatakit.aggregate.odktables.TableManagerTest.testCre
ateTableAlreadyExists(TableManagerTest.java:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
ectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
ameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
InvokeMethod.java:17)
at org.junit.internal.runners.statements.ExpectException.evaluate(
ExpectException.java:19)
… 23 more
Caused by: org.opendatakit.common.persistence.exception.ODKEntityNotFou
ndException: Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:763)
… 36 more

testGetTable(org.opendatakit.aggregate.odktables.TableManagerTest) Time
elapsed: 0.051 sec <<< ERROR!
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key: aggregate.opendatakit
.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:768)
at org.opendatakit.common.security.spring.RegisteredUsersTable.
getUserByUri(RegisteredUsersTable.java:289)
at org.opendatakit.aggregate.odktables.relation.EntityCreator.n
ewTableDefinitionEntity(EntityCreator.java:172)
at org.opendatakit.aggregate.odktables.TableManager.createTable(
TableManager.java:458)
at org.opendatakit.aggregate.odktables.TableManagerTest.testGetTable(
TableManagerTest.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
ectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
ameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores
.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.
java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
t4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray
(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.
invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java
:75)
Caused by: org.opendatakit.common.persistence.exception.ODKEntityNotFou
ndException: Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-
service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:763)
… 35 more

testCreateTable(org.opendatakit.aggregate.odktables.TableManagerTest)
Time elapsed: 0.057 sec <<< ERROR!
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key: aggregate.opendatakit
.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:768)
at org.opendatakit.common.security.spring.RegisteredUsersTable.
getUserByUri(RegisteredUsersTable.java:289)
at org.opendatakit.aggregate.odktables.relation.EntityCreator.n
ewTableDefinitionEntity(EntityCreator.java:172)
at org.opendatakit.aggregate.odktables.TableManager.createTable(
TableManager.java:458)
at org.opendatakit.aggregate.odktables.TableManagerTest.testCreateTable
(TableManagerTest.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
ectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
ameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores
.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.
java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
t4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray
(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.
invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java
:75)
Caused by: org.opendatakit.common.persistence.exception.ODKEntityNotFou
ndException: Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:763)
… 35 more


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

And as noted on another thread, you need to be able to access the
information_schema in order for ODK Aggregate to function.
e.g.,

The solution as noted in the other thread is to grant all privileges to the
user for information_schema, or perhaps just usage.

··· On Tue, Feb 14, 2017 at 11:32 AM, Mitch Sundt wrote:

The web-service user is the DAEMON_USER (see https://github.com/
opendatakit/aggregate/blob/master/src/main/java/org/
opendatakit/common/security/User.java )

It sounds like the spring beans security initialization is not being
executed.

The user configuration is enforced within the RoleHierarchyImpl object in
its afterPropertiesSet() (bean load) method.

https://github.com/opendatakit/aggregate/blob/master/src/main/java/org/
opendatakit/common/security/spring/RoleHierarchyImpl.java#L132

On Tue, Feb 14, 2017 at 10:36 AM, C. Howell caden@cadenconsulting.com wrote:

Thank you for the suggestions! I am on Postgres 9.2, so I will try and
update that.

On 9.2, I tried running the postgres commands to drop and recreate the
odk_unit table:

sudo -u postgres psql postgres
create database “odk_unit”;
SELECT datname FROM pg_database WHERE datistemplate = false;
create user “odk_unit” with unencrypted password ‘odk_unit’;
grant all privileges on database “odk_unit” to “odk_unit”;
alter database “odk_unit” owner to “odk_unit”;
\c “odk_unit”;
create schema “odk_unit”;
grant all privileges on schema “odk_unit” to “odk_unit”;

and then I ran just the TableManagerTest.testCreateTable JUnit test from
Eclipse. I got the same " org.opendatakit.common.persist
ence.exception.ODKEntityNotFoundException: Unable to retrieve
odk_unit._registered_users key: aggregate.opendatakit.org:web-service"
error. Should I be able to run any of these unit tests independently after
recreating the database? I will try again after updating to Postgres 9.4.

Thanks,

Caden

On Monday, February 13, 2017 at 7:13:39 PM UTC-6, Mitch wrote:

My first thought is that you haven’t run the before and after scripts to
drop and create the database schema so it has cruft in it. If you are
combining the UI test (aggregate-postgres) and the postgres-unit-tests into
one project, note that we expect the database to be dropped and recreated
between those two sets of tests.

If you are using PostgreSQL, be sure you are running at least 9.4.
There are permissions issues with 9.3 and earlier that might cause
problems.

When I just want to build one variant, I edit the top-level pom.xml to
comment out all the modules that I don’t want to build.

The tricky thing with the maven build is the handling of the GWT
compile. When this was first constructed, there was negligible support for
multiple build artifacts within maven. I believe this has now been fleshed
out.

Ideally, the aggregate-src project should build both the GWT artifacts
and the jar.
Then the individual projects can reference those and avoid a recompile
to generate the GWT artifacts.

The unit tests for GAE require a custom context, which is why the UI and
unit tests were split out into separate maven projects (and the others just
followed that model to maintain structural parallelism).

On Mon, Feb 13, 2017 at 2:31 PM, C. Howell ca...@cadenconsulting.com wrote:

Hi ODK Developers,

I’ve done a bunch of Maven refactoring on a fresh copy of ODK we forked
about a week ago. I removed the support for MS SQL and Google App Engine.
The goal is to get the project so you can check it out, run mvn clean
install from the command line, and have a .war file for the Maven profile
you have selected-- MySQL or Postgres. I’m still quite a way off but you
can see the progress at https://github.com/benetech/aggregate. I’m
trying to move code into the standard convention Maven folders.

I’m running into an error on the ODK Tables unit tests. I ran into
this a few times before I started moving the code folders around, but I’m
not sure how I fixed it last time. I am wondering if any of you have seen
it before and if it is a common configuration error. If you have
suggestions for things to try, I’d appreciate it. The non-ODK Tables tests
seem to run fine, then this (it’s a huge error dump, to show all the
"Caused by"s)

I’m just including the one error, but I am getting a large percentage
of ODK Tables unit test failures with the same root cause.

Thanks,

Caden

Feb 13, 2017 3:53:13 PM org.opendatakit.common.persistence.engine.pgres
.DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ?
with key 1663ba78-9eda-401d-970c-8d1eaa99e4dc by user aggregate.
opendatakit.org:web-service
Tests run: 12, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 0.359
sec <<< FAILURE!
testCreateTableAlreadyExists(org.opendatakit.aggregate.odktables.
TableManagerTest) Time elapsed: 0.05 sec <<< ERROR!
java.lang.Exception: Unexpected exception, expected<org.opendatakit.
aggregate.odktables.exception.TableAlreadyExistsException> but was<org.
opendatakit.common.persistence.exception.ODKEntityNotFoundException>
at org.junit.internal.runners.statements.ExpectException.evaluate(
ExpectException.java:28)
at org.junit.internal.runners.statements.RunBefores.evaluate(Ru
nBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.
java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
t4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
ssorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodW
ithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.
invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.
java:75)
Caused by: org.opendatakit.common.persistence.exception.ODKEntityNotFou
ndException: Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:768)
at org.opendatakit.common.security.spring.RegisteredUsersTable.
getUserByUri(RegisteredUsersTable.java:289)
at org.opendatakit.aggregate.odktables.relation.EntityCreator.n
ewTableDefinitionEntity(EntityCreator.java:172)
at org.opendatakit.aggregate.odktables.TableManager.createTable(
TableManager.java:458)
at org.opendatakit.aggregate.odktables.TableManagerTest.testCre
ateTableAlreadyExists(TableManagerTest.java:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
ssorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
ectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
ameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
InvokeMethod.java:17)
at org.junit.internal.runners.statements.ExpectException.evaluate(
ExpectException.java:19)
… 23 more
Caused by: org.opendatakit.common.persistence.exception.ODKEntityNotFou
ndException: Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:763)
… 36 more

testGetTable(org.opendatakit.aggregate.odktables.TableManagerTest)
Time elapsed: 0.051 sec <<< ERROR!
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException
: Unable to retrieve odk_unit._registered_users key: aggregate.
opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:768)
at org.opendatakit.common.security.spring.RegisteredUsersTable.
getUserByUri(RegisteredUsersTable.java:289)
at org.opendatakit.aggregate.odktables.relation.EntityCreator.n
ewTableDefinitionEntity(EntityCreator.java:172)
at org.opendatakit.aggregate.odktables.TableManager.createTable(
TableManager.java:458)
at org.opendatakit.aggregate.odktables.TableManagerTest.testGetTable(
TableManagerTest.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
ssorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
ectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
ameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(Ru
nBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.
java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
t4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
ssorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodW
ithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.
invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.
java:75)
Caused by: org.opendatakit.common.persistence.exception.ODKEntityNotFou
ndException: Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-
service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:763)
… 35 more

testCreateTable(org.opendatakit.aggregate.odktables.TableManagerTest)
Time elapsed: 0.057 sec <<< ERROR!
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException
: Unable to retrieve odk_unit._registered_users key: aggregate.
opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:768)
at org.opendatakit.common.security.spring.RegisteredUsersTable.
getUserByUri(RegisteredUsersTable.java:289)
at org.opendatakit.aggregate.odktables.relation.EntityCreator.n
ewTableDefinitionEntity(EntityCreator.java:172)
at org.opendatakit.aggregate.odktables.TableManager.createTable(
TableManager.java:458)
at org.opendatakit.aggregate.odktables.TableManagerTest.testCre
ateTable(TableManagerTest.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
ssorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
ectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
ameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(Ru
nBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.
java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
t4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
ssorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodW
ithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.
invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.
java:75)
Caused by: org.opendatakit.common.persistence.exception.ODKEntityNotFou
ndException: Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:763)
… 35 more


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


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

Thanks again!

I’ve updated to Postgres 9.4, and am getting the same error there.
I ran “GRANT SELECT ON ALL TABLES IN SCHEMA PUBLIC TO “odk_unit”;” and then
“GRANT all ON ALL TABLES IN SCHEMA PUBLIC TO “odk_unit”;” and neither of
those fixed the error.
I’m investigating the spring-beans security now.

··· On Tuesday, February 14, 2017 at 1:36:45 PM UTC-6, Mitch wrote: > > And as noted on another thread, you need to be able to access the > information_schema in order for ODK Aggregate to function. > e.g., > > > https://github.com/opendatakit/aggregate/blob/master/src/main/java/org/opendatakit/common/persistence/engine/pgres/DatastoreImpl.java#L180 > > The solution as noted in the other thread is to grant all privileges to > the user for information_schema, or perhaps just usage. > > > On Tue, Feb 14, 2017 at 11:32 AM, Mitch Sundt <mitche...@gmail.com > wrote: > >> The web-service user is the DAEMON_USER (see >> https://github.com/opendatakit/aggregate/blob/master/src/main/java/org/opendatakit/common/security/User.java >> ) >> >> It sounds like the spring beans security initialization is not being >> executed. >> >> The user configuration is enforced within the RoleHierarchyImpl object in >> its afterPropertiesSet() (bean load) method. >> >> >> https://github.com/opendatakit/aggregate/blob/master/src/main/java/org/opendatakit/common/security/spring/RoleHierarchyImpl.java#L132 >> >> >> >> On Tue, Feb 14, 2017 at 10:36 AM, C. Howell <ca...@cadenconsulting.com > wrote: >> >>> >>> Thank you for the suggestions! I am on Postgres 9.2, so I will try and >>> update that. >>> >>> On 9.2, I tried running the postgres commands to drop and recreate the >>> odk_unit table: >>> >>> sudo -u postgres psql postgres >>> create database "odk_unit"; >>> SELECT datname FROM pg_database WHERE datistemplate = false; >>> create user "odk_unit" with unencrypted password 'odk_unit'; >>> grant all privileges on database "odk_unit" to "odk_unit"; >>> alter database "odk_unit" owner to "odk_unit"; >>> \c "odk_unit"; >>> create schema "odk_unit"; >>> grant all privileges on schema "odk_unit" to "odk_unit"; >>> >>> >>> and then I ran just the TableManagerTest.testCreateTable JUnit test from >>> Eclipse. I got the same " >>> org.opendatakit.common.persistence.exception.ODKEntityNotFoundException: >>> Unable to retrieve odk_unit._registered_users key: >>> aggregate.opendatakit.org:web-service" error. Should I be able to run any >>> of these unit tests independently after recreating the database? I will >>> try again after updating to Postgres 9.4. >>> >>> Thanks, >>> >>> Caden >>> >>> >>> On Monday, February 13, 2017 at 7:13:39 PM UTC-6, Mitch wrote: >>>> >>>> My first thought is that you haven't run the before and after scripts >>>> to drop and create the database schema so it has cruft in it. If you are >>>> combining the UI test (aggregate-postgres) and the postgres-unit-tests into >>>> one project, note that we expect the database to be dropped and recreated >>>> between those two sets of tests. >>>> >>>> If you are using PostgreSQL, be sure you are running at least 9.4. >>>> There are permissions issues with 9.3 and earlier that might cause >>>> problems. >>>> >>>> When I just want to build one variant, I edit the top-level pom.xml to >>>> comment out all the modules that I don't want to build. >>>> >>>> The tricky thing with the maven build is the handling of the GWT >>>> compile. When this was first constructed, there was negligible support for >>>> multiple build artifacts within maven. I believe this has now been fleshed >>>> out. >>>> >>>> Ideally, the aggregate-src project should build both the GWT artifacts >>>> and the jar. >>>> Then the individual projects can reference those and avoid a recompile >>>> to generate the GWT artifacts. >>>> >>>> The unit tests for GAE require a custom context, which is why the UI >>>> and unit tests were split out into separate maven projects (and the others >>>> just followed that model to maintain structural parallelism). >>>> >>>> >>>> >>>> >>>> >>>> On Mon, Feb 13, 2017 at 2:31 PM, C. Howell wrote: >>>> >>>>> >>>>> Hi ODK Developers, >>>>> >>>>> I've done a bunch of Maven refactoring on a fresh copy of ODK we >>>>> forked about a week ago. I removed the support for MS SQL and Google App >>>>> Engine. The goal is to get the project so you can check it out, run mvn >>>>> clean install from the command line, and have a .war file for the Maven >>>>> profile you have selected-- MySQL or Postgres. I'm still quite a way off >>>>> but you can see the progress at https://github.com/benetech/aggregate. >>>>> I'm trying to move code into the standard convention Maven folders. >>>>> >>>>> I'm running into an error on the ODK Tables unit tests. I ran into >>>>> this a few times before I started moving the code folders around, but I'm >>>>> not sure how I fixed it last time. I am wondering if any of you have seen >>>>> it before and if it is a common configuration error. If you have >>>>> suggestions for things to try, I'd appreciate it. The non-ODK Tables tests >>>>> seem to run fine, then this (it's a huge error dump, to show all the >>>>> "Caused by"s) >>>>> >>>>> I'm just including the one error, but I am getting a large percentage >>>>> of ODK Tables unit test failures with the same root cause. >>>>> >>>>> Thanks, >>>>> >>>>> Caden >>>>> >>>>> >>>>> Feb 13, 2017 3:53:13 PM org.opendatakit.common.persistence.engine. >>>>> pgres.DatastoreImpl deleteEntity >>>>> INFO: Executing DELETE FROM "odk_unit"."_task_lock" WHERE "_URI" = ? >>>>> with key 1663ba78-9eda-401d-970c-8d1eaa99e4dc by user aggregate. >>>>> opendatakit.org:web-service >>>>> Tests run: 12, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 0.359 >>>>> sec <>>>> testCreateTableAlreadyExists(org.opendatakit.aggregate.odktables. >>>>> TableManagerTest) Time elapsed: 0.05 sec <>>>> java.lang.Exception: Unexpected exception, expected>>>> aggregate.odktables.exception.TableAlreadyExistsException> but was>>>> .opendatakit.common.persistence.exception.ODKEntityNotFoundException> >>>>> at org.junit.internal.runners.statements.ExpectException.evaluate( >>>>> ExpectException.java:28) >>>>> at org.junit.internal.runners.statements.RunBefores.evaluate( >>>>> RunBefores.java:26) >>>>> at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters >>>>> .java:27) >>>>> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) >>>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild( >>>>> BlockJUnit4ClassRunner.java:78) >>>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild( >>>>> BlockJUnit4ClassRunner.java:57) >>>>> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) >>>>> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) >>>>> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) >>>>> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) >>>>> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) >>>>> at org.junit.runners.ParentRunner.run(ParentRunner.java:363) >>>>> at org.apache.maven.surefire.junit4.JUnit4Provider.execute( >>>>> JUnit4Provider.java:252) >>>>> at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet( >>>>> JUnit4Provider.java:141) >>>>> at org.apache.maven.surefire.junit4.JUnit4Provider.invoke( >>>>> JUnit4Provider.java:112) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke( >>>>> NativeMethodAccessorImpl.java:62) >>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke( >>>>> DelegatingMethodAccessorImpl.java:43) >>>>> at java.lang.reflect.Method.invoke(Method.java:498) >>>>> at org.apache.maven.surefire.util.ReflectionUtils. >>>>> invokeMethodWithArray(ReflectionUtils.java:189) >>>>> at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy. >>>>> invoke(ProviderFactory.java:165) >>>>> at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider( >>>>> ProviderFactory.java:85) >>>>> at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess( >>>>> ForkedBooter.java:115) >>>>> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter. >>>>> java:75) >>>>> Caused by: org.opendatakit.common.persistence.exception. >>>>> ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users >>>>> key: aggregate.opendatakit.org:web-service >>>>> at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. >>>>> getEntity(DatastoreImpl.java:768) >>>>> at org.opendatakit.common.security.spring.RegisteredUsersTable. >>>>> getUserByUri(RegisteredUsersTable.java:289) >>>>> at org.opendatakit.aggregate.odktables.relation.EntityCreator. >>>>> newTableDefinitionEntity(EntityCreator.java:172) >>>>> at org.opendatakit.aggregate.odktables.TableManager.createTable( >>>>> TableManager.java:458) >>>>> at org.opendatakit.aggregate.odktables.TableManagerTest. >>>>> testCreateTableAlreadyExists(TableManagerTest.java:148) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke( >>>>> NativeMethodAccessorImpl.java:62) >>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke( >>>>> DelegatingMethodAccessorImpl.java:43) >>>>> at java.lang.reflect.Method.invoke(Method.java:498) >>>>> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( >>>>> FrameworkMethod.java:50) >>>>> at org.junit.internal.runners.model.ReflectiveCallable.run( >>>>> ReflectiveCallable.java:12) >>>>> at org.junit.runners.model.FrameworkMethod.invokeExplosively( >>>>> FrameworkMethod.java:47) >>>>> at org.junit.internal.runners.statements.InvokeMethod.evaluate( >>>>> InvokeMethod.java:17) >>>>> at org.junit.internal.runners.statements.ExpectException.evaluate( >>>>> ExpectException.java:19) >>>>> ... 23 more >>>>> Caused by: org.opendatakit.common.persistence.exception. >>>>> ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users >>>>> key: aggregate.opendatakit.org:web-service >>>>> at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. >>>>> getEntity(DatastoreImpl.java:763) >>>>> ... 36 more >>>>> >>>>> >>>>> testGetTable(org.opendatakit.aggregate.odktables.TableManagerTest) >>>>> Time elapsed: 0.051 sec <>>>> org.opendatakit.common.persistence.exception. >>>>> ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users >>>>> key: aggregate.opendatakit.org:web-service >>>>> at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. >>>>> getEntity(DatastoreImpl.java:768) >>>>> at org.opendatakit.common.security.spring.RegisteredUsersTable. >>>>> getUserByUri(RegisteredUsersTable.java:289) >>>>> at org.opendatakit.aggregate.odktables.relation.EntityCreator. >>>>> newTableDefinitionEntity(EntityCreator.java:172) >>>>> at org.opendatakit.aggregate.odktables.TableManager.createTable( >>>>> TableManager.java:458) >>>>> at org.opendatakit.aggregate.odktables.TableManagerTest.testGetTable( >>>>> TableManagerTest.java:179) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke( >>>>> NativeMethodAccessorImpl.java:62) >>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke( >>>>> DelegatingMethodAccessorImpl.java:43) >>>>> at java.lang.reflect.Method.invoke(Method.java:498) >>>>> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( >>>>> FrameworkMethod.java:50) >>>>> at org.junit.internal.runners.model.ReflectiveCallable.run( >>>>> ReflectiveCallable.java:12) >>>>> at org.junit.runners.model.FrameworkMethod.invokeExplosively( >>>>> FrameworkMethod.java:47) >>>>> at org.junit.internal.runners.statements.InvokeMethod.evaluate( >>>>> InvokeMethod.java:17) >>>>> at org.junit.internal.runners.statements.RunBefores.evaluate( >>>>> RunBefores.java:26) >>>>> at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters >>>>> .java:27) >>>>> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) >>>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild( >>>>> BlockJUnit4ClassRunner.java:78) >>>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild( >>>>> BlockJUnit4ClassRunner.java:57) >>>>> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) >>>>> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) >>>>> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) >>>>> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) >>>>> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) >>>>> at org.junit.runners.ParentRunner.run(ParentRunner.java:363) >>>>> at org.apache.maven.surefire.junit4.JUnit4Provider.execute( >>>>> JUnit4Provider.java:252) >>>>> at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet( >>>>> JUnit4Provider.java:141) >>>>> at org.apache.maven.surefire.junit4.JUnit4Provider.invoke( >>>>> JUnit4Provider.java:112) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke( >>>>> NativeMethodAccessorImpl.java:62) >>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke( >>>>> DelegatingMethodAccessorImpl.java:43) >>>>> at java.lang.reflect.Method.invoke(Method.java:498) >>>>> at org.apache.maven.surefire.util.ReflectionUtils. >>>>> invokeMethodWithArray(ReflectionUtils.java:189) >>>>> at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy. >>>>> invoke(ProviderFactory.java:165) >>>>> at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider( >>>>> ProviderFactory.java:85) >>>>> at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess( >>>>> ForkedBooter.java:115) >>>>> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter. >>>>> java:75) >>>>> Caused by: org.opendatakit.common.persistence.exception. >>>>> ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users >>>>> key: aggregate.opendatakit.org:web- >>>>> service >>>>> at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. >>>>> getEntity(DatastoreImpl.java:763) >>>>> ... 35 more >>>>> >>>>> >>>>> testCreateTable(org.opendatakit.aggregate.odktables.TableManagerTest) >>>>> Time elapsed: 0.057 sec <>>>> org.opendatakit.common.persistence.exception. >>>>> ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users >>>>> key: aggregate.opendatakit.org:web-service >>>>> at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. >>>>> getEntity(DatastoreImpl.java:768) >>>>> at org.opendatakit.common.security.spring.RegisteredUsersTable. >>>>> getUserByUri(RegisteredUsersTable.java:289) >>>>> at org.opendatakit.aggregate.odktables.relation.EntityCreator. >>>>> newTableDefinitionEntity(EntityCreator.java:172) >>>>> at org.opendatakit.aggregate.odktables.TableManager.createTable( >>>>> TableManager.java:458) >>>>> at org.opendatakit.aggregate.odktables.TableManagerTest. >>>>> testCreateTable(TableManagerTest.java:130) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke( >>>>> NativeMethodAccessorImpl.java:62) >>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke( >>>>> DelegatingMethodAccessorImpl.java:43) >>>>> at java.lang.reflect.Method.invoke(Method.java:498) >>>>> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( >>>>> FrameworkMethod.java:50) >>>>> at org.junit.internal.runners.model.ReflectiveCallable.run( >>>>> ReflectiveCallable.java:12) >>>>> at org.junit.runners.model.FrameworkMethod.invokeExplosively( >>>>> FrameworkMethod.java:47) >>>>> at org.junit.internal.runners.statements.InvokeMethod.evaluate( >>>>> InvokeMethod.java:17) >>>>> at org.junit.internal.runners.statements.RunBefores.evaluate( >>>>> RunBefores.java:26) >>>>> at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters >>>>> .java:27) >>>>> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) >>>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild( >>>>> BlockJUnit4ClassRunner.java:78) >>>>> at org.junit.runners.BlockJUnit4ClassRunner.runChild( >>>>> BlockJUnit4ClassRunner.java:57) >>>>> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) >>>>> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) >>>>> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) >>>>> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) >>>>> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) >>>>> at org.junit.runners.ParentRunner.run(ParentRunner.java:363) >>>>> at org.apache.maven.surefire.junit4.JUnit4Provider.execute( >>>>> JUnit4Provider.java:252) >>>>> at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet( >>>>> JUnit4Provider.java:141) >>>>> at org.apache.maven.surefire.junit4.JUnit4Provider.invoke( >>>>> JUnit4Provider.java:112) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke( >>>>> NativeMethodAccessorImpl.java:62) >>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke( >>>>> DelegatingMethodAccessorImpl.java:43) >>>>> at java.lang.reflect.Method.invoke(Method.java:498) >>>>> at org.apache.maven.surefire.util.ReflectionUtils. >>>>> invokeMethodWithArray(ReflectionUtils.java:189) >>>>> at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy. >>>>> invoke(ProviderFactory.java:165) >>>>> at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider( >>>>> ProviderFactory.java:85) >>>>> at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess( >>>>> ForkedBooter.java:115) >>>>> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter. >>>>> java:75) >>>>> Caused by: org.opendatakit.common.persistence.exception. >>>>> ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users >>>>> key: aggregate.opendatakit.org:web-service >>>>> at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl. >>>>> getEntity(DatastoreImpl.java:763) >>>>> ... 35 more >>>>> >>>>> >>>> -- >>>> Mitch Sundt >>>> Software Engineer >>>> University of Washington >>>> mitche...@gmail.com >>>> >>> >> >> -- >> Mitch Sundt >> Software Engineer >> University of Washington >> mitche...@gmail.com >> > > -- > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com >

I did some more refactoring today, but I still haven’t tracked down the
source of the error. I tried running a single test from the command line
to see if it looks like the Spring context is loaded, and it looks like it
is. Does this log output look reasonable? I truncated it after the first
error. Thanks for any suggestions.

~/pstop/aggregate/aggregate-src$ mvn -Dtest=DataManagerTest test
[INFO] Scanning for projects…
[INFO]

[INFO]

··· ------------------------------------------------------------------------ [INFO] Building Common non-test source files 1.0.1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ aggregate-src --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /home/caden/pstop/aggregate/ aggregate-src/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ aggregate -src --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-compiler-plugin:3.5.1:compile (compile-java-source) @ aggregate-src --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ aggregate-src --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /home/caden/pstop/aggregate/ aggregate-src/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ aggregate-src --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 18 source files to /home/caden/pstop/aggregate/aggregate- src/target/test-classes [INFO] [INFO] --- maven-antrun-plugin:1.8:run (postgresql-setup) @ aggregate-src --- [INFO] Executing tasks

main:
[exec] create database “odk_unit”;
[exec] CREATE DATABASE
[exec] SELECT datname FROM pg_database WHERE datistemplate = false;
[exec] datname
[exec] ----------
[exec] postgres
[exec] odk_unit
[exec] (2 rows)
[exec]
[exec] create user “odk_unit” with unencrypted password ‘odk_unit’;
[exec] CREATE ROLE
[exec] grant all privileges on database “odk_unit” to “odk_unit”;
[exec] GRANT
[exec] alter database “odk_unit” owner to “odk_unit”;
[exec] ALTER DATABASE
[exec] \c “odk_unit”;
[exec] You are now connected to database “odk_unit” as user “postgres”.
[exec] create schema “odk_unit”;
[exec] CREATE SCHEMA
[exec] grant all privileges on schema “odk_unit” to “odk_unit”;
[exec] GRANT
[exec] GRANT SELECT ON ALL TABLES IN SCHEMA PUBLIC TO “odk_unit”;
[exec] GRANT
[INFO] Executed tasks
[INFO]
[INFO] — maven-compiler-plugin:3.5.1:testCompile (compile-test-source) @
aggregate-src —
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 18 source files to /home/caden/pstop/aggregate/aggregate-
src/target/test-classes
[INFO]
[INFO] — maven-surefire-plugin:2.19.1:test (default-test) @ aggregate-src


T E S T S

Running org.opendatakit.aggregate.odktables.DataManagerTest
Feb 14, 2017 10:22:06 PM org.springframework.context.support.
ClassPathXmlApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.
ClassPathXmlApplicationContext@1324409e: startup date [Tue Feb 14 22:22:06
CST 2017]; root of context hierarchy
Feb 14, 2017 10:22:06 PM org.springframework.beans.factory.xml.
XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [odk-settings.
xml]
Feb 14, 2017 10:22:06 PM org.springframework.beans.factory.config.
PropertyPlaceholderConfigurer loadProperties
INFO: Loading properties file from class path resource [jdbc.properties]
Feb 14, 2017 10:22:06 PM org.springframework.beans.factory.config.
PropertyPlaceholderConfigurer loadProperties
INFO: Loading properties file from class path resource [security.properties]
Feb 14, 2017 10:22:06 PM org.springframework.beans.factory.config.
PropertyPlaceholderConfigurer loadProperties
INFO: Loading properties file from class path resource [logging.properties]
Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.Realm
afterPropertiesSet
INFO: Version: v1.4.13 Production
Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.Realm
afterPropertiesSet
INFO: Hostname: localhost
Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.Realm
afterPropertiesSet
INFO: Port: 7070
Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.Realm
afterPropertiesSet
INFO: SecurePort: 7443
Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.Realm
afterPropertiesSet
INFO: SslIsRequired: no
Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.Realm
afterPropertiesSet
INFO: SslIsAvailable: no
Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.Realm
afterPropertiesSet
INFO: RealmString: opendatakit.org RC1 Aggregate 1.0 realm
Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.Realm
afterPropertiesSet
INFO: isGaeEnvironment: no
Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.Realm
afterPropertiesSet
INFO: java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib
:/usr/lib
Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.spring.
UserServiceImpl afterPropertiesSet
INFO: superUserEmail: mailto:mitchellsundt@gmail.com
Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.spring.
UserServiceImpl afterPropertiesSet
INFO: superUserUsername: aggregate
Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.spring.
UserServiceImpl reloadPermissions
INFO: Executing: reloadPermissions
Feb 14, 2017 10:22:06 PM org.springframework.scheduling.concurrent.
ThreadPoolTaskScheduler initialize
INFO: Initializing ExecutorService ‘task_scheduler’
afterPropertiesSet WATCHDOG TASK IN TOMCAT
isAutoStartup WATCHDOG TASK IN TOMCAT
getPhase WATCHDOG TASK IN TOMCAT
Feb 14, 2017 10:22:06 PM org.springframework.context.support.
DefaultLifecycleProcessor start
INFO: Starting beans in phase 10
isRunning WATCHDOG TASK IN TOMCAT
isAutoStartup WATCHDOG TASK IN TOMCAT
start WATCHDOG TASK IN TOMCAT
Feb 14, 2017 10:22:06 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."_server_preferences_properties" (
“_URI” VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT
NULL , “_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “KEY” VARCHAR(128 ) NULL , “VALUE” VARCHAR(
20480 ) NULL )
Feb 14, 2017 10:22:06 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: create table success (before updateRelation):
_server_preferences_properties
Feb 14, 2017 10:22:06 PM org.opendatakit.aggregate.task.tomcat.WatchdogImpl
createWatchdogTask
INFO: Changing WatchdogWorker Executor to 900000ms intervals.
SCHEDULE NEW WATCHDOG TASK IN TOMCAT
RUNNING WATCHDOG TASK IN TOMCAT
Feb 14, 2017 10:22:07 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl
checkTasks
INFO: ---------------------BEGIN Watchdog
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."_backend_actions" ( “_URI”
VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT NULL ,
“_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “LAST_REVISION” TIMESTAMP WITHOUT TIME ZONE
NULL )
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: create table success (before updateRelation): _backend_actions
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."_task_lock" ( “_URI” VARCHAR(80)
UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT NULL ,
“_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “FORM_ID” VARCHAR(4096 ) NOT NULL ,
“TASK_TYPE” VARCHAR(80 ) NOT NULL , “EXPIRATION_DATETIME” TIMESTAMP
WITHOUT TIME ZONE NULL )
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: create table success (before updateRelation): _task_lock
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."_form_service_cursor_2" ( “_URI”
VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT NULL ,
“_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “URI_MD5_FORM_ID” VARCHAR(80) NOT NULL ,
“AURI_SERVICE” VARCHAR(80) NOT NULL , “EXT_SERVICE_TYPE” VARCHAR(200 ) NOT
NULL , “EXTERNAL_SERVICE_OPTION” VARCHAR(80 ) NOT NULL ,
“IS_EXTERNAL_SERVICE_PREPARED” BOOLEAN NULL , “OPERATIONAL_STATUS” VARCHAR(
80 ) NULL , “RETRY_STATUS” VARCHAR(80 ) NULL , “ESTABLISHMENT_DATETIME”
TIMESTAMP WITHOUT TIME ZONE NOT NULL , “UPLOAD_COMPLETED” BOOLEAN NULL ,
“LAST_UPLOAD_PERSISTENCE_CURSOR” TIMESTAMP WITHOUT TIME ZONE NULL ,
“LAST_UPLOAD_KEY” VARCHAR(4096 ) NULL , “LAST_STREAMING_PERSISTENCE_CURSOR”
TIMESTAMP WITHOUT TIME ZONE NULL , “LAST_STREAMING_KEY” VARCHAR(4096 )
NULL , “FORM_ID” VARCHAR(4096 ) NULL )
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: create table success (before updateRelation): _form_service_cursor_2
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."__ODKTABLES__TABLE_ENTRY4" (
“_URI” VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT
NULL , “_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “PENDING_DATA_ETAG” VARCHAR(255 ) NULL ,
“DATA_ETAG” VARCHAR(255 ) NULL , “URI_SCHEMA_TASK” VARCHAR(255 ) NULL ,
“PENDING_SCHEMA_ETAG” VARCHAR(255 ) NULL , “SCHEMA_ETAG” VARCHAR(255 )
NULL , “STALE_SCHEMA_ETAG” VARCHAR(255 ) NULL ,
“APRIORI_DATA_SEQUENCE_VALUE” VARCHAR(255 ) NOT NULL ,
“TARGET_ROW_BATCH_SIZE” INTEGER NULL )
Feb 14, 2017 10:22:07 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl
checkPersistentResults
INFO: Checking all persistent results
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."_persistent_results" ( “_URI”
VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT NULL ,
“_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “REQUESTING_USER” VARCHAR(255 ) NULL ,
“REQUEST_DATE” TIMESTAMP WITHOUT TIME ZONE NULL , “REQUEST_PARAMETERS”
VARCHAR(8192 ) NULL , “LAST_RETRY_DATE” TIMESTAMP WITHOUT TIME ZONE NULL ,
“ATTEMPT_COUNT” INTEGER NULL , “STATUS” VARCHAR(255 ) NULL , “RESULT_TYPE”
VARCHAR(255 ) NULL , “COMPLETION_DATE” TIMESTAMP WITHOUT TIME ZONE NULL ,
“FORM_ID_KEY” VARCHAR(249 ) NULL , “URI_FILTER_GROUP” VARCHAR(80) NULL )
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: create table success (before updateRelation):
__ODKTABLES__TABLE_ENTRY4
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: create table success (before updateRelation): _persistent_results
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."__ODKTABLES__TABLE_ACL" ( “_URI”
VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT NULL ,
“_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “TABLE_ID” VARCHAR(255 ) NOT NULL ,
“SCOPE_TYPE” VARCHAR(255 ) NOT NULL , “SCOPE_VALUE” VARCHAR(255 ) NULL ,
“ROLE” VARCHAR(255 ) NOT NULL )
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."_persistent_result_file_bin" (
“_URI” VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT
NULL , “_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “_PARENT_AURI” VARCHAR(80) NULL ,
“_ORDINAL_NUMBER” INTEGER NOT NULL , “_TOP_LEVEL_AURI” VARCHAR(80) NULL ,
“UNROOTED_FILE_PATH” VARCHAR(4096 ) NULL , “CONTENT_TYPE” VARCHAR(80 )
NULL , “CONTENT_LENGTH” INTEGER NULL , “CONTENT_HASH” VARCHAR(255 ) NULL
)
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: create table success (before updateRelation): __ODKTABLES__TABLE_ACL
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: create table success (before updateRelation):
_persistent_result_file_bin
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."_persistent_result_file_ref" (
“_URI” VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT
NULL , “_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “_DOM_AURI” VARCHAR(80) NOT NULL , “_SUB_AURI”
VARCHAR(80) NOT NULL , “_TOP_LEVEL_AURI” VARCHAR(80) NULL , “PART” INTEGER
NOT NULL )
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: create table success (before updateRelation):
_persistent_result_file_ref
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."_persistent_result_file_blb" (
“_URI” VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT
NULL , “_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “_TOP_LEVEL_AURI” VARCHAR(80) NULL , “VALUE”
BYTEA NOT NULL )
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."__ODKTABLES__TABLE_DEFINITIONS3"
( “_URI” VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT
NULL , “_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “TABLE_ID” VARCHAR(255 ) NOT NULL ,
“SCHEMA_ETAG” VARCHAR(255 ) NOT NULL , “DB_TABLE_NAME” VARCHAR(255 ) NOT
NULL , “CONNECTED_OFFICE_ID” VARCHAR(255 ) NULL )
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: create table success (before updateRelation):
_persistent_result_file_blb
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: create table success (before updateRelation):
__ODKTABLES__TABLE_DEFINITIONS3
Feb 14, 2017 10:22:07 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl
checkPersistentResults
INFO: Done checking persistent results
Feb 14, 2017 10:22:07 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl
checkMiscTasks
INFO: Checking miscellaneous tasks
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."_misc_tasks" ( “_URI” VARCHAR(80)
UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT NULL ,
“_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “FORM_ID” VARCHAR(249 ) NULL ,
“REQUESTING_USER” VARCHAR(255 ) NULL , “REQUEST_DATE” TIMESTAMP WITHOUT
TIME ZONE NULL , “REQUEST_PARAMETERS” VARCHAR(8192 ) NULL ,
“LAST_ACTIVITY_DATE” TIMESTAMP WITHOUT TIME ZONE NULL , “ATTEMPT_COUNT”
INTEGER NULL , “STATUS” VARCHAR(255 ) NULL , “TASK_TYPE” VARCHAR(255 )
NULL , “COMPLETION_DATE” TIMESTAMP WITHOUT TIME ZONE NULL )
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."_registered_users" ( “_URI”
VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT NULL ,
“_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “LOCAL_USERNAME” VARCHAR(80 ) NULL ,
“OPENID_EMAIL” VARCHAR(80 ) NULL , “FULL_NAME” VARCHAR(255 ) NULL ,
“BASIC_AUTH_PASSWORD” VARCHAR(255 ) NULL , “BASIC_AUTH_SALT” VARCHAR(8 )
NULL , “DIGEST_AUTH_PASSWORD” VARCHAR(255 ) NULL , “IS_REMOVED” BOOLEAN
NOT NULL , “OFFICE_ID” VARCHAR(255 ) NULL )
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: create table success (before updateRelation): _misc_tasks
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: create table success (before updateRelation): _registered_users
Feb 14, 2017 10:22:07 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl
checkMiscTasks
INFO: Done checking miscellaneous tasks
Feb 14, 2017 10:22:07 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl
checkTasks
INFO: ---------------------END Watchdog
EXITING WATCHDOG TASK IN TOMCAT
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key e0c7a1e5-4a3f-4e70-9b43-d02c2409e923 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."__ODKTABLES__COLUMN_DEFINITIONS3"
( “_URI” VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT
NULL , “_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “TABLE_ID” VARCHAR(255 ) NOT NULL ,
“SCHEMA_ETAG” VARCHAR(255 ) NOT NULL , “ELEMENT_KEY” VARCHAR(255 ) NOT
NULL , “ELEMENT_NAME” VARCHAR(255 ) NOT NULL , “ELEMENT_TYPE” VARCHAR(255 )
NULL , “LIST_CHILD_ELEMENT_KEYS” VARCHAR(4096 ) NULL )
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl assertRelation
INFO: create table success (before updateRelation):
__ODKTABLES__COLUMN_DEFINITIONS3
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE “_URI”
= ? with key uuid:36ec3af3-3475-4c17-a1c4-35db98a7dfa2 by user aggregate.
opendatakit.org:web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 2db19936-1df6-420a-a723-736cbd2dc0e3 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 82490789-60b9-4561-a230-902e85665d40 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE “_URI”
= ? with key uuid:449cfabd-7d0a-4d63-a1b8-7a59d2e94691 by user aggregate.
opendatakit.org:web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 449faa29-1bd3-4b11-aef5-bc4edb606223 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key fc02f425-9628-4e36-9747-65b6bc559718 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE “_URI”
= ? with key uuid:750e85a0-2c41-44a9-83f9-bde8ee583c67 by user aggregate.
opendatakit.org:web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key fed2c2eb-9fb4-49f6-a744-137cb6d53090 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 4651995a-97e7-415a-bb40-6e206e9711de by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE “_URI”
= ? with key uuid:53cb30c9-2124-498f-80de-b465e3b204b3 by user aggregate.
opendatakit.org:web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key adcb21d8-e676-4462-86e3-4d3199cf675c by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 30972f56-fe3d-49f2-aaf2-17f0f2bbb5f1 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE “_URI”
= ? with key uuid:52a17d27-461f-4e29-852b-15fa3ed75ce4 by user aggregate.
opendatakit.org:web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 4f0663ce-05c6-4799-bf74-0f37fd892d82 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 0b1679b3-7192-4517-8ff5-ef3017d78a07 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE “_URI”
= ? with key uuid:3415920e-ad48-4364-8d96-3d5d856e5f4a by user aggregate.
opendatakit.org:web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 53673115-86d1-4560-b19f-83a744df9ea4 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key b8747321-1382-4b68-8ee2-ee50591dd66c by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:07 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE “_URI”
= ? with key uuid:5122565a-18fc-4b27-9f5b-1c0ff32a8194 by user aggregate.
opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 78ed91a9-6848-41a9-9013-25410ccd58b4 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 5cbd8d84-1c25-4306-879c-8e60eecf76a7 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE “_URI”
= ? with key uuid:810c5806-7635-4a20-aa3b-02e43f940b17 by user aggregate.
opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key be1f0b2e-6b0a-43a3-a3b6-803380e2bd8f by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 1783eae1-d784-447f-95ab-32cb87da1727 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE “_URI”
= ? with key uuid:ac4d03df-a119-49bc-ac6a-f4553617a162 by user aggregate.
opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 5c5bc9a3-dbf8-4024-ac8f-a4835852172f by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 83c26bd1-7449-474c-ad79-92fb0bcdfab0 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE “_URI”
= ? with key uuid:86db101f-7add-48eb-9e00-daa63b55fe62 by user aggregate.
opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 3d17bb07-32c3-4b8b-8b6d-fea938f17f75 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 1228a17d-3ed1-4a13-b1f2-d58759f337ff by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE “_URI”
= ? with key uuid:1caa7182-c877-47d0-9bb3-b35e15237870 by user aggregate.
opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key e95f0fec-4ac4-4096-912d-dc17fa1fbca8 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 81ca9dfe-20b0-4336-94dc-40537b4ccfef by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE “_URI”
= ? with key uuid:a1350d52-ee87-4fe1-8677-47c8d9cbd4df by user aggregate.
opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key d348a8a0-3720-4823-ae99-a6896bcf0c1a by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 5452b7d2-3098-4a5b-b0b0-348542a389ca by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE “_URI”
= ? with key uuid:c573000f-a2f8-460e-a72e-90d8cb55124f by user aggregate.
opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 9970cdac-6535-4875-95a8-a63e2a871932 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key e2c809b5-2001-4e3f-8e14-9138fc2afd8c by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE “_URI”
= ? with key uuid:c8e94cb7-6aa1-4233-9e03-7dcb9e96347b by user aggregate.
opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key eba8c9da-c8d2-41ac-a25a-9fdba7f45325 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 9a3f224e-7edd-4109-9c42-e9abb9328c18 by user aggregate.opendatakit.org:
web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE “_URI”
= ? with key uuid:1142d551-09a6-4c12-bd4d-f62703e9ae6c by user aggregate.
opendatakit.org:web-service
Feb 14, 2017 10:22:08 PM org.opendatakit.common.persistence.engine.pgres.
DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 831568d3-756a-477d-bf42-d4242a377eb9 by user aggregate.opendatakit.org:
web-service
Tests run: 15, Failures: 0, Errors: 15, Skipped: 0, Time elapsed: 2.109 sec
<<< FAILURE! - in org.opendatakit.aggregate.odktables.DataManagerTest
testDelete2Rows(org.opendatakit.aggregate.odktables.DataManagerTest) Time
elapsed: 1.232 sec <<< ERROR!
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key: aggregate.opendatakit.org
:web-service
at org.opendatakit.aggregate.odktables.DataManagerTest.setUp(
DataManagerTest.java:106)
Caused by: org.opendatakit.common.persistence.exception.
ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users
key: aggregate.opendatakit.org:web-service
at org.opendatakit.aggregate.odktables.DataManagerTest.setUp(
DataManagerTest.java:106)

On Tuesday, February 14, 2017 at 2:17:55 PM UTC-6, C. Howell wrote:

Thanks again!

I’ve updated to Postgres 9.4, and am getting the same error there.
I ran “GRANT SELECT ON ALL TABLES IN SCHEMA PUBLIC TO “odk_unit”;” and
then “GRANT all ON ALL TABLES IN SCHEMA PUBLIC TO “odk_unit”;” and neither
of those fixed the error.
I’m investigating the spring-beans security now.

On Tuesday, February 14, 2017 at 1:36:45 PM UTC-6, Mitch wrote:

And as noted on another thread, you need to be able to access the
information_schema in order for ODK Aggregate to function.
e.g.,

https://github.com/opendatakit/aggregate/blob/master/src/main/java/org/opendatakit/common/persistence/engine/pgres/DatastoreImpl.java#L180

The solution as noted in the other thread is to grant all privileges to
the user for information_schema, or perhaps just usage.

On Tue, Feb 14, 2017 at 11:32 AM, Mitch Sundt mitche...@gmail.com wrote:

The web-service user is the DAEMON_USER (see
https://github.com/opendatakit/aggregate/blob/master/src/main/java/org/opendatakit/common/security/User.java
)

It sounds like the spring beans security initialization is not being
executed.

The user configuration is enforced within the RoleHierarchyImpl object
in its afterPropertiesSet() (bean load) method.

https://github.com/opendatakit/aggregate/blob/master/src/main/java/org/opendatakit/common/security/spring/RoleHierarchyImpl.java#L132

On Tue, Feb 14, 2017 at 10:36 AM, C. Howell ca...@cadenconsulting.com wrote:

Thank you for the suggestions! I am on Postgres 9.2, so I will try and
update that.

On 9.2, I tried running the postgres commands to drop and recreate the
odk_unit table:

sudo -u postgres psql postgres
create database “odk_unit”;
SELECT datname FROM pg_database WHERE datistemplate = false;
create user “odk_unit” with unencrypted password ‘odk_unit’;
grant all privileges on database “odk_unit” to “odk_unit”;
alter database “odk_unit” owner to “odk_unit”;
\c “odk_unit”;
create schema “odk_unit”;
grant all privileges on schema “odk_unit” to “odk_unit”;

and then I ran just the TableManagerTest.testCreateTable JUnit test
from Eclipse. I got the same "
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service" error. Should I be able to run any
of these unit tests independently after recreating the database? I will
try again after updating to Postgres 9.4.

Thanks,

Caden

On Monday, February 13, 2017 at 7:13:39 PM UTC-6, Mitch wrote:

My first thought is that you haven’t run the before and after scripts
to drop and create the database schema so it has cruft in it. If you are
combining the UI test (aggregate-postgres) and the postgres-unit-tests into
one project, note that we expect the database to be dropped and recreated
between those two sets of tests.

If you are using PostgreSQL, be sure you are running at least 9.4.
There are permissions issues with 9.3 and earlier that might cause
problems.

When I just want to build one variant, I edit the top-level pom.xml to
comment out all the modules that I don’t want to build.

The tricky thing with the maven build is the handling of the GWT
compile. When this was first constructed, there was negligible support for
multiple build artifacts within maven. I believe this has now been fleshed
out.

Ideally, the aggregate-src project should build both the GWT artifacts
and the jar.
Then the individual projects can reference those and avoid a recompile
to generate the GWT artifacts.

The unit tests for GAE require a custom context, which is why the UI
and unit tests were split out into separate maven projects (and the others
just followed that model to maintain structural parallelism).

On Mon, Feb 13, 2017 at 2:31 PM, C. Howell ca...@cadenconsulting.com wrote:

Hi ODK Developers,

I’ve done a bunch of Maven refactoring on a fresh copy of ODK we
forked about a week ago. I removed the support for MS SQL and Google App
Engine. The goal is to get the project so you can check it out, run mvn
clean install from the command line, and have a .war file for the Maven
profile you have selected-- MySQL or Postgres. I’m still quite a way off
but you can see the progress at https://github.com/benetech/aggregate.
I’m trying to move code into the standard convention Maven folders.

I’m running into an error on the ODK Tables unit tests. I ran into
this a few times before I started moving the code folders around, but I’m
not sure how I fixed it last time. I am wondering if any of you have seen
it before and if it is a common configuration error. If you have
suggestions for things to try, I’d appreciate it. The non-ODK Tables tests
seem to run fine, then this (it’s a huge error dump, to show all the
"Caused by"s)

I’m just including the one error, but I am getting a large percentage
of ODK Tables unit test failures with the same root cause.

Thanks,

Caden

Feb 13, 2017 3:53:13 PM org.opendatakit.common.persistence.engine.
pgres.DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ?
with key 1663ba78-9eda-401d-970c-8d1eaa99e4dc by user aggregate.
opendatakit.org:web-service
Tests run: 12, Failures: 0, Errors: 6, Skipped: 0, Time elapsed:
0.359 sec <<< FAILURE!
testCreateTableAlreadyExists(org.opendatakit.aggregate.odktables.
TableManagerTest) Time elapsed: 0.05 sec <<< ERROR!
java.lang.Exception: Unexpected exception, expected<org.opendatakit.
aggregate.odktables.exception.TableAlreadyExistsException> but was<
org.opendatakit.common.persistence.exception.
ODKEntityNotFoundException>
at org.junit.internal.runners.statements.ExpectException.evaluate(
ExpectException.java:28)
at org.junit.internal.runners.statements.RunBefores.evaluate(
RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(
RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(
JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(
JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.
invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.
invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.
java:75)
Caused by: org.opendatakit.common.persistence.exception.
ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users
key: aggregate.opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:768)
at org.opendatakit.common.security.spring.RegisteredUsersTable.
getUserByUri(RegisteredUsersTable.java:289)
at org.opendatakit.aggregate.odktables.relation.EntityCreator.
newTableDefinitionEntity(EntityCreator.java:172)
at org.opendatakit.aggregate.odktables.TableManager.createTable(
TableManager.java:458)
at org.opendatakit.aggregate.odktables.TableManagerTest.
testCreateTableAlreadyExists(TableManagerTest.java:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(
ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(
FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
InvokeMethod.java:17)
at org.junit.internal.runners.statements.ExpectException.evaluate(
ExpectException.java:19)
… 23 more
Caused by: org.opendatakit.common.persistence.exception.
ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users
key: aggregate.opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:763)
… 36 more

testGetTable(org.opendatakit.aggregate.odktables.TableManagerTest)
Time elapsed: 0.051 sec <<< ERROR!
org.opendatakit.common.persistence.exception.
ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users
key: aggregate.opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:768)
at org.opendatakit.common.security.spring.RegisteredUsersTable.
getUserByUri(RegisteredUsersTable.java:289)
at org.opendatakit.aggregate.odktables.relation.EntityCreator.
newTableDefinitionEntity(EntityCreator.java:172)
at org.opendatakit.aggregate.odktables.TableManager.createTable(
TableManager.java:458)
at org.opendatakit.aggregate.odktables.TableManagerTest.testGetTable
(TableManagerTest.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(
ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(
FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(
RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(
RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(
JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(
JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.
invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.
invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.
java:75)
Caused by: org.opendatakit.common.persistence.exception.
ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users
key: aggregate.opendatakit.org:web-
service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:763)
… 35 more

testCreateTable(org.opendatakit.aggregate.odktables.TableManagerTest)
Time elapsed: 0.057 sec <<< ERROR!
org.opendatakit.common.persistence.exception.
ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users
key: aggregate.opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:768)
at org.opendatakit.common.security.spring.RegisteredUsersTable.
getUserByUri(RegisteredUsersTable.java:289)
at org.opendatakit.aggregate.odktables.relation.EntityCreator.
newTableDefinitionEntity(EntityCreator.java:172)
at org.opendatakit.aggregate.odktables.TableManager.createTable(
TableManager.java:458)
at org.opendatakit.aggregate.odktables.TableManagerTest.
testCreateTable(TableManagerTest.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(
ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(
FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(
RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(
RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(
JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(
JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.
invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.
invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.
java:75)
Caused by: org.opendatakit.common.persistence.exception.
ODKEntityNotFoundException: Unable to retrieve odk_unit._registered_users
key: aggregate.opendatakit.org:web-service
at org.opendatakit.common.persistence.engine.pgres.DatastoreImpl.
getEntity(DatastoreImpl.java:763)
… 35 more


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


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


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

Still working on this. I’m trying something else; running a single failing
unit test in the updated aggregate project versus the original
OpenDataKit/aggregate, like this:

mvn -Dtest=DataManagerTest#testDelete2Rows test

The output is basically the same until after the lines “Feb 15, 2017
3:25:42 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl checkTasks
INFO: ---------------------END Watchdog”. Here’s a comparison:

Original passing test on ODK Aggregate:

~/pstop/00odk/aggregate/postgres-unit-tests$ mvn
-Dtest=DataManagerTest#testDelete2Rows test

Deleted some output which is similar to the fork

INFO: Done checking miscellaneous tasks
Feb 15, 2017 3:25:42 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl
checkTasks
INFO: ---------------------END Watchdog
EXITING WATCHDOG TASK IN TOMCAT
Feb 15, 2017 3:25:42 PM
org.opendatakit.common.persistence.engine.pgres.DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."__ODKTABLES__TABLE_PEOPLE" (
“_URI” VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT
NULL , “_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “NAME_ELEMENTKEY” VARCHAR(255 ) NULL ,
“AGE_ELEMENTKEY” VARCHAR(255 ) NULL , “WEIGHT_ELEMENTKEY” VARCHAR(255 )
NULL , “_ROW_ETAG” VARCHAR(255 ) NOT NULL , “_DATA_ETAG_AT_MODIFICATION”
VARCHAR(255 ) NOT NULL , “_CREATE_USER” VARCHAR(255 ) NULL ,
“_LAST_UPDATE_USER” VARCHAR(255 ) NULL , “_DELETED” BOOLEAN NOT NULL ,
“_FILTER_TYPE” VARCHAR(10 ) NULL , “_FILTER_VALUE” VARCHAR(50 ) NULL ,
“_FORM_ID” VARCHAR(50 ) NULL , “_LOCALE” VARCHAR(10 ) NULL ,
“_SAVEPOINT_TYPE” VARCHAR(10 ) NULL , “_SAVEPOINT_TIMESTAMP” VARCHAR(40 )
NOT NULL , “_SAVEPOINT_CREATOR” VARCHAR(255 ) NULL )
Feb 15, 2017 3:25:42 PM
org.opendatakit.common.persistence.engine.pgres.DatastoreImpl assertRelation
INFO: create table success (before updateRelation):
__ODKTABLES__TABLE_PEOPLE
Feb 15, 2017 3:25:42 PM
org.opendatakit.common.persistence.engine.pgres.DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."__ODKTABLES__TABLE_PEOPLE_LOG" (
“_URI” VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT
NULL , “_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “NAME_ELEMENTKEY” VARCHAR(255 ) NULL ,
“AGE_ELEMENTKEY” VARCHAR(255 ) NULL , “WEIGHT_ELEMENTKEY” VARCHAR(255 )
NULL , “_ROW_ID” VARCHAR(255 ) NOT NULL , “_SEQUENCE_VALUE” VARCHAR(255 )
NOT NULL , “_PREVIOUS_ROW_ETAG” VARCHAR(255 ) NULL ,
“_DATA_ETAG_AT_MODIFICATION” VARCHAR(255 ) NOT NULL , “_CREATE_USER”
VARCHAR(255 ) NULL , “_LAST_UPDATE_USER” VARCHAR(255 ) NULL , “_DELETED”
BOOLEAN NOT NULL , “_FILTER_TYPE” VARCHAR(10 ) NULL , “_FILTER_VALUE”
VARCHAR(50 ) NULL , “_FORM_ID” VARCHAR(50 ) NULL , “_LOCALE” VARCHAR(10 )
NULL , “_SAVEPOINT_TYPE” VARCHAR(10 ) NULL , “_SAVEPOINT_TIMESTAMP”
VARCHAR(40 ) NOT NULL , “_SAVEPOINT_CREATOR” VARCHAR(255 ) NULL )
Feb 15, 2017 3:25:42 PM
org.opendatakit.common.persistence.engine.pgres.DatastoreImpl assertRelation
INFO: create table success (before updateRelation):
__ODKTABLES__TABLE_PEOPLE_LOG

Output excerpt from failing fork (https://github.com/benetech/aggregate/),
which fails

:~/pstop/aggregate/aggregate-src$ mvn
-Dtest=DataManagerTest#testDelete2Rows test

Deleted some output which is similar to the original

Feb 15, 2017 3:25:32 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl
checkTasks
INFO: ---------------------END Watchdog
EXITING WATCHDOG TASK IN TOMCAT
Feb 15, 2017 3:25:32 PM
org.opendatakit.common.persistence.engine.pgres.DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 6d3d5b5e-43bc-40f6-9d6d-801a83d3c89b by user
aggregate.opendatakit.org:web-service
Feb 15, 2017 3:25:33 PM
org.opendatakit.common.persistence.engine.pgres.DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 15, 2017 3:25:33 PM
org.opendatakit.common.persistence.engine.pgres.DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE
“_URI” = ? with key uuid:bc6802d6-4bb3-4497-890c-feed0bc0882e by user
aggregate.opendatakit.org:web-service
Feb 15, 2017 3:25:33 PM
org.opendatakit.common.persistence.engine.pgres.DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 052c451b-1808-4b5a-8533-ccb050a14bba by user
aggregate.opendatakit.org:web-service
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.096 sec
<<< FAILURE! - in org.opendatakit.aggregate.odktables.DataManagerTest
testDelete2Rows(org.opendatakit.aggregate.odktables.DataManagerTest) Time
elapsed: 0.959 sec <<< ERROR!
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service
at
org.opendatakit.aggregate.odktables.DataManagerTest.setUp(DataManagerTest.java:106)
Caused by:
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service
at
org.opendatakit.aggregate.odktables.DataManagerTest.setUp(DataManagerTest.java:106)

So the failing test starts out skipping some CREATE TABLE attempts. It’s
hard to debug this when I’m not very familiar with the structure of the
project. For example, I tried grep -IR for “TABLE_PEOPLE” and then
“PEOPLE” (case sensitive) to try to find where the tables are defined.
There is no such string in the OpenDataKit/aggregate project. The
database does appear to drop and be recreated successfully before the test
run, so I am still figuring out what is causing the different state to
occur in the two different test runs. Any suggestions for things to try
would be helpful.

Caden

··· On Tuesday, February 14, 2017 at 10:26:23 PM UTC-6, C. Howell wrote: > > > I did some more refactoring today, but I still haven't tracked down the > source of the error. I tried running a single test from the command line > to see if it looks like the Spring context is loaded, and it looks like it > is. Does this log output look reasonable? I truncated it after the first > error. Thanks for any suggestions. > > (deleted very long error dump)

The ODK 2.0 data tables all begin ODKTABLES then,

(1) for user-defined tableIds, these are prepended with TABLE_ + all-caps
tableId and, for the change log of that table, a _LOG is appended to that
name.
This is implemented in

org.opendatakit.aggregate.odktables.relation.RUtil.convertIdentifier(tableId)

and in the internals of the data layer (for prepending ODKTABLES).

(2) for 2.0 system tables, we just prepend ODKTABLES with the intended
table name. The system tables for the ODK 2.0 layer are all defined under:

org.opendatakit.aggregate.odktables.relation

With the DbTable and DbLogTable being the classes that implement the
user-defined tableId tables. The others are the system tables for the 2.0
layer.

The overall layout of Aggregate source is summarized here:

and this might be useful:

··· ====================== For the tests that are failing, the table names and data are defined in:

org.opendatakit.aggregate.odktables.T

under the src/test/java tree.

Note that the tableId defined in that file is lower-case (“people”) but the
RUtil function upper-cases and substitutes to get the database table name.

On Wed, Feb 15, 2017 at 2:06 PM, C. Howell caden@cadenconsulting.com wrote:

Still working on this. I’m trying something else; running a single
failing unit test in the updated aggregate project versus the original
OpenDataKit/aggregate, like this:

mvn -Dtest=DataManagerTest#testDelete2Rows test

The output is basically the same until after the lines “Feb 15, 2017
3:25:42 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl checkTasks
INFO: ---------------------END Watchdog”. Here’s a comparison:

Original passing test on ODK Aggregate:

~/pstop/00odk/aggregate/postgres-unit-tests$ mvn -Dtest=DataManagerTest#testDelete2Rows
test

Deleted some output which is similar to the fork

INFO: Done checking miscellaneous tasks
Feb 15, 2017 3:25:42 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl
checkTasks
INFO: ---------------------END Watchdog
EXITING WATCHDOG TASK IN TOMCAT
Feb 15, 2017 3:25:42 PM org.opendatakit.common.persistence.engine.pgres.DatastoreImpl
assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."__ODKTABLES__TABLE_PEOPLE" (
“_URI” VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT
NULL , “_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “NAME_ELEMENTKEY” VARCHAR(255 ) NULL ,
“AGE_ELEMENTKEY” VARCHAR(255 ) NULL , “WEIGHT_ELEMENTKEY” VARCHAR(255 )
NULL , “_ROW_ETAG” VARCHAR(255 ) NOT NULL , “_DATA_ETAG_AT_MODIFICATION”
VARCHAR(255 ) NOT NULL , “_CREATE_USER” VARCHAR(255 ) NULL ,
“_LAST_UPDATE_USER” VARCHAR(255 ) NULL , “_DELETED” BOOLEAN NOT NULL ,
“_FILTER_TYPE” VARCHAR(10 ) NULL , “_FILTER_VALUE” VARCHAR(50 ) NULL ,
“_FORM_ID” VARCHAR(50 ) NULL , “_LOCALE” VARCHAR(10 ) NULL ,
“_SAVEPOINT_TYPE” VARCHAR(10 ) NULL , “_SAVEPOINT_TIMESTAMP” VARCHAR(40 )
NOT NULL , “_SAVEPOINT_CREATOR” VARCHAR(255 ) NULL )
Feb 15, 2017 3:25:42 PM org.opendatakit.common.persistence.engine.pgres.DatastoreImpl
assertRelation
INFO: create table success (before updateRelation):
__ODKTABLES__TABLE_PEOPLE
Feb 15, 2017 3:25:42 PM org.opendatakit.common.persistence.engine.pgres.DatastoreImpl
assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."__ODKTABLES__TABLE_PEOPLE_LOG"
( “_URI” VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT
NULL , “_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “NAME_ELEMENTKEY” VARCHAR(255 ) NULL ,
“AGE_ELEMENTKEY” VARCHAR(255 ) NULL , “WEIGHT_ELEMENTKEY” VARCHAR(255 )
NULL , “_ROW_ID” VARCHAR(255 ) NOT NULL , “_SEQUENCE_VALUE” VARCHAR(255 )
NOT NULL , “_PREVIOUS_ROW_ETAG” VARCHAR(255 ) NULL ,
“_DATA_ETAG_AT_MODIFICATION” VARCHAR(255 ) NOT NULL , “_CREATE_USER”
VARCHAR(255 ) NULL , “_LAST_UPDATE_USER” VARCHAR(255 ) NULL , “_DELETED”
BOOLEAN NOT NULL , “_FILTER_TYPE” VARCHAR(10 ) NULL , “_FILTER_VALUE”
VARCHAR(50 ) NULL , “_FORM_ID” VARCHAR(50 ) NULL , “_LOCALE” VARCHAR(10 )
NULL , “_SAVEPOINT_TYPE” VARCHAR(10 ) NULL , “_SAVEPOINT_TIMESTAMP”
VARCHAR(40 ) NOT NULL , “_SAVEPOINT_CREATOR” VARCHAR(255 ) NULL )
Feb 15, 2017 3:25:42 PM org.opendatakit.common.persistence.engine.pgres.DatastoreImpl
assertRelation
INFO: create table success (before updateRelation):
__ODKTABLES__TABLE_PEOPLE_LOG

Output excerpt from failing fork (https://github.com/benetech/aggregate/),
which fails

:~/pstop/aggregate/aggregate-src$ mvn -Dtest=DataManagerTest#testDelete2Rows
test

Deleted some output which is similar to the original

Feb 15, 2017 3:25:32 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl
checkTasks
INFO: ---------------------END Watchdog
EXITING WATCHDOG TASK IN TOMCAT
Feb 15, 2017 3:25:32 PM org.opendatakit.common.persistence.engine.pgres.DatastoreImpl
deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 6d3d5b5e-43bc-40f6-9d6d-801a83d3c89b by user
aggregate.opendatakit.org:web-service
Feb 15, 2017 3:25:33 PM org.opendatakit.common.persistence.engine.pgres.DatastoreImpl
deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 15, 2017 3:25:33 PM org.opendatakit.common.persistence.engine.pgres.DatastoreImpl
deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE
“_URI” = ? with key uuid:bc6802d6-4bb3-4497-890c-feed0bc0882e by user
aggregate.opendatakit.org:web-service
Feb 15, 2017 3:25:33 PM org.opendatakit.common.persistence.engine.pgres.DatastoreImpl
deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 052c451b-1808-4b5a-8533-ccb050a14bba by user
aggregate.opendatakit.org:web-service
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.096 sec
<<< FAILURE! - in org.opendatakit.aggregate.odktables.DataManagerTest
testDelete2Rows(org.opendatakit.aggregate.odktables.DataManagerTest)
Time elapsed: 0.959 sec <<< ERROR!
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service
at org.opendatakit.aggregate.odktables.DataManagerTest.
setUp(DataManagerTest.java:106)
Caused by: org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service
at org.opendatakit.aggregate.odktables.DataManagerTest.
setUp(DataManagerTest.java:106)

So the failing test starts out skipping some CREATE TABLE attempts. It’s
hard to debug this when I’m not very familiar with the structure of the
project. For example, I tried grep -IR for “TABLE_PEOPLE” and then
“PEOPLE” (case sensitive) to try to find where the tables are defined.
There is no such string in the OpenDataKit/aggregate project. The database
does appear to drop and be recreated successfully before the test run, so I
am still figuring out what is causing the different state to occur in the
two different test runs. Any suggestions for things to try would be
helpful.

Caden

On Tuesday, February 14, 2017 at 10:26:23 PM UTC-6, C. Howell wrote:

I did some more refactoring today, but I still haven’t tracked down the
source of the error. I tried running a single test from the command line
to see if it looks like the Spring context is loaded, and it looks like it
is. Does this log output look reasonable? I truncated it after the first
error. Thanks for any suggestions.

(deleted very long error dump)


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

the general interaction with the datastore layer is to:

(1) first assert that the relation exists (which will create table or
verify via information_schema that the table exists).
This caches a relation prototype into a static member variable. It also
pulls in things like the allocated size of the string, the precision of the
decimal, etc.

(2) then all operations use the relation prototype either to model what
fields are selected out of the relation or to model what fields are
inserted or updateable in the relation. This allows additional columns to
exist and allows database admins to manually alter table with ODK Aggregate
picking up those changes upon restart.

··· ---------------------------- These lines indicate that initialization should be all OK:

Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.spring.
UserServiceImpl afterPropertiesSet
INFO: superUserUsername: aggregate
Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.spring.
UserServiceImpl reloadPermissions
INFO: Executing: reloadPermissions

It looks like the:

@Before
public void setUp() throws Exception {…}

is not being performed.

Is something wrong or different with the JUnit code?

Seems to not recognize this annotation.

On Thu, Feb 16, 2017 at 10:22 AM, Mitch Sundt mitchellsundt@gmail.com wrote:

The ODK 2.0 data tables all begin ODKTABLES then,

(1) for user-defined tableIds, these are prepended with TABLE_ + all-caps
tableId and, for the change log of that table, a _LOG is appended to that
name.
This is implemented in

org.opendatakit.aggregate.odktables.relation.RUtil.
convertIdentifier(tableId)

and in the internals of the data layer (for prepending ODKTABLES).

(2) for 2.0 system tables, we just prepend ODKTABLES with the intended
table name. The system tables for the ODK 2.0 layer are all defined under:

org.opendatakit.aggregate.odktables.relation

With the DbTable and DbLogTable being the classes that implement the
user-defined tableId tables. The others are the system tables for the 2.0
layer.

The overall layout of Aggregate source is summarized here:

https://github.com/opendatakit/opendatakit/wiki/

Aggregate-Source-Code-Overview

and this might be useful:

https://github.com/opendatakit/opendatakit/wiki/

Aggregate-Database-Structure

======================
For the tests that are failing, the table names and data are defined in:

org.opendatakit.aggregate.odktables.T

under the src/test/java tree.

Note that the tableId defined in that file is lower-case (“people”) but
the RUtil function upper-cases and substitutes to get the database table
name.

On Wed, Feb 15, 2017 at 2:06 PM, C. Howell caden@cadenconsulting.com wrote:

Still working on this. I’m trying something else; running a single
failing unit test in the updated aggregate project versus the original
OpenDataKit/aggregate, like this:

mvn -Dtest=DataManagerTest#testDelete2Rows test

The output is basically the same until after the lines “Feb 15, 2017
3:25:42 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl checkTasks
INFO: ---------------------END Watchdog”. Here’s a comparison:

Original passing test on ODK Aggregate:

~/pstop/00odk/aggregate/postgres-unit-tests$ mvn
-Dtest=DataManagerTest#testDelete2Rows test

Deleted some output which is similar to the fork

INFO: Done checking miscellaneous tasks
Feb 15, 2017 3:25:42 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl
checkTasks
INFO: ---------------------END Watchdog
EXITING WATCHDOG TASK IN TOMCAT
Feb 15, 2017 3:25:42 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."__ODKTABLES__TABLE_PEOPLE" (
“_URI” VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT
NULL , “_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “NAME_ELEMENTKEY” VARCHAR(255 ) NULL ,
“AGE_ELEMENTKEY” VARCHAR(255 ) NULL , “WEIGHT_ELEMENTKEY” VARCHAR(255 )
NULL , “_ROW_ETAG” VARCHAR(255 ) NOT NULL , “_DATA_ETAG_AT_MODIFICATION”
VARCHAR(255 ) NOT NULL , “_CREATE_USER” VARCHAR(255 ) NULL ,
“_LAST_UPDATE_USER” VARCHAR(255 ) NULL , “_DELETED” BOOLEAN NOT NULL ,
“_FILTER_TYPE” VARCHAR(10 ) NULL , “_FILTER_VALUE” VARCHAR(50 ) NULL ,
“_FORM_ID” VARCHAR(50 ) NULL , “_LOCALE” VARCHAR(10 ) NULL ,
“_SAVEPOINT_TYPE” VARCHAR(10 ) NULL , “_SAVEPOINT_TIMESTAMP” VARCHAR(40 )
NOT NULL , “_SAVEPOINT_CREATOR” VARCHAR(255 ) NULL )
Feb 15, 2017 3:25:42 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl assertRelation
INFO: create table success (before updateRelation):
__ODKTABLES__TABLE_PEOPLE
Feb 15, 2017 3:25:42 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."__ODKTABLES__TABLE_PEOPLE_LOG"
( “_URI” VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT
NULL , “_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “NAME_ELEMENTKEY” VARCHAR(255 ) NULL ,
“AGE_ELEMENTKEY” VARCHAR(255 ) NULL , “WEIGHT_ELEMENTKEY” VARCHAR(255 )
NULL , “_ROW_ID” VARCHAR(255 ) NOT NULL , “_SEQUENCE_VALUE” VARCHAR(255 )
NOT NULL , “_PREVIOUS_ROW_ETAG” VARCHAR(255 ) NULL ,
“_DATA_ETAG_AT_MODIFICATION” VARCHAR(255 ) NOT NULL , “_CREATE_USER”
VARCHAR(255 ) NULL , “_LAST_UPDATE_USER” VARCHAR(255 ) NULL , “_DELETED”
BOOLEAN NOT NULL , “_FILTER_TYPE” VARCHAR(10 ) NULL , “_FILTER_VALUE”
VARCHAR(50 ) NULL , “_FORM_ID” VARCHAR(50 ) NULL , “_LOCALE” VARCHAR(10 )
NULL , “_SAVEPOINT_TYPE” VARCHAR(10 ) NULL , “_SAVEPOINT_TIMESTAMP”
VARCHAR(40 ) NOT NULL , “_SAVEPOINT_CREATOR” VARCHAR(255 ) NULL )
Feb 15, 2017 3:25:42 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl assertRelation
INFO: create table success (before updateRelation):
__ODKTABLES__TABLE_PEOPLE_LOG

Output excerpt from failing fork (https://github.com/benetech/aggregate/),
which fails

:~/pstop/aggregate/aggregate-src$ mvn -Dtest=DataManagerTest#testDelete2Rows
test

Deleted some output which is similar to the original

Feb 15, 2017 3:25:32 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl
checkTasks
INFO: ---------------------END Watchdog
EXITING WATCHDOG TASK IN TOMCAT
Feb 15, 2017 3:25:32 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 6d3d5b5e-43bc-40f6-9d6d-801a83d3c89b by user
aggregate.opendatakit.org:web-service
Feb 15, 2017 3:25:33 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4" WHERE
“_URI” = ? with key people by user aggregate.opendatakit.org:web-service
Feb 15, 2017 3:25:33 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE
“_URI” = ? with key uuid:bc6802d6-4bb3-4497-890c-feed0bc0882e by user
aggregate.opendatakit.org:web-service
Feb 15, 2017 3:25:33 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ? with
key 052c451b-1808-4b5a-8533-ccb050a14bba by user
aggregate.opendatakit.org:web-service
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.096 sec
<<< FAILURE! - in org.opendatakit.aggregate.odktables.DataManagerTest
testDelete2Rows(org.opendatakit.aggregate.odktables.DataManagerTest)
Time elapsed: 0.959 sec <<< ERROR!
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service
at org.opendatakit.aggregate.odktables.DataManagerTest.setUp(
DataManagerTest.java:106)
Caused by: org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service
at org.opendatakit.aggregate.odktables.DataManagerTest.setUp(
DataManagerTest.java:106)

So the failing test starts out skipping some CREATE TABLE attempts. It’s
hard to debug this when I’m not very familiar with the structure of the
project. For example, I tried grep -IR for “TABLE_PEOPLE” and then
“PEOPLE” (case sensitive) to try to find where the tables are defined.
There is no such string in the OpenDataKit/aggregate project. The database
does appear to drop and be recreated successfully before the test run, so I
am still figuring out what is causing the different state to occur in the
two different test runs. Any suggestions for things to try would be
helpful.

Caden

On Tuesday, February 14, 2017 at 10:26:23 PM UTC-6, C. Howell wrote:

I did some more refactoring today, but I still haven’t tracked down the
source of the error. I tried running a single test from the command line
to see if it looks like the Spring context is loaded, and it looks like it
is. Does this log output look reasonable? I truncated it after the first
error. Thanks for any suggestions.

(deleted very long error dump)


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 Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Hi Mitch,

I finally tracked it down. Your assistance and explaining the general
logical flow has been invaluable. I added some log statements to the
setUp() method to confirm it was being executed, and when I found it was at
least being executed, I dug into the calls more to see what was being
missed.

I have been merging a version of ODK that was forked last October by
another team we’re working with, and I tracked the problem to this commit
from that fork:

That commit added a call to the _registered_users table which isn’t being
created in the unit tests. (To confirm this, I ran the working unit test
and my non-working unit test and dumped the two postgres schemas, and the
working ODK test did not have a _registered_users table.) The other team
has refactored this file and removed this call to the _registered_users
table in a commit I pulled in yesterday (just when I was about to push them
my fix) so it is fixed now. I am happy to have working unit tests again!

Thank you,

Caden

··· On Thursday, February 16, 2017 at 12:34:30 PM UTC-6, Mitch wrote: > > the general interaction with the datastore layer is to: > > (1) first assert that the relation exists (which will create table or > verify via information_schema that the table exists). > This caches a relation prototype into a static member variable. It also > pulls in things like the allocated size of the string, the precision of the > decimal, etc. > > (2) then all operations use the relation prototype either to model what > fields are selected out of the relation or to model what fields are > inserted or updateable in the relation. This allows additional columns to > exist and allows database admins to manually alter table with ODK Aggregate > picking up those changes upon restart. > > ---------------------------- > These lines indicate that initialization should be all OK: > > Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.spring. > UserServiceImpl afterPropertiesSet > INFO: superUserUsername: aggregate > Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.spring. > UserServiceImpl reloadPermissions > INFO: Executing: reloadPermissions > > It looks like the: > > @Before > public void setUp() throws Exception {...} > > is not being performed. > > Is something wrong or different with the JUnit code? > > Seems to not recognize this annotation. > > > On Thu, Feb 16, 2017 at 10:22 AM, Mitch Sundt <mitche...@gmail.com > wrote: > >> The ODK 2.0 data tables all begin __ODKTABLES__ then, >> >> (1) for user-defined tableIds, these are prepended with TABLE_ + all-caps >> tableId and, for the change log of that table, a _LOG is appended to that >> name. >> This is implemented in >> >> >> org.opendatakit.aggregate.odktables.relation.RUtil.convertIdentifier(tableId) >> >> and in the internals of the data layer (for prepending __ODKTABLES__). >> >> (2) for 2.0 system tables, we just prepend __ODKTABLES__ with the >> intended table name. The system tables for the ODK 2.0 layer are all >> defined under: >> >> org.opendatakit.aggregate.odktables.relation >> >> With the DbTable and DbLogTable being the classes that implement the >> user-defined tableId tables. The others are the system tables for the 2.0 >> layer. >> >> The overall layout of Aggregate source is summarized here: >> >> >> https://github.com/opendatakit/opendatakit/wiki/Aggregate-Source-Code-Overview >> >> and this might be useful: >> >> >> https://github.com/opendatakit/opendatakit/wiki/Aggregate-Database-Structure >> >> ====================== >> For the tests that are failing, the table names and data are defined in: >> >> org.opendatakit.aggregate.odktables.T >> >> under the src/test/java tree. >> >> Note that the tableId defined in that file is lower-case ("people") but >> the RUtil function upper-cases and substitutes to get the database table >> name. >> >> >> >> >> >> >> >> On Wed, Feb 15, 2017 at 2:06 PM, C. Howell <ca...@cadenconsulting.com > wrote: >> >>> >>> Still working on this. I'm trying something else; running a single >>> failing unit test in the updated aggregate project versus the original >>> OpenDataKit/aggregate, like this: >>> >>> mvn -Dtest=DataManagerTest#testDelete2Rows test >>> >>> The output is basically the same until after the lines "Feb 15, 2017 >>> 3:25:42 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl checkTasks >>> INFO: ---------------------END Watchdog". Here's a comparison: >>> >>> Original passing test on ODK Aggregate: >>> >>> >>> ~/pstop/00odk/aggregate/postgres-unit-tests$ mvn >>> -Dtest=DataManagerTest#testDelete2Rows test >>> ## Deleted some output which is similar to the fork >>> INFO: Done checking miscellaneous tasks >>> Feb 15, 2017 3:25:42 PM >>> org.opendatakit.aggregate.task.WatchdogWorkerImpl checkTasks >>> INFO: ---------------------END Watchdog >>> EXITING WATCHDOG TASK IN TOMCAT >>> Feb 15, 2017 3:25:42 PM >>> org.opendatakit.common.persistence.engine.pgres.DatastoreImpl assertRelation >>> INFO: Attempting: CREATE TABLE "odk_unit"."__ODKTABLES__TABLE_PEOPLE" ( >>> "_URI" VARCHAR(80) UNIQUE NOT NULL , "_CREATOR_URI_USER" VARCHAR(80) NOT >>> NULL , "_CREATION_DATE" TIMESTAMP WITHOUT TIME ZONE NOT NULL , >>> "_LAST_UPDATE_URI_USER" VARCHAR(80) NULL , "_LAST_UPDATE_DATE" TIMESTAMP >>> WITHOUT TIME ZONE NOT NULL , "NAME_ELEMENTKEY" VARCHAR(255 ) NULL , >>> "AGE_ELEMENTKEY" VARCHAR(255 ) NULL , "WEIGHT_ELEMENTKEY" VARCHAR(255 ) >>> NULL , "_ROW_ETAG" VARCHAR(255 ) NOT NULL , "_DATA_ETAG_AT_MODIFICATION" >>> VARCHAR(255 ) NOT NULL , "_CREATE_USER" VARCHAR(255 ) NULL , >>> "_LAST_UPDATE_USER" VARCHAR(255 ) NULL , "_DELETED" BOOLEAN NOT NULL , >>> "_FILTER_TYPE" VARCHAR(10 ) NULL , "_FILTER_VALUE" VARCHAR(50 ) NULL , >>> "_FORM_ID" VARCHAR(50 ) NULL , "_LOCALE" VARCHAR(10 ) NULL , >>> "_SAVEPOINT_TYPE" VARCHAR(10 ) NULL , "_SAVEPOINT_TIMESTAMP" VARCHAR(40 ) >>> NOT NULL , "_SAVEPOINT_CREATOR" VARCHAR(255 ) NULL ) >>> Feb 15, 2017 3:25:42 PM >>> org.opendatakit.common.persistence.engine.pgres.DatastoreImpl assertRelation >>> INFO: create table success (before updateRelation): >>> __ODKTABLES__TABLE_PEOPLE >>> Feb 15, 2017 3:25:42 PM >>> org.opendatakit.common.persistence.engine.pgres.DatastoreImpl assertRelation >>> INFO: Attempting: CREATE TABLE >>> "odk_unit"."__ODKTABLES__TABLE_PEOPLE_LOG" ( "_URI" VARCHAR(80) UNIQUE NOT >>> NULL , "_CREATOR_URI_USER" VARCHAR(80) NOT NULL , "_CREATION_DATE" >>> TIMESTAMP WITHOUT TIME ZONE NOT NULL , "_LAST_UPDATE_URI_USER" VARCHAR(80) >>> NULL , "_LAST_UPDATE_DATE" TIMESTAMP WITHOUT TIME ZONE NOT NULL , >>> "NAME_ELEMENTKEY" VARCHAR(255 ) NULL , "AGE_ELEMENTKEY" VARCHAR(255 ) >>> NULL , "WEIGHT_ELEMENTKEY" VARCHAR(255 ) NULL , "_ROW_ID" VARCHAR(255 ) >>> NOT NULL , "_SEQUENCE_VALUE" VARCHAR(255 ) NOT NULL , >>> "_PREVIOUS_ROW_ETAG" VARCHAR(255 ) NULL , "_DATA_ETAG_AT_MODIFICATION" >>> VARCHAR(255 ) NOT NULL , "_CREATE_USER" VARCHAR(255 ) NULL , >>> "_LAST_UPDATE_USER" VARCHAR(255 ) NULL , "_DELETED" BOOLEAN NOT NULL , >>> "_FILTER_TYPE" VARCHAR(10 ) NULL , "_FILTER_VALUE" VARCHAR(50 ) NULL , >>> "_FORM_ID" VARCHAR(50 ) NULL , "_LOCALE" VARCHAR(10 ) NULL , >>> "_SAVEPOINT_TYPE" VARCHAR(10 ) NULL , "_SAVEPOINT_TIMESTAMP" VARCHAR(40 ) >>> NOT NULL , "_SAVEPOINT_CREATOR" VARCHAR(255 ) NULL ) >>> Feb 15, 2017 3:25:42 PM >>> org.opendatakit.common.persistence.engine.pgres.DatastoreImpl assertRelation >>> INFO: create table success (before updateRelation): >>> __ODKTABLES__TABLE_PEOPLE_LOG >>> >>> Output excerpt from failing fork (https://github.com/benetech/aggregate/), >>> which fails >>> >>> :~/pstop/aggregate/aggregate-src$ mvn >>> -Dtest=DataManagerTest#testDelete2Rows test >>> ## Deleted some output which is similar to the original >>> Feb 15, 2017 3:25:32 PM >>> org.opendatakit.aggregate.task.WatchdogWorkerImpl checkTasks >>> INFO: ---------------------END Watchdog >>> EXITING WATCHDOG TASK IN TOMCAT >>> Feb 15, 2017 3:25:32 PM >>> org.opendatakit.common.persistence.engine.pgres.DatastoreImpl deleteEntity >>> INFO: Executing DELETE FROM "odk_unit"."_task_lock" WHERE "_URI" = ? >>> with key 6d3d5b5e-43bc-40f6-9d6d-801a83d3c89b by user >>> aggregate.opendatakit.org:web-service >>> Feb 15, 2017 3:25:33 PM >>> org.opendatakit.common.persistence.engine.pgres.DatastoreImpl deleteEntity >>> INFO: Executing DELETE FROM "odk_unit"."__ODKTABLES__TABLE_ENTRY4" WHERE >>> "_URI" = ? with key people by user aggregate.opendatakit.org:web-service >>> Feb 15, 2017 3:25:33 PM >>> org.opendatakit.common.persistence.engine.pgres.DatastoreImpl deleteEntity >>> INFO: Executing DELETE FROM "odk_unit"."__ODKTABLES__TABLE_ACL" WHERE >>> "_URI" = ? with key uuid:bc6802d6-4bb3-4497-890c-feed0bc0882e by user >>> aggregate.opendatakit.org:web-service >>> Feb 15, 2017 3:25:33 PM >>> org.opendatakit.common.persistence.engine.pgres.DatastoreImpl deleteEntity >>> INFO: Executing DELETE FROM "odk_unit"."_task_lock" WHERE "_URI" = ? >>> with key 052c451b-1808-4b5a-8533-ccb050a14bba by user >>> aggregate.opendatakit.org:web-service >>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.096 >>> sec <>> testDelete2Rows(org.opendatakit.aggregate.odktables.DataManagerTest) >>> Time elapsed: 0.959 sec <>> org.opendatakit.common.persistence.exception.ODKEntityNotFoundException: >>> Unable to retrieve odk_unit._registered_users key: >>> aggregate.opendatakit.org:web-service >>> at >>> org.opendatakit.aggregate.odktables.DataManagerTest.setUp(DataManagerTest.java:106) >>> Caused by: >>> org.opendatakit.common.persistence.exception.ODKEntityNotFoundException: >>> Unable to retrieve odk_unit._registered_users key: >>> aggregate.opendatakit.org:web-service >>> at >>> org.opendatakit.aggregate.odktables.DataManagerTest.setUp(DataManagerTest.java:106) >>> >>> >>> So the failing test starts out skipping some CREATE TABLE attempts. >>> It's hard to debug this when I'm not very familiar with the structure of >>> the project. For example, I tried grep -IR for "TABLE_PEOPLE" and then >>> "PEOPLE" (case sensitive) to try to find where the tables are defined. >>> There is no such string in the OpenDataKit/aggregate project. The database >>> does appear to drop and be recreated successfully before the test run, so I >>> am still figuring out what is causing the different state to occur in the >>> two different test runs. Any suggestions for things to try would be >>> helpful. >>> >>> Caden >>> >>> >>> ... >>> >>> >>> >>> >>> On Tuesday, February 14, 2017 at 10:26:23 PM UTC-6, C. Howell wrote: >>>> >>>> >>>> I did some more refactoring today, but I still haven't tracked down the >>>> source of the error. I tried running a single test from the command line >>>> to see if it looks like the Spring context is loaded, and it looks like it >>>> is. Does this log output look reasonable? I truncated it after the first >>>> error. Thanks for any suggestions. >>>> >>>> (deleted very long error dump) >>> >>>> >>>> ... >>> >>> -- >>> 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 >> > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com >

Glad you figured it out.

Note that I just pushed some changes to the uiexperiment branch (which is
the unstable dev branch for aggregate; master is stable except during final
QA/release, and v1_4 is firmly stable).

··· On Thu, Feb 16, 2017 at 3:01 PM, C. Howell wrote:

Hi Mitch,

I finally tracked it down. Your assistance and explaining the general
logical flow has been invaluable. I added some log statements to the
setUp() method to confirm it was being executed, and when I found it was at
least being executed, I dug into the calls more to see what was being
missed.

I have been merging a version of ODK that was forked last October by
another team we’re working with, and I tracked the problem to this commit
from that fork:

https://github.com/benetech/aggregate/commit/
d8a9216da7bd2a36026d180b1ca9ae30145d2210#diff-
39bb53663da486a833e92646088dc1d4

That commit added a call to the _registered_users table which isn’t being
created in the unit tests. (To confirm this, I ran the working unit test
and my non-working unit test and dumped the two postgres schemas, and the
working ODK test did not have a _registered_users table.) The other team
has refactored this file and removed this call to the _registered_users
table in a commit I pulled in yesterday (just when I was about to push them
my fix) so it is fixed now. I am happy to have working unit tests again!

Thank you,

Caden

On Thursday, February 16, 2017 at 12:34:30 PM UTC-6, Mitch wrote:

the general interaction with the datastore layer is to:

(1) first assert that the relation exists (which will create table or
verify via information_schema that the table exists).
This caches a relation prototype into a static member variable. It also
pulls in things like the allocated size of the string, the precision of the
decimal, etc.

(2) then all operations use the relation prototype either to model what
fields are selected out of the relation or to model what fields are
inserted or updateable in the relation. This allows additional columns to
exist and allows database admins to manually alter table with ODK Aggregate
picking up those changes upon restart.


These lines indicate that initialization should be all OK:

Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.spring.
UserServiceImpl afterPropertiesSet
INFO: superUserUsername: aggregate
Feb 14, 2017 10:22:06 PM org.opendatakit.common.security.spring.
UserServiceImpl reloadPermissions
INFO: Executing: reloadPermissions

It looks like the:

@Before
public void setUp() throws Exception {…}

is not being performed.

Is something wrong or different with the JUnit code?

Seems to not recognize this annotation.

On Thu, Feb 16, 2017 at 10:22 AM, Mitch Sundt mitche...@gmail.com wrote:

The ODK 2.0 data tables all begin ODKTABLES then,

(1) for user-defined tableIds, these are prepended with TABLE_ +
all-caps tableId and, for the change log of that table, a _LOG is appended
to that name.
This is implemented in

org.opendatakit.aggregate.odktables.relation.RUtil.convertI
dentifier(tableId)

and in the internals of the data layer (for prepending ODKTABLES).

(2) for 2.0 system tables, we just prepend ODKTABLES with the
intended table name. The system tables for the ODK 2.0 layer are all
defined under:

org.opendatakit.aggregate.odktables.relation

With the DbTable and DbLogTable being the classes that implement the
user-defined tableId tables. The others are the system tables for the 2.0
layer.

The overall layout of Aggregate source is summarized here:

https://github.com/opendatakit/opendatakit/wiki/Aggregate-

Source-Code-Overview

and this might be useful:

https://github.com/opendatakit/opendatakit/wiki/Aggregate-

Database-Structure

======================
For the tests that are failing, the table names and data are defined in:

org.opendatakit.aggregate.odktables.T

under the src/test/java tree.

Note that the tableId defined in that file is lower-case (“people”) but
the RUtil function upper-cases and substitutes to get the database table
name.

On Wed, Feb 15, 2017 at 2:06 PM, C. Howell ca...@cadenconsulting.com wrote:

Still working on this. I’m trying something else; running a single
failing unit test in the updated aggregate project versus the original
OpenDataKit/aggregate, like this:

mvn -Dtest=DataManagerTest#testDelete2Rows test

The output is basically the same until after the lines “Feb 15, 2017
3:25:42 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl checkTasks
INFO: ---------------------END Watchdog”. Here’s a comparison:

Original passing test on ODK Aggregate:

~/pstop/00odk/aggregate/postgres-unit-tests$ mvn
-Dtest=DataManagerTest#testDelete2Rows test

Deleted some output which is similar to the fork

INFO: Done checking miscellaneous tasks
Feb 15, 2017 3:25:42 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl
checkTasks
INFO: ---------------------END Watchdog
EXITING WATCHDOG TASK IN TOMCAT
Feb 15, 2017 3:25:42 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."__ODKTABLES__TABLE_PEOPLE"
( “_URI” VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT
NULL , “_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “NAME_ELEMENTKEY” VARCHAR(255 ) NULL ,
“AGE_ELEMENTKEY” VARCHAR(255 ) NULL , “WEIGHT_ELEMENTKEY” VARCHAR(255 )
NULL , “_ROW_ETAG” VARCHAR(255 ) NOT NULL , “_DATA_ETAG_AT_MODIFICATION”
VARCHAR(255 ) NOT NULL , “_CREATE_USER” VARCHAR(255 ) NULL ,
“_LAST_UPDATE_USER” VARCHAR(255 ) NULL , “_DELETED” BOOLEAN NOT NULL ,
“_FILTER_TYPE” VARCHAR(10 ) NULL , “_FILTER_VALUE” VARCHAR(50 ) NULL ,
“_FORM_ID” VARCHAR(50 ) NULL , “_LOCALE” VARCHAR(10 ) NULL ,
“_SAVEPOINT_TYPE” VARCHAR(10 ) NULL , “_SAVEPOINT_TIMESTAMP” VARCHAR(40 )
NOT NULL , “_SAVEPOINT_CREATOR” VARCHAR(255 ) NULL )
Feb 15, 2017 3:25:42 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl assertRelation
INFO: create table success (before updateRelation):
__ODKTABLES__TABLE_PEOPLE
Feb 15, 2017 3:25:42 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl assertRelation
INFO: Attempting: CREATE TABLE “odk_unit”."__ODKTABLES__TABLE_PEOPLE_LOG"
( “_URI” VARCHAR(80) UNIQUE NOT NULL , “_CREATOR_URI_USER” VARCHAR(80) NOT
NULL , “_CREATION_DATE” TIMESTAMP WITHOUT TIME ZONE NOT NULL ,
“_LAST_UPDATE_URI_USER” VARCHAR(80) NULL , “_LAST_UPDATE_DATE” TIMESTAMP
WITHOUT TIME ZONE NOT NULL , “NAME_ELEMENTKEY” VARCHAR(255 ) NULL ,
“AGE_ELEMENTKEY” VARCHAR(255 ) NULL , “WEIGHT_ELEMENTKEY” VARCHAR(255 )
NULL , “_ROW_ID” VARCHAR(255 ) NOT NULL , “_SEQUENCE_VALUE” VARCHAR(255 )
NOT NULL , “_PREVIOUS_ROW_ETAG” VARCHAR(255 ) NULL ,
“_DATA_ETAG_AT_MODIFICATION” VARCHAR(255 ) NOT NULL , “_CREATE_USER”
VARCHAR(255 ) NULL , “_LAST_UPDATE_USER” VARCHAR(255 ) NULL , “_DELETED”
BOOLEAN NOT NULL , “_FILTER_TYPE” VARCHAR(10 ) NULL , “_FILTER_VALUE”
VARCHAR(50 ) NULL , “_FORM_ID” VARCHAR(50 ) NULL , “_LOCALE” VARCHAR(10 )
NULL , “_SAVEPOINT_TYPE” VARCHAR(10 ) NULL , “_SAVEPOINT_TIMESTAMP”
VARCHAR(40 ) NOT NULL , “_SAVEPOINT_CREATOR” VARCHAR(255 ) NULL )
Feb 15, 2017 3:25:42 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl assertRelation
INFO: create table success (before updateRelation):
__ODKTABLES__TABLE_PEOPLE_LOG

Output excerpt from failing fork (https://github.com/benetech/a
ggregate/), which fails

:~/pstop/aggregate/aggregate-src$ mvn -Dtest=DataManagerTest#testDelete2Rows
test

Deleted some output which is similar to the original

Feb 15, 2017 3:25:32 PM org.opendatakit.aggregate.task.WatchdogWorkerImpl
checkTasks
INFO: ---------------------END Watchdog
EXITING WATCHDOG TASK IN TOMCAT
Feb 15, 2017 3:25:32 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ?
with key 6d3d5b5e-43bc-40f6-9d6d-801a83d3c89b by user
aggregate.opendatakit.org:web-service
Feb 15, 2017 3:25:33 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ENTRY4"
WHERE “_URI” = ? with key people by user aggregate.opendatakit.org:web-
service
Feb 15, 2017 3:25:33 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."__ODKTABLES__TABLE_ACL" WHERE
“_URI” = ? with key uuid:bc6802d6-4bb3-4497-890c-feed0bc0882e by user
aggregate.opendatakit.org:web-service
Feb 15, 2017 3:25:33 PM org.opendatakit.common.persist
ence.engine.pgres.DatastoreImpl deleteEntity
INFO: Executing DELETE FROM “odk_unit”."_task_lock" WHERE “_URI” = ?
with key 052c451b-1808-4b5a-8533-ccb050a14bba by user
aggregate.opendatakit.org:web-service
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.096
sec <<< FAILURE! - in org.opendatakit.aggregate.odkt
ables.DataManagerTest
testDelete2Rows(org.opendatakit.aggregate.odktables.DataManagerTest)
Time elapsed: 0.959 sec <<< ERROR!
org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service
at org.opendatakit.aggregate.odktables.DataManagerTest.setUp(
DataManagerTest.java:106)
Caused by: org.opendatakit.common.persistence.exception.ODKEntityNotFoundException:
Unable to retrieve odk_unit._registered_users key:
aggregate.opendatakit.org:web-service
at org.opendatakit.aggregate.odktables.DataManagerTest.setUp(
DataManagerTest.java:106)

So the failing test starts out skipping some CREATE TABLE attempts.
It’s hard to debug this when I’m not very familiar with the structure of
the project. For example, I tried grep -IR for “TABLE_PEOPLE” and then
“PEOPLE” (case sensitive) to try to find where the tables are defined.
There is no such string in the OpenDataKit/aggregate project. The database
does appear to drop and be recreated successfully before the test run, so I
am still figuring out what is causing the different state to occur in the
two different test runs. Any suggestions for things to try would be
helpful.

Caden

On Tuesday, February 14, 2017 at 10:26:23 PM UTC-6, C. Howell wrote:

I did some more refactoring today, but I still haven’t tracked down
the source of the error. I tried running a single test from the command
line to see if it looks like the Spring context is loaded, and it looks
like it is. Does this log output look reasonable? I truncated it after
the first error. Thanks for any suggestions.

(deleted very long error dump)


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


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