Error: The connection was closed unexpectedly

  • 24Views
  • Last Post 4 weeks ago
0
votes
Ubaid B posted this 17 October 2018

Hi,

Our source is Salesforce and target is our custom JSON based REST API that supports POST calls.

Skyvia is able to call our API successfully via POST. However, it keeps passing the same record to API and throws an error after some tries.

An exception has occurred during insert operation, the message returned from the provider is: The underlying connection was closed: The connection was closed unexpectedly.

But on our end, data is being inserted correctly and the correct response is being returned.

Could you please help! It's urgent

 

Thanks

Order By: Standard | Newest | Votes
0
votes
Ubaid B posted this 17 October 2018

Our metadata for REST connector:

{

   "Metadata":[

      {

         "Name":"User",

         "Url":"/user/",

         "ResultPath":"",

         "Columns":[

            {

               "Name":"firstName",

               "APIPath":"firstName",

               "DbType":"String"

            },

            {

               "Name":"lastName",

               "APIPath":"lastName",

               "DbType":"String"

            },

            {

               "Name":"phone",

               "APIPath":"phone",

               "DbType":"String"

            },

            {

               "Name":"email",

               "APIPath":"email",

               "DbType":"String"

            },

            {

               "Name":"title",

               "APIPath":"title",

               "DbType":"String"

            },

            {

               "Name":"gender",

               "APIPath":"gender",

               "DbType":"String"

            }

         ],

         "InsertOperation":{

            "UrlSuffix":"",

            "Method":"POST",

            "ReturningStrategy":{

               "Type":"Row"

            },

            "InputType":"JsonBody"

         }

      }

   ]

}

0
votes
Simon Bubnov posted this 17 October 2018

This error is returned by the destination provider. As we can see, you have success runs yesterday in this package. But today you have the error. What have you changed in your REST provider or in your package?

Please also note, that REST connector is not designed for creating a connection on user's own. Currently we have no information about your source. Please send us a documentation with the description of the REST API of your source. If possible, provide also the connection parameters of your REST connection. You can send them to us via email on support at skyvia dot com or in a private message to me.

0
votes
Ubaid B posted this 5 weeks ago

@Simon,

Happy ot share our synchronization details with you, here is our use case:

Source = Salesforce

Target = REST API (Custom REST API)

We have already shared Schema with you above.

We have following questions:

(1) is there a timeout under which we should return back data?

(2) is there any specific format of data that we should return so that Skyvia treats it as NORMAL / Done condition?

(3) How will skyvia know that it has processed 1 Account of Saleforce and now it should pick other records? Currently what it does is that, it keeps on sending us same record again and again.

Please let us know if you need any further detail.

0
votes
Simon Bubnov posted this 4 weeks ago

(1) is there a timeout under which we should return back data?

 

REST connector does not have a separate timeout setting. It allows configuring only a delay between requests for cases when API has a limitation on the number of requests per minute. Such a limitation is usually described in the REST API documentation. But this is about sending requests, not waiting for responses.

 

(2) is there any specific format of data that we should return so that Skyvia treats it as NORMAL / Done condition?

 

Data should be returned in a json object format.

 

(3) How will skyvia know that it has processed 1 Account of Saleforce and now it should pick other records? Currently what it does is that, it keeps on sending us same record again and again.

 

Your package "Sync to RequestBin" (SF Contact -> REST, the Users table) has a filter by the Email column, this is why the same record is imported every time.

The "Sync Candidate" package (SF Contact -> REST, the Candidate table) has a filter by Id of a contact, and thus, it inserts the same record. If you remove the filters all the records will be processed.

 

Since you have such a filter in your package, it imports the same record every time. As we see, the record was imported once, and after this exceptions are generated. We have seen such cases when API doesn't send an error message about a duplicate record (like "The name xxx already exists"), and in these cases an exception has occurred too.

 

Please let us know if you need any further detail.

 

Currently we don't know the details about your REST API. Yes, you have sent us the metadata for the User object that you created. But we don't know if they are correct for your REST API. Without REST API documentation and a test account for testing the corresponding REST connector, we cannot find out the possible error reasons.

Close