Closed jwedel closed 1 month ago
I think it's actually related to
https://github.com/microsoft/mssql-docker/issues/881
So this seems to be a problem when MSSQL is running on Ubuntu 24.04 which colima apparently is:
wej2be@colima:/Users/wej2be/.config/colima$ cat /etc/*-release
...
PRETTY_NAME="Ubuntu 24.04 LTS"
...
How much memory does your Colima VM have? Increase it to at least 2GB maybe even 4GB.
So, would it be possible to update to the latest mssql container version and adjust the exec commands? I could provide a PR for the changes, if it helps.
The regression from MS is already addressed in: https://github.com/testcontainers/testcontainers-dotnet/pull/1221.
@HofmeisterAn I start it with colima start --arch x86_64 --cpu 6 --memory 4 --disk 40
, so 4GB.
@HofmeisterAn I start it with
colima start --arch x86_64 --cpu 6 --memory 4 --disk 40
, so 4GB.
👍 I noticed the Total Memory: 4100014080 bytes
as well, but I wanted to double-check because I’ve seen similar issues in the past related to insufficient memory. However, those usually included information about an OOM IIRC. Sorry, I haven’t seen anything like this before — it’s probably an issue with Ubuntu 24.04, like you mentioned.
Now, when I use
mcr.microsoft.com/mssql/server:latest
, it works (starting the container). I don't know which version "latest" actually is as the most recent version2019-CU27-ubuntu-20.04
does NOT work some reason.,
latest
corresponds to: mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04
.
Due to the fact that the Oracle XE test container is only available for x64 architectures ATM
Can't you enable the Virtualization Framework and (install) Rosetta 2 using Docker Desktop?
To eventually get it running, I needed to change the wait strategy (notice the "-C" and the "mssql-tools18"):
As mentioned, this issue has been resolved. There are two workarounds available: https://github.com/testcontainers/testcontainers-dotnet/issues/1220#issuecomment-2249508150 and one of them you are already kind of using.
➜ colima docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=yourStrong\!Password" -e "MSSQL_PID=Evaluation" -p 1433:1433 --name sqlpreview --hostname sqlpreview mcr.microsoft.com/mssql/server:2019-CU18-ubuntu-20.04
Since the container already crashes when using the CLI, I don't think this is specifically a Testcontainers issue. Microsoft or Colima will likely need to address the issue to fix it for older versions. I don't think there's much more I can help with, so I would prefer to close the issue.
latest
corresponds to:mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04
.
oh, I actually tried to find that information, but I couldn’t find a list with hashed to compare. But are you sure about this as ‘latest’ was having that mssql-tools regression you mentioned which I thought appeared in later versions.
Can't you enable the Virtualization Framework and (install) Rosetta 2 using Docker Desktop?
hmm, that is actually an interesting idea. I will try that. I think docker desktop even has a config flag for this. My colleague started this and I think he also found references to Colima in the testcontainers docs.
Since the container already crashes when using the CLI, I don't think this is specifically a Testcontainers issue. Microsoft or Colima will likely need to address the issue to fix it for older versions. I don't think there's much more I can help with, so I would prefer to close the issue.
Yes and know. From what I read, the problem is on mssql side. Colima just uses latest Ubuntu LTS. Mssql does some crazy stuff with memory management always has issues when the kernel changes.
coming back to testcontainers, as I found a way to get it working and I don’t know how long it will take for MS to fix it, I though my hacky changes could find its way into the next release.
as you mentioned, the mstools thing is fixed, so it would only be picking the right CU version.
coming back to testcontainers, as I found a way to get it working and I don’t know how long it will take for MS to fix it, I though my hacky changes could find its way into the next release.
I don't think there are any tasks left. Everything should be addressed in the next release. I'll go ahead and close the issue. If I misunderstood anything, feel free to reopen it.
so it would only be picking the right CU version
As long as you're not depending on an old version, let's hope it gets fixed overall 🤞.
Can't you enable the Virtualization Framework and (install) Rosetta 2 using Docker Desktop?
Just for reference, this does not work. There are a lot of post explaining that as of now you need to use colima to run the oracle on mac. I also just tried it with Docker Desktop and rosetta enabled but the container crashes.
I don't think there are any tasks left. Everything should be addressed in the next release.
Which version of the MSSQL image will be used for the next release?
Which version of the MSSQL image will be used for the next release?
We do not bump module versions to avoid breaking tests for existing Testcontainers users. We recommend that users pin the version according to their needs. Just set and override the image/version using WithImage(string)
.
The advise to pin a version has been around for like forever. I suggest to change the pinned version in the library to a version that it known to work, and everybody that did not pin it, might get an error.
Like mcr.microsoft.com/mssql/server:2019-CU28-ubuntu-20.04
Testcontainers version
3.9.0
Using the latest Testcontainers version?
Yes
Host OS
MacOS
Host arch
ARM
.NET version
8.0.302
Docker version
Docker info
What happened?
Due to the fact that the Oracle XE test container is only available for x64 architectures ATM, we needed to use Colima. The oracle container works fine but the MSSQL does not start, when I just run the used image, I can see the following errors:
Now, when I use
mcr.microsoft.com/mssql/server:latest
, it works (starting the container). I don't know which version "latest" actually is as the most recent version2019-CU27-ubuntu-20.04
does NOT work some reason.,However, this version is not compatible with the test container code.
To eventually get it running, I needed to change the wait strategy (notice the "-C" and the "mssql-tools18"):
Same when executing commands:
So, with this rather ugly hack and hardcoding the credentials, the test container starts and my tests work.
So, would it be possible to update to the latest mssql container version and adjust the exec commands? I could provide a PR for the changes, if it helps.
Relevant log output
No response
Additional information
No response