Cannot upload forms using ODK-X-SuiteCase 2.1.6

Hi,

I have successfully installed ODK-X 2.1.6 on AWS following up the guidelines here https://docs.odk-x.org/sync-endpoint-setup/#sync-endpoint-setup-aws

I could login web ui with ldap user. I could authenticate ldap user on ODK-X Table 2.1.6 installed on my android phone. However, I could not upload my forms using ODK-X-Suitecase 2.1.6 by executing this command: java -jar ./bin/ODK-X_Suitcase_v2.1.6.jar -cloudEndpointUrl $AGGREGATE_URL -username $AGGREGATE_USERNAME -password $AGGREGATE_PASSWORD -appId $AGGREGATE_APP_ID -dataVersion 2 -upload -path <PATH_TO_TABLES> -tableId <TABLE_ID>

This is output log of the command:

Uploading tables: adult_release
aspirator
bg_service
erc_release
ovitrap_service
getTables: agg uri is http://ec2-54-206-98-134.ap-southeast-2.compute.amazonaws.com/odktables/default/tables
getTables: result is {“tables”:,“hasMoreResults”:false,“webSafeResumeCursor”:null,“webSafeRefetchCursor”:null,“webSafeBackwardCursor”:null,“appLevelManifestETag”:null,“hasPriorResults”:false}
getPrivilegesInfo: agg uri is http://ec2-54-206-98-134.ap-southeast-2.compute.amazonaws.com/odktables/default/privilegesInfo
getPrivilegesInfo: result is org.opendatakit.aggregate.odktables.rest.entity.PrivilegesInfo@2aa831b4
getTables: agg uri is http://ec2-54-206-98-134.ap-southeast-2.compute.amazonaws.com/odktables/default/tables
getTables: result is {“tables”:,“hasMoreResults”:false,“webSafeResumeCursor”:null,“webSafeRefetchCursor”:null,“webSafeBackwardCursor”:null,“appLevelManifestETag”:null,“hasPriorResults”:false}
createTable: agg_uri is http://ec2-54-206-98-134.ap-southeast-2.compute.amazonaws.com/odktables/default/tables/adult_release
createTable: with object {“orderedColumns”:[{“elementKey”:“data”,“elementType”:“string(5000)”,“elementName”:“data”,“listChildElementKeys”:“”},{“elementKey”:“edp_version”,“elementType”:“string”,“elementName”:“edp_version”,“listChildElementKeys”:“”}],“tableId”:“adult_release”,“schemaETag”:“”}
createTable: result is for tableId adult_release is <!doctype html>HTTP Status 405 ? Method Not Allowedbody {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}

HTTP Status 405 ? Method Not Allowed


Type Status Report

Description The method received in the request-line is known by the origin server but not supported by the target resource.


Apache Tomcat/8.5.55


Error: Please visitCloud Endpointweb interface for error detail.
org.apache.wink.json4j.JSONException: Error occurred during input read.
at org.apache.wink.json4j.internal.Parser.parse(Parser.java:126)
at org.apache.wink.json4j.internal.Parser.parse(Parser.java:95)
at org.apache.wink.json4j.JSONObject.(JSONObject.java:138)
at org.opendatakit.sync.client.SyncClient.createTable(SyncClient.java:1496)
at org.opendatakit.sync.client.SyncClient.createTableWithCSVProcessing(SyncClient.java:1738)
at org.opendatakit.sync.client.SyncClient.createTableWithCSV(SyncClient.java:1667)
at org.opendatakit.sync.client.SyncClient.pushAllDataToUri(SyncClient.java:787)
at org.opendatakit.suitcase.net.SyncWrapper.pushAllData(SyncWrapper.java:94)
at org.opendatakit.suitcase.net.UploadTask.doInBackground(UploadTask.java:83)
at org.opendatakit.suitcase.net.UploadTask.doInBackground(UploadTask.java:14)
at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at javax.swing.SwingWorker.run(SwingWorker.java:334)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Unexpected character ‘<’ on line 1, column 1
at org.apache.wink.json4j.internal.Tokenizer.next(Tokenizer.java:195)
at org.apache.wink.json4j.internal.Parser.parse(Parser.java:124)

This is tomcat access log of sync endpoint:
root@85c76e7a20df:/usr/local/tomcat/logs# cat localhost_access_log.2020-06-03.txt


10.0.1.4 - - [03/Jun/2020:03:19:43 +0000] “GET /odktables/default/privilegesInfo HTTP/1.0” 200 153
10.0.1.4 - - [03/Jun/2020:03:19:44 +0000] “GET /odktables/default/tables HTTP/1.0” 200 129
10.0.1.4 - - [03/Jun/2020:03:19:44 +0000] “PUT /odktables/default/tables/adult_release HTTP/1.0” 405 681

This is nginx logs:

10.0.0.2 - - [03/Jun/2020:03:19:43 +0000] “GET /odktables/default/tables HTTP/1.1” 401 746 “-” “Apache-HttpClient/4.5.9 (Java/1.8.0_162)” “-”
10.0.0.2 - tran.bui [03/Jun/2020:03:19:43 +0000] “GET /odktables/default/tables HTTP/1.1” 200 129 “-” “Apache-HttpClient/4.5.9 (Java/1.8.0_162)” “-”
10.0.0.2 - tran.bui [03/Jun/2020:03:19:43 +0000] “GET /odktables/default/privilegesInfo HTTP/1.1” 200 153 “-” “Apache-HttpClient/4.5.9 (Java/1.8.0_162)” “-”
10.0.0.2 - tran.bui [03/Jun/2020:03:19:44 +0000] “GET /odktables/default/tables HTTP/1.1” 200 129 “-” “Apache-HttpClient/4.5.9 (Java/1.8.0_162)” “-”
10.0.0.2 - tran.bui [03/Jun/2020:03:19:44 +0000] “PUT /odktables/default/tables/adult_release HTTP/1.1” 405 681 “-” “Apache-HttpClient/4.5.9 (Java/1.8.0_162)” “-”

It seems that PUT request was rejected by sync endpoint.

Hi @Thien_Mai! As you are new to the community, when you get a chance, please introduce yourself here. I’d also encourage you to add a real picture as your avatar because it helps build community!

So it looks like you are trying to upload data using suitcase. Did you already reset the app server to have these tables? See instructions here: Managing ODK-X Services — ODK-X Docs

Thanks @elmps2018. I realized that I uploaded the tables using ROLE_SYNCHRONIZE_TABLES user. When I tried with ROLE_ADMINISTER_TABLES, it worked.

1 Like