Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import bacpac file hangs (mac OS Sonoma 14.0) #24613

Closed
borbiuk opened this issue Oct 7, 2023 · 30 comments
Closed

import bacpac file hangs (mac OS Sonoma 14.0) #24613

borbiuk opened this issue Oct 7, 2023 · 30 comments
Labels
Area - DacFX DacFx features or issues in Azure Data Studio Needs More Info
Milestone

Comments

@borbiuk
Copy link

borbiuk commented Oct 7, 2023

  • Azure Data Studio Version: 1.46.1 and previous ones
  • OS Version: macOS Sonoma 14.0

Steps to Reproduce:

  1. Run SQL Server in docker
    docker run --platform=linux/amd64 -e 'SA_PASSWORD={password}' -e 'ACCEPT_EULA=Y' -v storage:/var/opt/mssql -p 1433:1433 --name ms-sql-server mcr.microsoft.com/mssql/server:2017-latest
  2. Import bacpac file using Data-tier Application Wizard.

Result:
Import bacpac file hangs (the file is successfully imported on Windows by MSSQL).

SQL Server logs:

spid60 Error: 17066, Severity: 16, State: 1.

spid60 SQL Server Assertion: File: <sql\ntdbms\storeng\include\allocationcachemanager.h>, line=419 Failed Assertion = 'm_refCountStack > 0'. This error may be timing-related. If the error persists after rerunning the statement, use DBCC CHECKDB to check the database for structural integrity, or restart the server to ensure in-memory data structures are not corrupted.

spid60 Error: 3624, Severity: 20, State: 1.

spid60 A system assertion check has failed. Check the SQL Server error log for details. Typically, an assertion failure is caused by a software bug or data corruption. To check for database corruption, consider running DBCC CHECKDB. If you agreed to send dumps to Microsoft during setup, a mini dump will be sent to Microsoft. An update might be available from Microsoft in the latest Service Pack or in a Hotfix from Technicsuccessful.

Does this issue occur when all extensions are disabled?: Yes/No

@borbiuk borbiuk changed the title import bacpac file hangs import bacpac file hangs (mac OS Sonoma 14.0) Oct 9, 2023
@kisantia
Copy link
Contributor

kisantia commented Oct 9, 2023

This looks like the sql server instance isn't healthy. Were there any errors when the docker run command was run? What's the output of DBCC CHECKDB?

I ran the same command and tried importing AdventureWorks and it was successful on the latest insiders build, but I'm still on macOS Ventura 13.6.

@kisantia kisantia added the Area - DacFX DacFx features or issues in Azure Data Studio label Oct 10, 2023
@kisantia kisantia added this to the Backlog milestone Oct 10, 2023
@borbiuk
Copy link
Author

borbiuk commented Oct 11, 2023

@kisantia thanks for the response.

I ran into the problem after an update to macOS Sonoma 14.0, everything was working fine before that.

DBCC CHECKDB for environment DB:

  • The database xxxxx could not be exclusively locked to perform the operation.

DBCC CHECKDB for the local DB of my college that uses Windows:

  • CHECKDB found 0 allocation errors and 0 consistency errors in database 'xxxxx'.

Container running as:

  • docker run --platform=linux/amd64 -e 'SA_PASSWORD=xxxxx' -e 'ACCEPT_EULA=Y' -v xxxxx-storage:/var/opt/mssql -p 1433:1433 --name ms-sql-server mcr.microsoft.com/mssql/server:2017-latest

Container logs (the same in case if I create an empty DB nad try import it):

  • spid63 SQL Server Assertion: File: <sql\ntdbms\storeng\include\allocationcachemanager.h>, line=419 Failed Assertion = 'm_refCountStack > 0'. This error may be timing-related. If the error persists after rerunning the statement, use DBCC CHECKDB to check the database for structural integrity, or restart the server to ensure in-memory data structures are not corrupted.
  • spid66 Error: 3624, Severity: 20, State: 1.
  • spid66 A system assertion check has failed. Check the SQL Server error log for details. Typically, an assertion failure is caused by a software bug or data corruption. To check for database corruption, consider running DBCC CHECKDB. If you agreed to send dumps to Microsoft during setup, a mini dump will be sent to Microsoft. An update might be available from Microsoft in the latest Service Pack or in a Hotfix from Technical Support.

