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

Export to CSV failing due to spaces in form id #868

Closed yanokwa closed 4 years ago

yanokwa commented 4 years ago

I'm running Briefcase v1.17.3 on the command line with a Bash script. The command I'm running is:

$JAVA_BIN -jar "$BRIEFCASE_JAR" --export --form_id "$FORM_ID" --storage_directory "$BRIEFCASE_STORAGE_DIR" \
    --export_directory "$BRIEFCASE_EXPORT_DIR" --export_filename "$FORM_ID".csv \
    --exclude_media_export --overwrite_csv_export

The error I get is:

org.opendatakit.briefcase.reused.BriefcaseException: Form COVID-19+Community+Awareness+and+Case+Search+DFA+Daily+Reporting not found
    at org.opendatakit.briefcase.operations.Export.lambda$export$4(Export.java:119)
    at java.util.Optional.orElseThrow(Optional.java:408)
    at org.opendatakit.briefcase.operations.Export.export(Export.java:119)
    at org.opendatakit.briefcase.operations.Export.lambda$static$0(Export.java:78)
    at org.opendatakit.common.cli.Cli.lambda$run$4(Cli.java:130)
    at 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 jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:566)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)

The form title is: COVID-19 Community Awareness and Case Search DFA Daily Reporting The form ID is: COVID-19 Community Awareness and Case Search DFA Daily Reporting The folder Briefcase generates on the filesystem is: COVID_19 Community Awareness and Case Search DFA Daily Reporting

I think it's very likely that Briefcase export is failing because of spaces in the form ID or the mismatch between the hyphen and the underscore.

yanokwa commented 4 years ago

Did some digging. The problem is with how the Bash script figures out the form ID, not Briefcase.