Medic API failing after replication

Hello, am trying to create replica application of my main CHT core application. I started replication roughly a week ago but now while trying to login as a user frontend displays “Polling replication data” and then “Loading error”

I checked the logs as shown below in the image

Any Idea on what’s happening and how I can the API back up ?

@atria please provide the steps that were taken when creating the clone. This would greatly help in identifying where to start looking.

Please also share the matching API and couchdb logs. Does couchdb have any running tasks?

@derick I was working with @atria on this, the original instance has cht version 3.6.0 and we are replicating the data in a clean install of cht version 3.7.1. using an ETL application.
below are some of the attached loggs from Couch db



The error that can be seen in the initial post, “The request could not be processed in a reasonable amount of time” indicates that some of the views that the application is querying are not indexed.
This could cause the replication requests to time out as well.

If it’s a new installation, you should wait until the views are indexed before using the app.
If installing via horticulturalist, there should be logs indicating the view indexing progress, otherwise you can check the active tasks yourself (1.2.1. / — Apache CouchDB® 3.3 Documentation)

@antony @derick @gareth @diana Thanks we found that waiting for the views to get indexed, resolved this issue while trying to login as a user.

I think we can improve this experience as outlined in this issue.

1 Like

@diana, we are having a similar challenge for some users (CHWs), most not first time users, checked the CouchDb logs and I see a lot of Starting index update for db: shards/a0000000-bfffffff/xxxx.1668361497 idx: _desi…, Index update finished for db: shards/00000000-1fffffff/xxxx.1668361497 idx: _desi…

Some users have reported three to four days with same screen, polling replication data, thus they can’t proceed with data collection. I can’t explain why users who were already using the app get the polling replication data screen, and why the process takes this long, will appreciate any insights

For visibility, more conversation on this issue is happening on this thread.