ubiety / Ubiety.Dns.Core

Flexible DNS library for .NET Core, and .NET Framework
Apache License 2.0
8 stars 6 forks source link

MySql 8.0.19 dependency on Ubiety.Dns.Core 2.5.0 causes crash in ASP.net MVC #6

Closed aventer closed 4 years ago

aventer commented 4 years ago

Unsigned Ubiety.Dns.Core 2.5.0 is installed as a dependency with MySql.Data 8.0.19. Due to the assembly being unsigned, it then causes a runtime crash within the MVC web application I am working on in Visual Studio 2017.

To Reproduce

  1. Create a MVC web application. Target .Net Framework : 4.5.2
  2. Add MySql.Data through Nuget. PM> Install-Package MySql.Data
  3. Run application
  4. View error and stack trace through displayed web page.

Environment

Additional sn.exe -v Ubiety.Dns.Core.dll Outputs: Microsoft (R) .NET Framework Strong Name Utility Version 4.0.30319.0 Copyright (c) Microsoft Corporation. All rights reserved. Ubiety.Dns.Core.dll is a delay-signed or test-signed assembly

coder2000 commented 4 years ago

I have always been looking at ways to sign my libraries, however, certificates are cost-prohibitive for me right now. Would a self-signed library work or would you like to sponsor a certificate?

aventer commented 4 years ago

Thank you for getting back to me. I had a look into this and found that only certificates from certain vendors are accepted... In the mean time I have found a way through the Nuget Console to rollback the version of MySql.Data from 8.0.19 > 8.0.17. Which solved my issue.

PM> Uninstall-Package MySql.Data -RemoveDependencies

PM> Install-Package MySql.Data -Version 8.0.17

I have also logged a bug report with Oracle through the Nuget portal on this matter and requested if they would be able to furnish you with a certificate since their database client is dependent on Ubiety.Dns.Code.

coder2000 commented 4 years ago

I am not seeing my library being depended on by them. Are you able to create a demo app that shows the conflict?

mysql data-dependencies

aventer commented 4 years ago

It is omitted from their documentation. Yes, I can create a demo application that demonstrates the conflict. The steps as lined out in my first message with Visual Studio 2017 and Visual Studio 2019 still reproduces the error.

I have also downloaded the nupkg file from https://www.nuget.org/packages/MySql.Data/8.0.19 on 2020-02-20 08:06 +02:00. You can see the library being referenced in the unzipped package.

(If they haven't removed it by now)

The documentation listing dependencies in the image above seems to be generated by the MySql.Data.nuspec xml file (in root of the unzipped directory) which does not reference the Ubiety.Dns.Core library by its Nuget references. Probably a work around on their side.

aventer commented 4 years ago

Oracle support has gotten back to me via email and have admitted that it was a mistake on their side. They said that they will fix they issue in MySql.Data 8.0.20.

Thanks for the patients and the help.

If you want a copy of nupkg I would be able to make it available.

They have made no mention of furnishing a certificate but they seem to want to continue using a Dns library for their DNS-SRV feature (no explicit reference of continuing to use the library was mentioned for MySql.Data ver. 8.0.20).

The work around they offered seemed to be a self contained dll with all the dependencies packaged into it, maybe they then signed it with their certificate (complete speculation, maybe probable...).

Maybe it would be worth approaching them for becoming a sponsor of the repository.

xaviermawet commented 4 years ago

Here is the link to the MySQL bug: https://bugs.mysql.com/bug.php?id=98204

aventer commented 4 years ago

Thanks for the link @xaviermawet. The Oracle rep did point me into the direction of the same link. I was just temporarily discontent with the inaccurate documentation not listing this library as a dependency and the fact that it broke the application I am currently converting to MySQL.

The right people need credit for their work as well.

jemiller0 commented 4 years ago

Oracle making it so that a DNS resolving DLL that isn't signed, and doesn't appear as a NuGet package doesn't lend a lot of faith in the company. I thought it was fishy that they now include an SSH library as well. I'm glad that my organization will mostly be switching over to PostgreSQL. Oracle's .NET drivers have always been complete garbage. You might want to use the MySqlConnector open source provider instead of Oracle's. I would have gotten rid of Oracle's a long time ago, but, NHibernate is hard coded to it (or at least it was, I don't know if that is still true).

coder2000 commented 4 years ago

This is most definitely a NuGet package, Oracle has chosen to ignore that an include it in their package themselves. I would love to sign this package as well but with funds being limited I would need some sponsorship to do so. I am proud of the work I have put into this code and because Oracle decides to ignore all open source community conventions it is not necessary to lambast my work.

jemiller0 commented 4 years ago

I'm not complaining about your work. I'm complaining about Oracle's incompetence. I have no idea why it would even need a third party DNS resolver. This isn't the first time, random mysterious files have appeared with their driver.

coder2000 commented 4 years ago

My apologies if I misread your statements, I am frustrated with Oracle's misuse of my code as well. They seem to take without giving back.

jemiller0 commented 4 years ago

No need to apologize @coder2000. My comments were rude to begin with. I'm sure you're project is a good one. I'm just in the usual grumpy mood them I'm in when I upgrade NuGet packages and spend a day sorting through random problems. I just had a bad reaction because previously, Oracle added in an SSH library to their driver and I thought to myself, was Oracle's repo compromised or something? I'm assuming they must have added it to support SSH tunneling their connections. Then, I saw it was including a DNS resolver, which made me wonder again if it really was something that was supposed to be included, or, if they mistakenly checked in hacked code or something.

coder2000 commented 4 years ago

We can share in our distaste of Oracle. :) I can't even remember the last time I used MySQL but it was before Oracle bought Sun. PostgreSQL is 10000000% better IMHO and will be the one I choose.

pinalrafael commented 4 years ago

Estava com esse mesmo problema, fiz essa biblioteca https://www.nuget.org/packages/CPSysUDB/ usando o Mysql no desktop e testes funcionou perfeitamente mas quando fui testar em um projeto web deu o erro ai instalei no pacote Ubiety.Dns.Core e funcionou