RemoteRequestRetry failed, RequestExecutor was shutdown during Sync Replication

I have encountered the following exceptions in different instances with the same scenario:

  1. executeRequest() Exception: java.net.SocketException: Socket closed.
  2. executeRequest() Exception: java.io.IOException: Canceled.
  3. executeRequest() Exception: java.io.InterruptedIOException: thread interrupted

Steps:

  1. Created user in SG
  2. Open user session in SG via REST API _session
  3. Trigger sync replication (push and pull)

The following shows a snippet of my sync replication method:

 if (mPull == null) {
            mPull = database.createPullReplication(getReplicationUrl());
            mPull.setContinuous(true); 
            mPull.setAuthenticator(getAuthenticator()); // basic authentication with username and password
            mPull.addChangeListener(mPullReplicationListener);
            mPull.setChannels(syncAuthModel.channels);
        }

        if (mPush == null) {
            mPush = database.createPushReplication(getReplicationUrl());
            mPush.setContinuous(true);
            mPush.setAuthenticator(getAuthenticator());
            mPush.addChangeListener(mPushReplicationListener);
            mPush.setChannels(syncAuthModel.channels);
        }

        mPull.stop();
        mPull.start();

        mPush.stop();
        mPush.start();

I can access the server via sync admin and console so I am sure the URLs are correct. I am also sure that the user used in authentication is valid.

Thanks for your help on this.

In general, if you’re having trouble due to an exception, you should post the backtrace of the exception. Just the name/message isn’t enough information.

@nadinne1111 see Jens’ reply.

Are you saying your replications are failing? In the code above you’re likely calling stop on a replication before it has been started.