"Grant for channel is after the current sequence" is way off

We got a complaint from a client today saying that changes made on one device weren’t been replicated to their other devices. When I tried to initiate a pull replication, I saw the following message in logs:

Grant for channel [my_channel] is after the current sequence - skipped for this iteration. Grant:[1585570] Current:[1532985]

I’ve read through this post thoroughly, and it seems like my issue is pretty different.

We recently had our server crash and loose a large number of documents (issue reported here), and had to restore a backup from a few weeks ago (our redundancy code had also failed), and it seems like this caused the grant sequence numbers to be thrown off.

I’m wondering if you have any suggestions for how to potentially fix this? It seems like this check isn’t made in sync gateway 1.3-. Would downgrading potentially fix this issue?

We perform only one shot replications because our clients are typically in areas with very poor connectivity, so it’s easier for them to initiate replications once every few days.

Thanks!

At what level was the backup and restore done?

Was the restore done from a clean state or was it merged with the data that remained in Couchbase Server.

One possibility is that the global sequence document ("_sync:seq") did not get restored correctly and there are doc revisions with sequence ID’s that are later than the global sequence after the restore.

The backup was restored from a clean state, but I merged in user accounts
from the corrupted server because users aren’t synced through sync gateway
in our app. To do this I wrote a script that queried the old server for all
new users (and facilities, which are objects representing a shop - our app
is a point of sale system), and then connected directly to the bucket on
the new (uncorrupted) server and used bucket.upsert()

@andy, _sync:seq is 1534256

It seems like this is probably the issue? A few more users have probably initiated pull replications since I grabbed that log

Hey @andy, sorry to poke you, my guess for this is that we can just manually update the sequence number. Will that have any unexpected consequences?