ODK briefcase/Aggregate/Downloadable flag

Today I tried to limit ability of field teams to download forms to devices (but left "accept submissions" flagged

Interesting behaviour I wasn't expecting was that I could no longer use briefcase to pull data from those forms which were not downloadable. This seems fairly strange.

When I turned 'downloadable' back on, most data started downloading again via ODK briefcase 1.12 CLI but one form refuses to pull and gives error message as pasted below. Curiously this form does pull using the ODK Briefcase 1.12 GUI

Oct 03, 2018 10:36:16 PM org.hsqldb.persist.Logger logSevereEvent
SEVERE: could not reopen database
org.hsqldb.HsqlException: error in script file line: 60 org.hsqldb.HsqlException: error in script file: SET DATABASE UNIQUE NAME HSQLDB6622699DDE
	at org.hsqldb.error.Error.error(Unknown Source)
	at org.hsqldb.scriptio.ScriptReaderText.readExistingData(Unknown Source)
	at org.hsqldb.scriptio.ScriptReaderBase.readAll(Unknown Source)
	at org.hsqldb.persist.Log.processScript(Unknown Source)
	at org.hsqldb.persist.Log.open(Unknown Source)
	at org.hsqldb.persist.Logger.open(Unknown Source)
	at org.hsqldb.Database.reopen(Unknown Source)
	at org.hsqldb.Database.open(Unknown Source)
	at org.hsqldb.DatabaseManager.getDatabase(Unknown Source)
	at org.hsqldb.DatabaseManager.newSession(Unknown Source)
	at org.hsqldb.jdbc.JDBCConnection.<init>(Unknown Source)
	at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
	at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
	at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
	at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:251)
	at org.opendatakit.briefcase.util.DatabaseUtils.getConnection(DatabaseUtils.java:234)
	at org.opendatakit.briefcase.util.DatabaseUtils.connect(DatabaseUtils.java:71)
	at org.opendatakit.briefcase.util.DatabaseUtils.<init>(DatabaseUtils.java:66)
	at org.opendatakit.briefcase.util.DatabaseUtils.newInstance(DatabaseUtils.java:229)
	at org.opendatakit.briefcase.util.ServerFetcher.downloadFormAndSubmissionFiles(ServerFetcher.java:186)
	at org.opendatakit.briefcase.util.TransferFromServer.doAction(TransferFromServer.java:52)
	at org.opendatakit.briefcase.util.TransferFromServer.pull(TransferFromServer.java:65)
	at org.opendatakit.briefcase.operations.PullFormFromAggregate.pullFormFromAggregate(PullFormFromAggregate.java:101)
	at org.opendatakit.briefcase.operations.PullFormFromAggregate.lambda$static$0(PullFormFromAggregate.java:53)
	at org.opendatakit.common.cli.Cli.lambda$run$4(Cli.java:130)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at org.opendatakit.common.cli.Cli.run(Cli.java:127)
	at org.opendatakit.briefcase.Launcher.main(Launcher.java:79)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: org.hsqldb.HsqlException: error in script file: SET DATABASE UNIQUE NAME HSQLDB6622699DDE
	at org.hsqldb.error.Error.error(Unknown Source)
	... 33 more

Error: Failure pulling forms from server. FormIds: XXX

The form has to be downloadable before Briefcase will pull the forms. This has been the case for as long as I can remember but it's not clearly documented. I've added it my pending PR on Briefcase at https://github.com/opendatakit/docs/pull/869.

As to the error message, is there a chance you have two copies of Briefcase running simultaneously? Or one that ran and crashed and you ran another? Does the program go away if you reboot the machine with Briefcase?

Thanks Yaw,

First tried removing the download target and when I tried to remove the folder with rm -rf the target folder reappeared. top didn't reveal much, but I expect you are right that something was running in background that was doing bad things. Restart of workstation seems to have fixed it.

With regards the download settings. I don't understand where it would be useful to have the following settings

Download forms to device = No
Accept submissions = Yes
Briefcase downloads = No

Our use case is that field teams may have saved data on old versions of forms on devices, so we need to keep accepting submissions and including newly submitted data in downloads and analysis. We don't however want anyone new putting the old forms on their devices (and of course we want people with old forms to update them asap) so the best settings would be

Download forms to device = No
Accept submissions = Yes
Briefcase downloads = Yes

Does that make sense?

Thanks again for earlier help.


Interesting error! HSQLDB is file based (no sever). I need to study this, but it seems that HSQLDB could be using some lock file in your host's temp folder (that would explain how rebooting solved the problem).