ephemeral-mongo icon indicating copy to clipboard operation
ephemeral-mongo copied to clipboard

.NET 8.0 CI compatibility

Open vypsim opened this issue 1 year ago • 7 comments

Hi, we're just upgrading our .NET projects to 8.0 and while EphemeralMongo tests still work locally, in the CI pipeline which uses mcr.microsoft.com/dotnet/sdk:8.0 image, it fails with the following error:

Error Message:
#18 69.43    System.TimeoutException : MongoDB connection availability took longer than the specified timeout of 30 seconds. Consider increasing the value of 'ConnectionTimeout'.
#18 69.43   Stack Trace:
#18 69.43      at EphemeralMongo.MongodProcess.StartAndWaitForConnectionReadiness()
#18 69.43    at EphemeralMongo.MongodProcess.Start()
#18 69.43    at EphemeralMongo.MongoRunner.RunInternal()
#18 69.43    at EphemeralMongo.MongoRunner.Run(MongoRunnerOptions options)

Any thoughts on why that could be happening when it worked without issues with .NET 7.0?

vypsim avatar Nov 19 '23 23:11 vypsim

After doing some more digging, I found that mongod requires libssl1.1 which is no longer available in dotnet sdk 8.0 image because it has been upgraded to Debian 12 (Bookworm)

vypsim avatar Nov 20 '23 11:11 vypsim

Just wanted to say a big thank you @vypsim as I spent about a miserable few hours on this today and I would never have fixed it without your insight.

TruffleMuffin avatar Dec 11 '23 19:12 TruffleMuffin

Hi,

If you don't want to install the libssl1.1 maybe you want to use the EphemeralMongo7.runtime.ubuntu.22.04-x64 package.

But looks like there's an issue in this package that throws a System.IO.FileNotFoundException : Could not find mongod in the following paths: '/runtimes/linux-x64/native/mongodb/bin/mongod'**

I posted a simple workaround to this issue here: https://github.com/asimmon/ephemeral-mongo/issues/48#issuecomment-1855951108

wcgomes avatar Dec 14 '23 14:12 wcgomes

This is what helped me for now https://github.com/Mongo2Go/Mongo2Go/issues/149#issuecomment-1863137835

einsteine89 avatar Jan 15 '24 10:01 einsteine89

This is a duplicate of https://github.com/asimmon/ephemeral-mongo/issues/36

slonopotamus avatar Jan 15 '24 10:01 slonopotamus

Hi,

If you don't want to install the libssl1.1 maybe you want to use the EphemeralMongo7.runtime.ubuntu.22.04-x64 package.

But looks like there's an issue in this package that throws a System.IO.FileNotFoundException : Could not find mongod in the following paths: '/runtimes/linux-x64/native/mongodb/bin/mongod'**

I posted a simple workaround to this issue here: #48 (comment)

while this works, it's only a workaround, I would appreciate a proper fix, maybe one that does not depend on "ubuntu" being used as the only linux distribution.

Would it make sense to go completely to libcrypto.so.3 with the linux-x64 runtime and use and make an Minor version upgrade, as those can introduce breaking changes? I mean ubuntu 18.04 already reached EOL in the last year, is it really worth to support it?

616b2f avatar Jan 29 '24 13:01 616b2f

There is currently also the following issue when trying to use the current workaround on > .NET 8 SDK:

warning NETSDK1206: Found version-specific or distribution-specific runtime identifier(s): ubuntu.22.04-x64. Affected libraries: EphemeralMongo7.runtime.ubuntu.22.04-x64. In .NET 8.0 and higher, assets for version-specific and distribution-specific runtime identifiers will not be found by default. See https://aka.ms/dotnet/rid-usage for details.

Ref: https://learn.microsoft.com/en-us/dotnet/core/tools/sdk-errors/netsdk1206

This was already mentionen in this Issue: https://github.com/asimmon/ephemeral-mongo/issues/56

616b2f avatar May 28 '24 07:05 616b2f