MYSQL Code first migrations - mysql

When running code first migrations with MySQL the migration completes successfully but as soon as context is accesses and i either try to fetch or add data i get an exception.
An unhandled exception of type 'System.ArgumentException' occurred in EntityFramework.dll
Additional information: The underlying provider does not support the type 'nvarchar(max)'.
Automatic migrations work without any problem :(

Related

SSIS Package error - Illegal operation attempted on a registry key that has been marked for deletion

We have a package that will be triggered through MVC application by invoking store procedure which creates a execution request for the Package. MVC app is hosted on different server and DB is on different server. This error started occurring after 3 months of Windows Server 2019 migration.
Package executes successfully most of the time, but fails once or twice per day with the following errors. After re-executing the package immediately it succeeds. Error occurs in the below order.
Illegal operation attempted on a registry key that has been marked for deletion
Failed to acquire connection. Connection may not be configured correctly or you may not have the right permissions on this connection.
Upon capturing the "ISServexec.exe" process dump and analyzed through DebugDiag, we came to know the below details.
System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {2206CDB2-19C1-11D1-89E0-00C04FD7A829} failed due to the following error: 800703fa Illegal operation attempted on a registry key that has been marked for deletion. (Exception from HRESULT: 0x800703FA).
System.InvalidOperationException: The .Net Framework Data Providers require Microsoft Data Access Components(MDAC). Please install Microsoft Data Access Components(MDAC) version 2.6 or later.
System.Runtime.InteropServices.COMException: Illegal operation attempted on a registry key that has been marked for deletion.
Microsoft.SqlServer.Dts.Runtime.DtsGenericException: Illegal operation attempted on a registry key that has been marked for deletion.
Note:
Package doesn't have any excel reading operations. Just source table to target table load (both same database).
We have validated the MDAC version in the DB server as 6.3.
App Server: Windows 2019 with .Net framework 4.8 installed.
DB Server: Windows 2019, SQL Server 2019, SSIS v15, .Net framework 4.8.
Package executed using domain service account.
We have triggered the Package through SQL job and Package did not fail at all. Almost 200 executions tested. This failure is random and only fails when store procedure invoked through MVC application.
We have used ProcMon to collect the "ISServexec.exe" logs and only thing we noticed is hive unloaded and no errors.
SQL Profiler didnt even capture the error.
Package is not failing at the same step when this error occurs.
Package logging is configured to write errors in event log, but in event log only "package is failed" information is captured.
Package configured to use Oledb connection type. SQL Native client and MSOLEDB providers are used and error occurs in both the providers.
Package has been upgraded to SQL 2019. Hence we created a new Package in Visual Studio 2019 from scratch and this also fails with same error.
No errors captured in SQL Server extended events.
My Questions:
What are possible ways to validate the service account holds necessary permissions when the above error happens. Is this required ?
Is there any tools that I can use to debug and find the cause of the error or additional information ?
Is this oledb driver issue ?
How to capture any logs at windows server level when package execution happens.
Sorry for the detailed explanation. Any suggestions would be greatly appreciated.

Google Cloud Function "[ERROR]: Exception on / [POST]"

I have this error
[ERROR]: Exception on / [POST]
as the last entry in the Log tab of the Cloud Function after testing the function failed with:
Error: function terminated. Recommended action: inspect logs for termination reason. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging Details:
500 Internal Server Error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
What to do?
Just sharing this since it surprised me. The log just needs some dozen seconds to really finish the entries. In my case, I went to the Log directly after the failed test, and then jumped to Edit of the CF right after seeing that log entry error at the bottom, thinking it would be all to gain from the log.
Then I changed my mind, went back to the Log tab and saw the real error entry only coming after that [ERROR]: Exception on / [POST].
Not important since you will have another error anyway: I had used create_engine() function without the needed module prefix sqlalchemy.create_engine(). (Side-note: Querying your own db does not seem to work anyway in a CF unless you use a VPC connector, do not think from this example that it might be possible).

Handling AcquireConnection error

I wanted to figure out if a SSIS package would run without any problems by implementing a Health Check script task at the beginning of my package. I did this by iterating through the connection managers in the package and calling the acquireconnection method. If there is an exception acquiring connection, I handle it using catch block and assume that this error would not cause the package to fail. The package shows a successful run but an error gets logged in the “Execution Results/Progress” tab of the SSIS and leads to the failure of the corresponding ExecutePackage Task of the Parent package.
If I throw an exception explicitly within the try block, the parent package doesn’t fail. This failure seems to be happening only when an exception gets thrown by the execution of the acquire connection method.
I am looking understand why this happens and if there is a way I can prevent the parent package from failing whenever acquire connection call throws an exception. I am also open to an alternate approach to figure out if all connection managers within a package will work alright.

Visual Studio Update Wizard MySql

I am running Visual Studio 2010, and attempting to update my Entity Framework project using the Update Wizard. When I attempt to add a single table from the MySql database, the add tab will show the table that I am attempting to add, however when I click finish, I get the following error message.
Unable to generate the model because of the following exception: 'An error occurred while executing the command definition. See the inner exception for details.
Fatal error encountered during command execution.
Fatal error encountered attempting to read the resultset.
Reading from the stream has failed.
Attempted to read past the end of the stream.
I get the same error message if attempt to create the Entity Framework from scratch. In addition, Server Explorer shows that the connection is successful when I test it.
I have also contacted Host Gator who is hosting the database and they where not able to see any issues on their side.
The problem ended up being that our shared server, was not able to handle the Update Request from the Entity Connector Framework and was timing out. Once we moved our database over to a different server we no longer had an issue.

NLog mySQL target configuration

I am trying out NLog to use mySQL table. I seem to have the configuration set correctly however I am getting the following error (capturing exceptions in NLog).
2012-10-10 17:09:20.0200 Error Error initializing target Database Target[slogger] System.Configuration.ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider.
at System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow)
at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
at NLog.Targets.DatabaseTarget.InitializeTarget()
at NLog.Targets.Target.Initialize(LoggingConfiguration configuration).
I think that this error is related to the statement "The parameter name should be a provider invariant name as registered in machine.config or app.config" in the database target configuration page however I am not certain how to correct the error. I have the mySQL DLL referenced in the application.
Following is my configuration:
Please let me know what I am doing incorrectly and how to change. I really appreciate help. This is really a cool app!
Thanks
Ray
try changing the dbProvider to this
dbProvider="MySql.Data.MySqlClient.MySqlConnection, MySql.Data"