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

Error 824 while restoring a BACPAC file, where the .MDF gets larger than 4GB, using a bind mount on Windows #916

Open
cezarlamann opened this issue Jan 21, 2025 · 0 comments

Comments

@cezarlamann
Copy link

cezarlamann commented Jan 21, 2025

I ran into this issue today. Here is my scenario:

  • SQL Server 2022-based docker image. The same happens on the vanilla docker image.
  • Docker CE Desktop v4.37.1 on Windows, Hyper-V backend (4 vCPUs, 8gb RAM, 2gb swap, Disk usage limit 160gb - used 10gb)
  • Windows 10 22H2 19045.5371 x64
  • Bind mounting /var/opt/mssql/data to a folder (e.g. -v "C:\\db-files:/var/opt/mssql/data" - NTFS Drive properly shared in Docker)
  • Restoring multiple databases with either SqlPackage or SSMS works, unless the .MDF file gets bigger than 4gb while restoring.
  • Restoring other smaller than 4gb DBs after cancelling the hanging SqlPackage process works OK.
  • Performing the same action while using Docker on a Linux host works without issues.
  • Performing the same action while using Docker on Windows with WSL Backend using the same specs works OK.
  • This specific database has a .MDF file sized at 5.7gb, and a .LDF file sized at 1.3gb.

Expected result

  • All databases attempted restoring via BACPAC file are properly restored

Actual result

  • The restoring procedure never finishes
  • While restoring, if the .MDF file gets bigger than 4GB, SQL Server starts throwing the following errors:
