Lexical error: invalid char in json text

It’s Couchbase Lite for iOS. Would it help you if we could send you the full query string?

By the way we get back the same error when we try to open that URL query string in a browser.

It’s CBL for iOS. How can I configure to open the changes feed through a POST request? Can I configure that?

Hello experts,

we are getting a new error now when trying to use lots of channels:

17:18:00.803 WARNING: JSON error parsing _changes feed: lexical error: invalid char in json text.

We set the channels via the channels property of the pull replication, but it seems there is an error when too many channels are selected. When all channels are selected there are probably hundreds of them, and it seems that the URL query string that the CBL constructs for the sync is getting too long and that that causes problems.

Is there any setting to allow longer request URLs or is there some other easy way to fix this problem?

Thanks in advance,


What platform is the client running?

I upgraded just one or two weeks ago to the newest version. I think it is called 1.0.0. Do we also need to upgrade the Sync Gateway?

Are you on Couchbase Lite iOS or Android? Which version?

Also, what backend are you running against?

If running against Sync Gateway, it should use a POST request for the _changes feed which should eliminate that issue.

It should happen automatically, unless you are using an older version before that feature was added. Which version are of CBL for iOS are you on?

Hey Traun,

my colleague just told me that he never saw any info about POST requests in the Sync Gateway console. So it seems the feature doesn’t work. (Or maybe the limit is not right. It could be too low so that our request length doesn’t trigger the POST method yet, but it is already too long for our server).

Do you have any additional tips for me? Can we configure the Sync Gateway to accept longer GET requests? Or somehow fix/configure the CBL to use POST?

Thanks in advance.


If you don’t have Sync Gateway 1.0, you definitely need to upgrade. Couchbase Lite won’t use POST for _changes feeds unless it sees it’s talking to a new-enough Sync Gateway.

Also, we can’t provide support for pre-1.0 versions of the software.