SQL Server 2008 R2 Data Tier Applications
-
lundi 2 août 2010 03:14
I am using Data Tier Applications in SQL Server 2008 R2. When I use Extract Data Tier Application Wizard, everything works fine and I could create a .dacpac file. But when I tried to deploy the same using the Deploy Data Tier Application Wizard, in the 'Validating contents of DAC File' stage, it gave me an error saying - 'The contents of the .dacpac file (which I created ) are invalid.' 'The stream cannot be read to create DacType'.
Please help me on this. How can I eliminate that error and deploy the DAC ?
- Déplacé Jonathan KehayiasMVP jeudi 8 décembre 2011 18:57 DAC Question (From:SQL Server Database Engine)
Toutes les réponses
-
lundi 2 août 2010 03:48
Look at how your access is configured on the two servers. Do you use Active Directory Groups to provide access on the server having problems? If you do take a look at:
If not, what is the exact error that you get, and the exact steps that you took to get the error?
Jonathan Kehayias
http://sqlblog.com/blogs/jonathan_kehayias/
http://www.twitter.com/SQLSarg
http://www.sqlclr.net/
Please click the Mark as Answer button if a post solves your problem! -
lundi 2 août 2010 04:19I did not get an error while creating a DAC. I could see the .dacpac file created successfully. But when I use Deploy Data Tier Application Wizard , I have to specify the path of .dacpac file to deploy. It then validates the credentials and during the stage - 'Validating the contents of DAC package' its throwing an error - 'The contents of the .dacpac file (which I created ) are invalid.' 'The stream cannot be read to create DacType'.
-
lundi 2 août 2010 05:29Any solution ?
-
mercredi 4 août 2010 07:55Modérateur
Hi kedar,joshi070,
Since error message said: 'The stream cannot be read to create DacType', this issue might be caused by several reasons:
· This file is corrupt
· The current user which start SQL Server has insufficient privilege to access the folder in which this application file is located
if the current account has insufficient privilege in accessing the folder which this application file is located in, it will not read this file correctly and might encounter this issue.Therefor I suggest that you copy this file to another location which the current user has sufficient privilege to access and try to deploy again.
If it still fails, it seems that this application file is corrupt while transferring from development machine to this machine.
Meanwhile if this issue still exists, for further investigation, could you please provide us this application file by sending mail to _sqltnsp_at_microsoft_dot_com_(please replace dot with dot sign) with the following format:
#Sample
Subject: MSDN/TechNet forum question: <Thread Title>
Attachments: <files>
Hi Tom,
ThreadURL:<URL>
<Additional information>
#End
If anything is unclear, please let me know.
-
mardi 10 août 2010 13:21
I gave the current user all the privileges needed but the problem still exists. And if the file is corrupt then what is the solution for this ? I deleted the .dacpac file and then created it again,still it was throwing the same error so I don't think that the file is corrupt.
I am sorry but because of my company's policy I can not send a mail.
Is there any other possible reason for this problem?
-
mardi 10 août 2010 18:27Hello Kedar,
a) Can you please let us know if you are deploying the dacpac to a server with the same build of SQL Server that you extracted from ?
b) Does this happen to any dacpac created from other database, or just to this one particular dacpac ?
c) Can you also please send the full stack by expanding the exception window ?
Thank you,
Shireesh
This posting is provided "AS IS" with no warranties, and confers no rights. -
vendredi 13 août 2010 13:38
a) Yes I am deploying the dacpac to a server with the same build of SQL Server that I extracted from.
b) This is happening with only this particular dacpac files not other dacpac files
c) It's just showing the error message as mentioned above.
Thanks
-
samedi 14 août 2010 14:07
Hello Kedar,
Thanks for the information!
Another question - what's the size of this dacpac file ? is it beyond 1 MB ?
Most of SQL exception message boxes have 'help', 'copy..', 'show techincal details' buttons on the bottom left. If the exception box you see does indeed contain click the 'show technical details' , can you please click it and give the content from that box?
Thank you,
Shireesh
This posting is provided "AS IS" with no warranties, and confers no rights. -
lundi 16 août 2010 07:50
Hello Shireesh,
The size of the file is 432 KB.
The contents of the error message after I clicked 'Show Technical Details' are as follows:-
===================================
Package file 'C:\Users\kjoshi\Documents\SQL Server Management Studio\DAC Packages\ARApp.dacpac' is invalid. (Microsoft.SqlServer.Management.Dac.DacWizard)
------------------------------
Program Location:at Microsoft.SqlServer.Management.Dac.DacWizard.DeployModel.LoadDacPackage()
at Microsoft.SqlServer.Management.Dac.DacWizard.ValidateDacProgressPage.DoWork()
at Microsoft.SqlServer.Management.Dac.DacWizard.ValidateProgressPageBase.validateWorker_DoWork(Object sender, DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)===================================
The stream cannot be read to construct the DacType. (Microsoft.SqlServer.Management.Dac)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1540+)&LinkId=20476------------------------------
Program Location:at Microsoft.SqlServer.Management.Dac.DacType.Load(Stream stream, Boolean typeMetadataOnly)
at Microsoft.SqlServer.Management.Dac.DacType.Load(Stream stream)
at Microsoft.SqlServer.Management.Dac.DacWizard.DeployModel.LoadDacPackage()===================================
Can not access a closed Stream. (System)
------------------------------
Program Location:at System.IO.Compression.DeflateStream.Flush()
at MS.Internal.IO.Packaging.CompressStream.Flush()
at MS.Internal.IO.Packaging.CompressStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at MS.Internal.IO.Zip.ZipIOLocalFileBlock.Dispose(Boolean disposing)
at MS.Internal.IO.Zip.ZipIOLocalFileBlock.Dispose()
at MS.Internal.IO.Zip.ZipIOBlockManager.Dispose(Boolean disposing)
at MS.Internal.IO.Zip.ZipIOBlockManager.Dispose()
at MS.Internal.IO.Zip.ZipArchive.Dispose(Boolean disposing)
at System.IO.Packaging.ZipPackage.Dispose(Boolean disposing)
at System.IO.Packaging.Package.System.IDisposable.Dispose()
at System.IO.Packaging.Package.Close()
at Microsoft.SqlServer.Management.Dac.DacPackage.Close()
at Microsoft.SqlServer.Management.Dac.DacPackage.Dispose()
at Microsoft.SqlServer.Management.Dac.DacType.Load(Stream stream, Boolean typeMetadataOnly)Thanks
-
mardi 17 août 2010 01:07
Hi Kedar,
From the exception stack, it seems like a known issue that we have in SSMS wizards. We plan to fix it in our future releases.
Alternatively, you could try deploying it via Powershell - a detailed blog for doing so is at http://blogs.msdn.com/b/sqlrem/archive/2010/04/28/dac-powershell-samples.aspx . You can use 'Deploy-Dac' script to achieve the same.
Please let us know if the PowerShell module also does not work for you.
Thanks
Shireesh
This posting is provided "AS IS" with no warranties, and confers no rights.- Proposé comme réponse Shireesh Thota - MSFT mardi 17 août 2010 15:56
- Marqué comme réponse Tom Li - MSFTModerator mardi 7 septembre 2010 07:30
-
mardi 17 août 2010 13:39
I will try to do it using Powershell. Thanks
By the way, when will this issue be fixed?
-
mardi 17 août 2010 15:56
Hi Kedar,
Sorry for the trouble. I hope the powershell solution works for you.
The bug is being considered to be fixed for future releases. Unfortunately, I cannot give a more accurate date on this. Please feel free to create a bug on connect.microsoft.com.
Thanks
Shireesh
This posting is provided "AS IS" with no warranties, and confers no rights. -
mardi 24 mai 2011 18:16Same Problem, cannot resolve the problem with the powershell too. How come its a known problem and its not documented ???
-
jeudi 8 décembre 2011 17:17I have the same issue. Is this fixed?
-
jeudi 8 décembre 2011 17:46This is still happening to me. It has been over a year.