2025-01-21 22:37:47.46 spid65      Starting up database 'Over4gbDatabase'.
2025-01-21 22:37:47.46 spid65      RemoveStaleDbEntries: Cleanup of stale DB entries called for database ID: [5]
2025-01-21 22:37:47.46 spid65      RemoveStaleDbEntries: Cleanup of stale DB entries skipped because master db is not memory optimized. DbId: 5.
2025-01-21 22:37:48.25 spid65      Parallel redo is started for database 'Over4gbDatabase' with worker pool size [2].
2025-01-21 22:37:48.28 spid65      Parallel redo is shutdown for database 'Over4gbDatabase' with worker pool size [2].
2025-01-21 22:38:09.85 spid69      Setting database option ALLOW_SNAPSHOT_ISOLATION to ON for database 'Over4gbDatabase'.
2025-01-21 22:38:09.88 spid69      Setting database option READ_COMMITTED_SNAPSHOT to ON for database 'Over4gbDatabase'.
RecoveryUnit::Shutdown. IsOnline: 02025-01-21 22:38:09.93 spid69      [5]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1. ConcurrentGAMUpdate: 1. ConcurrentSGAMUpdate: 1, CleanupUnderUserTransaction: 0. TranLevelPVS: 0
2025-01-21 22:38:09.93 spid69      Starting up database 'Over4gbDatabase'.
2025-01-21 22:38:09.93 spid69      RemoveStaleDbEntries: Cleanup of stale DB entries called for database ID: [5]
2025-01-21 22:38:09.93 spid69      RemoveStaleDbEntries: Cleanup of stale DB entries skipped because master db is not memory optimized. DbId: 5.
2025-01-21 22:38:10.78 spid69      Parallel redo is started for database 'Over4gbDatabase' with worker pool size [2].
2025-01-21 22:38:10.83 spid27s     Parallel redo is shutdown for database 'Over4gbDatabase' with worker pool size [2].
2025-01-21 22:38:10.86 spid74s     Error: 12412, Severity: 16, State: 1.
2025-01-21 22:38:10.86 spid74s     Internal table access error: failed to access the Query Store internal table with HRESULT: 0x80004005.
2025-01-21 22:38:10.86 spid74s     Error: 12412, Severity: 16, State: 1.
2025-01-21 22:38:10.86 spid74s     Internal table access error: failed to access the Query Store internal table with HRESULT: 0x80004005.
2025-01-21 22:38:13.85 spid69      Setting database option DISABLE_BROKER to ON for database 'Over4gbDatabase'.
2025-01-21 22:38:13.86 spid69      Setting database option target_recovery_time to 120 for database 'Over4gbDatabase'.
2025-01-21 22:38:13.87 spid69      Setting database option query_store max_storage_size_mb to 100 for database 'Over4gbDatabase'.
2025-01-21 22:38:13.90 spid69      Setting database option TEMPORAL_HISTORY_RETENTION to OFF for database 'Over4gbDatabase'.
2025-01-21 22:38:13.91 spid69      Setting database option COMPATIBILITY_LEVEL to 140 for database 'Over4gbDatabase'.
2025-01-21 22:38:25.67 spid19s     Using 'dbghelp.dll' version '4.0.5'
2025-01-21 22:42:47.02 spid73      Error: 823, Severity: 24, State: 2.
2025-01-21 22:42:47.02 spid73      The operating system returned error 38(Reached the end of the file.) to SQL Server during a read at offset 0x000000401d6000 in file '/var/opt/mssql/data\Over4gbDatabase.mdf'. Additional messages in the SQL Server error log and operating system error log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
2025-01-21 22:42:47.02 spid73      Error: 823, Severity: 24, State: 2.
2025-01-21 22:42:47.02 spid73      The operating system returned error 38(Reached the end of the file.) to SQL Server during a read at offset 0x000000401d6000 in file '/var/opt/mssql/data\Over4gbDatabase.mdf'. Additional messages in the SQL Server error log and operating system error log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
2025-01-21 22:42:47.02 spid73      Error: 823, Severity: 24, State: 2.
2025-01-21 22:42:47.02 spid73      The operating system returned error 38(Reached the end of the file.) to SQL Server during a read at offset 0x000000401d6000 in file '/var/opt/mssql/data\Over4gbDatabase.mdf'. Additional messages in the SQL Server error log and operating system error log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
2025-01-21 22:42:47.07 spid73      Autogrow of file 'Over4gbDatabase_Data' in database 'Over4gbDatabase' was cancelled by user or timed out after 21 milliseconds.  Use ALTER DATABASE to set a smaller FILEGROWTH value for this file or to explicitly set a new file size.
2025-01-21 22:42:49.90 Server      Long Sync IO: Scheduler 0 had 1 Sync IOs in nonpreemptive mode longer than 1000 ms
2025-01-21 22:42:49.91 Server      Long Sync IO: Scheduler 3 had 1 Sync IOs in nonpreemptive mode longer than 1000 ms
2025-01-21 22:42:51.93 spid67      Error: 824, Severity: 24, State: 2.
2025-01-21 22:42:51.93 spid67      SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 1:47488; actual 0:0). It occurred during a read of page (1:47488) in database ID 5 at offset 0x00000017300000 in file '/var/opt/mssql/data\Over4gbDatabase.mdf'.  Additional messages in the SQL Server error log or operating system error log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see https://go.microsoft.com/fwlink/?linkid=2252374.
2025-01-21 22:42:51.94 spid67      Error: 824, Severity: 24, State: 2.
2025-01-21 22:42:51.94 spid67      SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 1:48955; actual 0:0). It occurred during a read of page (1:48955) in database ID 5 at offset 0x00000017e76000 in file '/var/opt/mssql/data\Over4gbDatabase.mdf'.  Additional messages in the SQL Server error log or operating system error log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see https://go.microsoft.com/fwlink/?linkid=2252374.
  • After another attempt, I could see a different error:
2025-01-21 23:12:50.22 spid79      Error: 1105, Severity: 17, State: 2.
2025-01-21 23:12:50.22 spid79      Could not allocate space for object 'dbo.SORT temporary run storage:  422212584931328' in database 'Over4gbDatabase' because the 'PRIMARY' filegroup is full due to lack of storage space or database files reaching the maximum allowed size. Note that UNLIMITED files are still limited to 16TB. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant