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 154 forks source link

CLI pull_aggregate fails with Error null #808

Closed yanokwa closed 5 years ago

yanokwa commented 5 years ago

/usr/bin/java -jar /root/briefcase/ODK-Briefcase-v1.17.0-beta.0.jar --pull_aggregate --storage_directory /root/briefcase --odk_url https://server.appspot.com --odk_username manager --odk_password mysecret password

Returns "Error: null".

The log is as follows:

2019-09-11 03:30:24,492 [main] ERROR org.opendatakit.briefcase.Launcher - Error
org.opendatakit.briefcase.reused.BriefcaseException: null
    at java.base/java.util.Optional.orElseThrow(Optional.java:408)
    at org.opendatakit.briefcase.model.form.FormMetadata.from(FormMetadata.java:62)
    at org.opendatakit.briefcase.model.form.FileSystemFormMetadataAdapter.deserialize(FileSystemFormMetadataAdapter.java:118)
    at org.opendatakit.briefcase.model.form.FileSystemFormMetadataAdapter.lambda$syncWithFilesAt$2(FileSystemFormMetadataAdapter.java:64)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
    at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
    at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    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.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
    at org.opendatakit.briefcase.model.form.FileSystemFormMetadataAdapter.syncWithFilesAt(FileSystemFormMetadataAdapter.java:71)
    at org.opendatakit.briefcase.model.form.FileSystemFormMetadataAdapter.at(FileSystemFormMetadataAdapter.java:33)
    at org.opendatakit.briefcase.operations.PullFormFromAggregate.pullFormFromAggregate(PullFormFromAggregate.java:91)
    at org.opendatakit.briefcase.operations.PullFormFromAggregate.lambda$static$0(PullFormFromAggregate.java:69)
    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:90)
    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:566)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)

ODK-Briefcase-v1.16.3-81-g0e0ee285.jar works great though.

ggalmazor commented 5 years ago

I'm not sure what's going on, @yanokwa. Did you run another recent version of Briefcase by any chance? Maybe the one from master before merging on that storage directory #807?

Your stacktrace points to a problem with your metadata.json files. Before #807, we encoded a storageDirectory property with the absolute path to the form's directory. After #807, we encode a formDir with a relative directory.

Could you send me your sd or find the metadata.json file and attach it here?

yanokwa commented 5 years ago

Yup, I had an old version from master. I removed all the metadata.json files and reran it with the beta and all is well.

ggalmazor commented 5 years ago

Cool, thanks!