Setting up ODK X sync endpoint on AWS EC2 instance

1. What is the problem? Be very detailed.

I am trying to set up an ODK X sync endpoint based on the following instructions: https://docs.opendatakit.org/odk-x/sync-endpoint/#odk-sync-endpoint-setup

I tried to do this on my local machine and succeeded, I could open up 127.0.0.1, set up users everything. I now want to replicate this process but on an Amazon Web Services - EC2 Linux Ubuntu 18.04 AMI but I don’t know how to exactly get the sync endpoint up and running. I made an attempt to just ssh into the instance and run all the steps but it didn’t work and I just got connection timed out and bad gateway errors.

Do I have to configure the EC2 instance before launch in some way to be able to get this to run, like in the case of setting up ODK-Aggregate on AWS?

It would be really helpful to have a similar set of instructions to set up ODK sync-endpoints on AWS like we do for Aggregate.

2. What app or server are you using and on what device and operating system? Include version numbers.

AWS Linux EC2 instance with Ubuntu 18.04 LTS AMI

3. What you have you tried to fix the problem?

I have tried to run the steps in the documentation on the EC2 instance by accessing it through ssh. All the steps run successfully but the server somehow doesn’t work giving me a connection timed out error. I have since terminated the instance and decided to ask for a proper set of steps to do this on the AWS server on the forum.

4. What steps can we take to reproduce the problem?

Run the ODK sync-endpoint docs on an amazon EC2 Linux instance.

3 Likes

Hi @karran13 ,

May you share the solution, it will be really helpful. I’m also stuck at very exact problem. Also, sometime connecting to instance via ssh client is taking too long time, donno why.

Thanks
Prashant

1 Like

Hi @Prashant,

You could deploy to EC2 like you would to you local box. Just make sure the AWS services (networking, firewall, etc.) are configured to suit your requirements. If your connection to the EC2 instance is unreliable, you could consider running tmux or GNU screen on the VM so that your session could be persisted even when your SSH connection drops.

https://www.gnu.org/software/screen/

2 Likes

Thanks for your reply @linl33, I’ll use tmux or GNU screen soon and give feedback. Meanwhile, i’ve tried as per the documentation.

After following this aws cloud server documentation, i was able to reach at https://[IP_ADDRESS]:40000. But, i’m not able to login at 40000 port and also to the web-ui. Related screenshots are attached below.

  1. 40000 port: successfully reached
  2. After submitting login credentials at 40000 port
  3. web-ui login page

Any help will be really appreciable.

1 Like

@Prashant make sure all of the services of the swarm are running for more than 5 minutes. If one errors it will keep trying to start it but it won’t actually stay operating.

2 Likes

Hello,
Finally with the help of Azure cloud server, i was able to complete the ODK-X sync-endpoint setup. I’m trying to push files to server via “RESET SERVER SETUP”. First two steps, Pushing files to a clean device and authenticating as a user in the table administrator group, are successfully done.
But, when i’m trying to reset the server from my device and send all the files to server, it is giving an error “Device Configuration Failure : WiFi Gateway or Configuration Failure”.( screenshot is attached below)

Also, after searching in the ODK-X forum, i tried resetting the server from ODK-X Suitcase, even then the error is constant. Any idea :thinking: :thinking:

1 Like

Take a look at the Android logcat it will probably reveal a better error message on the problem.

Also a common problem is files with size zero (those are not accepted)

2 Likes

Hi,
I’m reposting the “Device Configuration Error” (posted earlier in this thread) along with the screen-recording of error in video mode. Have a look. The below attached is recorded after clicking on “Reset App Server” in the ODK-X Services App.

Here, As soon as Uploading config/assets/app.georowlevelaccessdemo.properties to server comes on the screen during Syncing in progress, the “Device Configuration Failure” pop up.

Also, a point to be noted is the following warning was found during abdpush command was run to push all the files from PC to device. Interesting point is that in the screenshot attached one of the warning is also related to device.properties which was observed in the video related to Reset app server.

Also my user details does look like this:

Any lead…

Note:- I’ve updated the ODK-X Tool Suite to v2.1.8

1 Like

The warnings received by the “adbpush” are expected if the connected Android device has not been configured. To make debugging easier the adbpush copies the properties file from the Android device then installs everything to match app-designer. It finally puts the properties files back as it was before the adbpush so you don’t have to constantly retype server URL, username, password etc. (feature liked by many people).

The problem is that ODK-X’s frameworks may not completely re-initialize because of the cached variables.

In the device settings there is an option to “reset the configuration” this causes a complete a new initialization of the ODK-X frameworks. See Using ODK-X Services — ODK-X Docs for where it is in the menu.

EDIT: Instructions Managing ODK-X Services — ODK-X Docs

3 Likes

Hi, @W_Brunette and @linl33 :raising_hand_man: :raising_hand_man:
I’ve tried “Reset Configuration” and then “Reset App Server”, tried two different smartphones to upload files to fresh server, even then the “Device configuration failure” error is solid as before. I checked in my app directory, there is no empty files. Even, the same steps I’ve tried with two different smartphones, and got exactly same error with both devices.

To understand more better, the log file ( opendatakit/default/output/logging/ … ) is attached. Also, a screenshot of the below file is attached which shows that app-level sync was not successful.
log_file.txt (189.2 KB)

The android_logcat file is attached below. (After running the command "adb android *:w", which displays all log messages with priority level “warning” and higher.)
android_logcat_error.txt (94.3 KB)

Any assistance would be greatly appreciated.

1 Like

It looks like it is causing a problem on this file “app.georowlevelaccessdemo.properties” do you need the file? If not delete it. It appears to be in assets.

Also looking at your sync-endpoint server logs can also show the error.