Connecting App Engine Flex with Dotnet application to Cloud SQL 2nd generation instance

39 views
Skip to first unread message

Amitesh Chawla

unread,
Dec 16, 2019, 8:23:25 AM12/16/19
to Google App Engine
Can anyone help me out regarding how to connect Cloud SQL second generation instances to my Dotnet application hosted on App engine flex.
The dotnet application hosted on app engine flex and the cloud sql instance are in different projects (but the same region).

I keep getting the following error-

["Source: MySql.Data Message:Reading from the stream has failed. InnerException:System.IO.EndOfStreamException: Attempted to read past the end of the stream.\n   at MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32 offset, Int32 count)\n   at MySql.Data.MySqlClient.MySqlStream.LoadPacket() StackTrace   at MySql.Data.MySqlClient.MySqlStream.LoadPacket()\n   at MySql.Data.MySqlClient.MySqlStream.ReadPacket()\n   at MySql.Data.MySqlClient.NativeDriver.Open()\n   at MySql.Data.MySqlClient.Driver.Open()\n   at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)\n   at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()\n   at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()\n   at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()\n   at MySql.Data.MySqlClient.MySqlPool.GetConnection()\n   at MySql.Data.MySqlClient.MySqlConnection.Open()\n   at WhirlpooolP4P.Controllers.ValuesController.Get() in E:\\Team Computer\\Projects\\WhirlPool\\P4P WebAPI\\WhirlpooolP4P\\WhirlpooolP4P\\Controllers\\ValuesController.cs:line 43"]

George (Cloud Platform Support)

unread,
Dec 16, 2019, 1:53:52 PM12/16/19
to Google App Engine
Hello Amitesh, 

This error is indicative of timeout issues. You may check replies to the "Attempted to read past end of the stream error in MySQL" question in stackoverflow, as an example. 

For connection specific issues, you may refer to "Connecting to Cloud SQL from external applications" documentation page

This discussion group is oriented more towards general opinions, trends, and issues of general nature touching the app engine. For technical MySQL connection issues, and generally for coding you may be better served in dedicated forums such as stackoverflow, where experienced programmers are within reach and ready to help. 
Reply all
Reply to author
Forward
Message has been deleted
0 new messages