@kisantia
Copy link
Contributor

does this happen consistently with the same error if you try to create another docker container? And for other SQL Server versions?

@borbiuk
Copy link
Author

borbiuk commented Oct 11, 2023

yes, I reinstalled docker desktop, tried different versions of mssql server (2017, 2022) and azure-sql-edge:latest.

The same result for all attempts

@borbiuk
Copy link
Author

borbiuk commented Oct 11, 2023

@kisantia

just ran SSMS on parallels - the same error.
I will investigate and let you know later

@henry-bettany
Copy link

I'm now seeing the same error having upgraded to macOS Sonoma. Known-good backups that were working previously are now not working.

I'm using the mcr.microsoft.com/mssql/server:2022-latest image (under Rosetta), but have tried mcr.microsoft.com/mssql/server:2022-CU8-ubuntu-20.04 with the same result.

@kisantia
Copy link
Contributor

@borbiuk @henry-bettany is it only importing a bacpac that's failing or is the sql server instance as a whole not working? Like if you tried to manually run a script to publish the schema of a db (ex: use publish dacpac and generate script) rather than use import bacpac, dose this also not work? From the error message, I'm guessing it would also not work, but want to narrow down the problem if it's DacFx specific or sql server containers on macOs Sonoma

@henry-bettany
Copy link

@borbiuk @henry-bettany is it only importing a bacpac that's failing or is the sql server instance as a whole not working? Like if you tried to manually run a script to publish the schema of a db (ex: use publish dacpac and generate script) rather than use import bacpac, dose this also not work? From the error message, I'm guessing it would also not work, but want to narrow down the problem if it's DacFx specific or sql server containers on macOs Sonoma

It seems to just be the import itself. I've got some pre-Sonoma containers which still work as expected.

@borbiuk
Copy link
Author

borbiuk commented Oct 13, 2023

@kisantia import of dacpac works fine

@kisantia
Copy link
Contributor

Interesting that publishing a dacpac works but importing a bacpac doesn't. One more thing to try - can you try importing the bacpac using sqlpackage? This is the command line tool to perform DacFx operations and if you run it with the /df parameter it will collect logs, so that'll help with debugging where this is failing.

@Oktawski
Copy link

I have the same issue, before the update to Sonoma, importing .bacpac worked everytime. Now it hangs and DB throws Error: 3624

@dzsquared
Copy link
Contributor

hi folks - sorry I took a run at repro-ing this today and haven't been successful. I'm on an M1 machine with Sonoma and SqlPackage 162.0.52.

I've grabbed the latest SQL 2022 container, mounted a volume from my local disk for /var/opt/mssql, and taken an AdventureWorksLT bacpac and imported it a few different ways:

  • via Azure Data Studio
  • via SqlPackage executed on macOS
  • via SqlPackage copied into the container

As @kisantia mentioned, adding /df to the SqlPackage operation is probably the most helpful for us to be able to repro the issue at this point.

The other thing is that since the errors are related to DB inconsistency, I wanted to see if not using a mounted volume clears the problem - so we can isolate the problem at least.

@ghost
Copy link

ghost commented Nov 2, 2023

I had the same issue with multiple .bacpac files again and again.

Upgrading to Sonoma 14.1 solved it for me. See also: microsoft/mssql-docker#858

@dzsquared
Copy link
Contributor

@alexpav-prodyna - we really appreciate you sharing what resolved the issue for you. It looks like at this point the currently GA version of Sonoma is 14.1 and Docker Desktop just released 4.25.0.

@Oktawski, @borbiuk, @henry-bettany - if you are able, will you check if the issue still occurs when updated to Sonoma 14.1?

thank you!

@borbiuk
Copy link
Author

borbiuk commented Nov 2, 2023

@dzsquared maybe by tomorrow (Kyiv time) I will be able to tell you

@Oktawski
Copy link

Oktawski commented Nov 2, 2023

@dzsquared I've already downgraded to Ventura, where it works flawlessly

