LocalDB is not supported on this platform

Vote:
 

I'm new to development on Optimizely CMS and I use macOS. We are currently in the middle of migration from CMS v11 to v12. The new dev environment is using docker and until a few days ago there was no issue in compatibility and no limitations. Now I'm not able to run the project as I get the PlatformNotSupportedException "LocalDB is not supported on this platform". Yet our partners who are technical responsible for this platform, have not made any changes to the database or setup

I get that SQL Server LocalDB is a feature of SQL Server, which is Windows only, that's the solution is containerized which should avoid that issue, and did until now. 

My question is if anyone can think of or know reason why this suddenly could be a problem when it has worked fine until now.

Any help/comment/suggestion is highly appreciated

Thanks

#298355
Mar 15, 2023 7:51
Vote:
 

What does the connection string look like in appSettings.json or appSettings.development.json 

Could what you have here be overriding your env variables ?

#298357
Edited, Mar 15, 2023 9:16
Vote:
 

I already checked if that was the case and no connetionstrings in those files. My ConnectionStrings secrets.json look like his: 

{
"ConnectionStrings:EPiServerDB": "Server=localhost; Database=cmsDb;User Id=sa;Password=Passw0rd!;MultipleActiveResultSets=True;TrustServerCertificate=True"
}
#298360
Mar 15, 2023 9:45
Vote:
 

You got a M1 or similar ARM-based mac?

#298364
Mar 15, 2023 13:06
Vote:
 

It's an ARM based Mac 

#298366
Mar 15, 2023 13:12
Vote:
 

Which images/frameworks do you load into the docker container?

#298367
Mar 15, 2023 13:19
Vote:
 

SQL Server

#298375
Mar 15, 2023 19:02
Eric Herlitz - Mar 15, 2023 19:40
Care to post the dockerfile?
Enock - Mar 16, 2023 8:39
FROM mcr.microsoft.com/mssql/server:2019-latest AS base

ENV ACCEPT_EULA=Y

USER root

WORKDIR /src
COPY ./Docker/create-db.sh .
RUN chmod +x /src/create-db.sh

USER mssql

EXPOSE 1433

ENTRYPOINT /src/create-db.sh & /opt/mssql/bin/sqlservr
Eric Herlitz - Mar 16, 2023 9:22
That SQL sever won't probably work on an ARM mac. Instead use mcr.microsoft.com/azure-sql-edge
Enock - Mar 16, 2023 9:38
What puzzles me is that it has worked before. But what you are saying is also what I have read on my google searches. However it is not possible to change it at this point
Eric Herlitz - Mar 16, 2023 9:52
Maybe it works through emulation, that can however have changed.
Enock - Mar 16, 2023 10:08
Yes that is what I was afraid of.
Enock - Mar 16, 2023 10:15
As mentioned, my ConnectionStrings looks like this "ConnectionStrings:EPiServerDB": "Server=localhost; Database=cmsDb;User Id=sa;Password=Passw0rd!;MultipleActiveResultSets=True;TrustServerCertificate=True" in my user secrets, and through debugging I can see it somehow gets overwritten and then looks like this ""Data Source=(localdb)\\mssqllocaldb;Initial Catalog=EPiServerDB;Integrated Security=True;MultipleActiveResultSets=True"

Any idea how that can be overwritten or where?
Eric Herlitz - Mar 16, 2023 10:55
Either you modify it in appsettings.Development.json or via some injected class, Alloy used to have one of those. Search your code and you'll find it.
Vote:
 

Closing this as I found the cause of the error. Somehow EF created it's own instance of a localdb which caused it to overlook the fact that there was a local connctionstring

#299255
Mar 30, 2023 7:34
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.