getodk / briefcase

ODK Briefcase is a Java application for fetching and pushing forms and their contents. It helps make billions of data points from ODK portable. Contribute and make the world a better place! ✨💼✨
https://docs.getodk.org/briefcase-intro
Other
60 stars 156 forks source link

Impossible Decrypt and Export v1.17.2 #853

Open manulpgc85 opened 4 years ago

manulpgc85 commented 4 years ago

Software versions

Briefcase v1.17.2 Java v11.0.6, Windows 10 v1709

Problem description

I was using ODK Briefcase and I could made pull but when I was trying export and decrypt a form with it show me an error on Java Console..

Steps to reproduce the problem

I configured pull from Aggregate server, select the forms and made a pull action. After that I went to Export tab and into the Export Configuration I put the Export Directory and PEM file location.

Finally select the form to export and click the button export.

Expected behavior

Other information

Exception in thread "Thread-6" org.opendatakit.briefcase.reused.BriefcaseException at java.base/java.util.Optional.orElseThrow(Optional.java:408) at org.opendatakit.briefcase.ui.export.ExportPanel.lambda$export$10(ExportPanel.java:198) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) at org.opendatakit.briefcase.reused.job.JobsRunner.launchAsync(JobsRunner.java:63) at org.opendatakit.briefcase.reused.job.JobsRunner.launchAsync(JobsRunner.java:51) at org.opendatakit.briefcase.ui.export.ExportPanel.export(ExportPanel.java:229) at java.base/java.lang.Thread.run(Thread.java:834)

Things you tried, stack traces, related issues, suggestions on how to fix it...

ggalmazor commented 4 years ago

Hi, @manulpgc85!

This doesn't apparently have to do with decryption.

The stacktrace points to a problem due to out of sync form cache and metadata files. You should be able to fix this situation by removing the cache file (cache.ser) at the root of your storage directory and all the metadata.json files in each form directory.

Freeedim commented 4 years ago

I have the same problem with v 1.17.3.

After hours of testing different scenarios, I think I have found the problem:

I have version 1.17.3 and 1.16.3 and they both have have the same problem (I assume 1.17.2 has the same one): when they pull encrypted submissions, they only pull the xml file but they fail to pull the encrypted attachment (error message: FORBIDDEN, as shown in my attachment). Then of course the export will fail because for each submission, there is an essential file missing.

ODK Briefcase 1 16 3 and above - pull

Of course, I do it with a user that is the owner of the project and that has all the possible permissions. The server is https://kc.humanitarianresponse.info/my_almighty_user.

I also have version 1.14.0, which does not have this problem and works flawlessly when it comes to pulling and exporting encrypted submissions.

Cheers

lognaturel commented 4 years ago

I have gotten this same crash intermittently on v1.17.3 when exporting non-encrypted records. Closing and reopening the app has reset it. I have not yet identified a pattern. It never seems to happen on the first export after I open the application.