@henry-bettany
Copy link

@alexpav-prodyna - we really appreciate you sharing what resolved the issue for you. It looks like at this point the currently GA version of Sonoma is 14.1 and Docker Desktop just released 4.25.0.

@Oktawski, @borbiuk, @henry-bettany - if you are able, will you check if the issue still occurs when updated to Sonoma 14.1?

thank you!

I've just upgraded to macOS Sonoma 14.1, and it's working again!

@borbiuk
Copy link
Author

borbiuk commented Nov 2, 2023

@kisantia @dzsquared
updating to macOS Sonoma 14.1 helped ✅

@borbiuk borbiuk closed this as completed Nov 2, 2023
@asgeirgs
Copy link

asgeirgs commented May 26, 2024

I'm running into this exact issue on Sonoma 14.5. Docker Desktop 4.30.0 (149282)

@jseekamp
Copy link

Same issue on Sonoma 14.5 Docker Desktop 4.30.0 (149282). Did you find a solution @asgeirgs?

@asgeirgs
Copy link

Same issue on Sonoma 14.5 Docker Desktop 4.30.0 (149282). Did you find a solution @asgeirgs?

I'm afraid not. Seams the only option is to wait for an update from Apple as with the same bug in 14.0 which was fixed in 14.1.

@henry-bettany
Copy link

Same issue on Sonoma 14.5 Docker Desktop 4.30.0 (149282). Did you find a solution @asgeirgs?

@asgeirgs @jseekamp there's an open issue about this: microsoft/mssql-docker#882

Unfortunately no solutions as of yet.

@asgeirgs
Copy link

Just upgraded to 14.6 Beta (23G5052d). The problem still persists.

@pedrocarloto
Copy link

Hello!
I am having the same issues with Sonoma 14.5 and with docker 4.28.0 (139021).

Are there known workarounds for this problem?

Thank you.

@jseekamp
Copy link

You can still use sql azure edge if you don't need any advanced sql features.

@ErdajtSopjani
Copy link

ErdajtSopjani commented Jun 28, 2024

Still same issue here,

Have tried everything listed above. Docker server works perfectly fine until I try to import a .bacpac file...

Sonoma 15.5 (M3 Pro) - newest version of Docker Desktop

@vitaliiTolmachov
Copy link

vitaliiTolmachov commented Jun 30, 2024

Sonoma 14.5 Applle M2Pro
Running Docker with "Use Rosetta" setting enabled

Followed by this example I was able to import AdventureWorksLT.bacpac by:

  1. Copying db file to docker container
  2. Mounting volumes and running commands from local machine

But using real scenario I faced with error that was only show if you copy the db file and run via exec

docker exec -it sqlfts0 dotnet /opt/sqlpackage/sqlpackage.dll /tsn:localhost /tu:SA /tp:'<some_password>' /A:Import /tdn:<target_db_name> /sf:<source_filename>.bacpac

Error says:

*** An unexpected failure occurred: Data plan execution failed with message One or more errors occurred. (One or more errors occurred. (One or more errors occurred. (Type Udt is not supported on this platform.))).

The source image was build on top of Ubuntu 16.04
Can someone help me to edit THIS Docker file to be able set-up docker-image with:

  • latest mssql server
  • sqlpackage
  • dotnet 8.0 sdk
    to be able to use Udt type during bacpac import?

@nick-cromwell
Copy link

I'm experiencing this on Sonoma 14.5 and Docker 4.31.0, but I may have found a workaround.

  • Attach a volume to your SQL Server container
  • Perform the .bacpac import
  • After you see the error is raised in your docker container logs, cancel the import
  • Bring the container down and back up again

After that, I see the database was recovering and is in a good state. YMMV

@pedrocarloto
Copy link

So, finally some good news with this issue.

It is now solved with the latest docker version: 4.32.0 (157355)
I am using Mac OS Sonoma 14.5

I hope it works for everyone now.

@borbiuk
Copy link
Author

borbiuk commented Jul 16, 2024

@pedrocarloto works for me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area - DacFX DacFx features or issues in Azure Data Studio Needs More Info
Projects
None yet
Development

No branches or pull requests