ForEach/Copy Activity Error

johannah Motshwene 21 Reputation points
2021-08-04T06:35:31.26+00:00

Hi All

I have a ForEach Activity, that copies data from tables in MySQL Database into tables in a Data warehouse(MySQL).
And I quite often get an error which I don't understand or know how to prevent from happening again.
I usually get the error for one or two tables in the ForEach while the other tables run successfully.

Error Code: 2200

Error Message:
'Type=MySql.Data.MySqlClient.MySqlException,Message=Failed to read the result set.,Source=MySqlConnector,''Type=System.IO.IOException,Message=Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.,Source=System,''Type=System.Net.Sockets.SocketException,Message=An existing connection was forcibly closed by the remote host,Source=System,'

Please assist with an explanation and how to prevent this from happening.

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
849 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,853 questions
{count} votes

2 answers

Sort by: Most helpful
  1. HimanshuSinha-msft 19,476 Reputation points Microsoft Employee
    2021-08-04T20:58:26.913+00:00

    Hello @johannah Motshwene ,
    Thanks for the ask and using the Microsoft Q&A platform .
    Since you are using the foreach loop , I am assuming that the you are copying once table at a time . I am assuming that you are getting this error when you try to copy bigger tables . Can you please check this ? ( create a copy activity and select a table name which is big and try to run it .

    I think increasing the timeout setting in the copy activity should help .

    Please do let me know how it goes .
    Thanks
    Himanshu
    Please do consider clicking on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members

    0 comments No comments

  2. johannah Motshwene 21 Reputation points
    2021-08-12T08:58:55.16+00:00

    Hi @HimanshuSinha-msft

    Thank you for the feedback and apologies for the late response.

    Yes all the tables in the ForEach start running at the same time. And yes this happens for the bigger tables. But strangely, when I receive the error and I end up not making any changes, all the tables will run as normal and successfully the following day. So I am trying to understand why we get the error and how to prevent it.

    I have created a copy activity for a big table and have tried to run it, it runs successfully without giving me any error that is of course if I set a big timeout for it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.