"Cannot Parse Response" error when logging in from certain countries using Atlas Device Sync (prev. Realm Sync)

I’m using MongoDB’s Atlas Device Sync (until recently it was called Realm Sync) to handle login for my iOS app, coded in Swift.

I am UK based, and the app works fine for users in the UK. However, I recently sent the app to contacts in Eastern Europe (Poland, Belarus, potentially other countries as well. One person also tried logging in using a French VPN apparently) and they’ve all received the same error when creating an account or logging in with an already created account.

The localised description of this error is “cannot parse response”.

Unfortunately I am based in the UK so I can’t replicate it on my own device. However, I know that the error when creating an account is being thrown from the below code:

app.emailPasswordAuth.registerUser(email: email!, password: password!, completion: { [weak self] (error) in
            DispatchQueue.main.async {
                guard error == nil else {
                    self!.signUpFailed(with: error!)
                    return
                }
                self!.signIn(with: self!.email!, and: self!.password!)
            }
        })

And I know that the error when logging in to an already created account is being thrown from the below code:

app.login(credentials: Credentials.emailPassword(email: email, password: password)) { [weak self] (result) in
            DispatchQueue.main.async {
                switch result {
                case .failure(let error):
                    self!.signInFailed(with: error)
                    return
                case .success(let user):
                    self!.continueLoggingIn()
                }
            }
        }

I’m at a bit of a loss here. I have no idea why the response can be parsed in the UK but not other countries. I assume it’s an issue with Mongo/Realm but I could be wrong. If anyone can shed any light it would be greatly appreciated.

1 Like

Hi, can you send your app_id (it is the value in the url https://realm.mongodb.com/groups/${GROUP_ID}/apps/${APP_ID}). This is safe to send but if you prefer to email you can send it to me at tyler.kaye@mongodb.com

1 Like

Thanks for your response Tyler - the app_id is 6054d83e21b232a4b4a685b1.

One other thing to note since I wrote my initial post is I checked the logs at the time at which one of the users in Poland tried and failed to log in/create an account, and no error logs showed up, nor any other logs relating to that users usage of the app.

1 Like

Hi Tyler, I am facing the same issue with people who try to log in from Europe. (Russia)
Getting “cannot parse response”

Any fix/workaround for that?

I have emailed my app_id to you @Tyler_Kaye

Thanks!

Hi, we block all traffic from Russia. Please see here for more details: MongoDB Assistance to Ukraine, Shut Down of Work in Russia | MongoDB Blog