-
Notifications
You must be signed in to change notification settings - Fork 20
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
Microsoft.Data.Tools.Schema.Sql.Deployment.DeploymentFailedException: The Element or Annotation class SqlIndex does not contain the Property class Online #427
Comments
Can you share a bit more about how the dacpac was created? |
I run below command to build and get the dacpac file. dotnet build ddd.sqlproj ddd.sqlproj <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0">
<Sdk Name="Microsoft.Build.Sql" Version="0.1.15-preview" /> |
Please double check your sqlpackage version |
Below is the version info, command I used to get, and location of the sqlpackage.
|
Running into the same issue. There is very little logging about what's actually going wrong It's happening since updating visual studio to the latest version on our azure pipelines agent image. All our database builds are now failing |
Same issue: In the generated .dacpac file we now have a model.xml having with a property 'online' which causes the error message. Sample:
If this line with the 'Online' property does not exist: No problem. ` Using VS 17.9.3: This line exists. The line is written, if you define the index with the option 'ONLINE'. Sample:
|
@Thomas386 great work sherlock. This will probably solve the issue for us. We have exactly 1 index in the project with the online property set nevertheless, this should be fixed |
@Thomas386 is the version of sqlpackage from AzurePipelin agent? This issue only happens if the version sqlpackage used to deploy is older than the version of dacfx used in SQLProject. can you confirm that you get the bug if you try to deploy locally ( not from Azure Pipeline) using sqlpcakge 162.2.111.2? Azure pipeline agents are usually have delay on updating to latest version of sqlpcakge. |
Isn't sql package update included in the visual studio updates? We started seeing the issue after updating visual studio on our own custom image for azure pipelines. Wouldn't this update both sqlproject and sqlpackage? |
We had the same issue crop up today after we patched our build server's Visual Studio to the latest version. Updating our deployer to use the latest 162.2.111 SqlPackage fixed the issue. |
@PaulVrugt when using Azure pipeline for deploy, the sqlpckage is coming from the agent not from Visual Studio and usually there's a delay between when we ship a new sqlpckage and when the agents get the update. VS also uses DacFx to build the project so in your case, you used DacFx 162.2 to build the project, because you updated VS but to deploy you are using 162.1 version of sqlpackge which is coming from Azure pipeline agent. |
@jgillette - When you say upgraded the deployer, are you referring to the Azure DevOps build agent itself to the latest version? |
if using azure pipeline and not using self-hosted agent, you can check the version of image picked by you pipeline and see if it matches the latest image here https://github.com/actions/runner-images?tab=readme-ov-file#faqs |
But we are using a private agent with the latest visual studio installed. We are not using hosted agents. There is no delay because there is only 1 thing (the agent image) to update. Apparently the latest vs update does not include an update of sqlpackage |
@PaulVrugt are you using sqlpackage from VS location? would you please send the path? it's possible that you need to update sqlpackage using https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver16 in your agent |
@llali : Thx for your help. -> We are on old versions and we will fix this now. |
We are using the this is where the issue occurs. It would have been a bit better if the vs included one was used. Anyway, we know the cause now |
The reason why the step isn't able to pick up the sqlpackage.exe in the Visual Studio installation folder is probably located here: Debugging this showed it is looking for the path: I guess the folder structure has changed in any of the visual studio versions. |
haha that simply looks like a bug. It's using the |
I think the debugging conclusion is wrong. |
Well the part I posted is iterating through all elements in the DAC folder and appending sqlpackage.exe. There are no subfolders in the DAC folder for VS 2022. Which results in test-path calls for paths like the one I mentioned. |
@b3go I see! It used to be in a number folder under the VS folder... |
@dzsquared FYI! Do you take a PR to fix this? |
We encountered this issue today with the latest version of the windows-latest VM. Updating our local release agents to use the newest version of sqlpackage resolved the issue. |
Pulling latest SQL package fixed this for us. Thanks |
@dieterQBIT Please share your deployment script/batch file, screenshots are not so helpful |
EasyOffice.deploy_allowdataloss.zip This worked perfectly until I updated to visual studio 17.9.3 |
Did you install using |
I used 'Download and run the DacFramework.msi installer for Windows' under Windows (.NET Framework) |
Can you run the pipeline with diagnostics? It will show you which sqlpackage.exe is used. |
It shows |
@dieterQBIT .NET global tool? Try to update with:
|
This works for me! Thanks a lot! But how is this possible? I never used .NET Core before. |
Someon or some app installed it |
strange...but again, thanks! case closed for me :-) |
Just started happening to us as well last night. For us it is happening in Azure Devops pipelines when deploying DB updates. Not happening in Visual Studio on the latest version 17.9.4 |
@williambuchanan2 own agent or Microsoft hosted? Can you share your task ? |
Microsoft hosted. Had to remove all the "ONLINE =..." from our DB project to get it to deploy. |
@williambuchanan2 can you share the task yaml snippet? |
We aren't using yaml as such. We are using the "SQL Server database deploy" task, but here is the yaml from that: variables: steps:
|
Having same exact error. I'm on VS 2022 17.9.4. If I build with VS 2019 16.11.34, works fine. |
closing this since it's not a dacfx bug |
Resolution Other notes |
@b3go Interested in doing a PR to fix the AzDo task bug? |
@dzsquared Happy to do a PR, but what version number should be returned for the dacFX under VS now that there is no folder with a version number? 999? Or open a .dll file in the folder an extract the number? See the Get-SqlPackageOnTargetMachine method in https://github.com/microsoft/azure-pipelines-extensions/blob/master/TaskModules/powershell/TaskModuleSqlUtility/SqlPackageOnTargetMachines.ps1 |
@ErikEJ I guess you meant me :D I could do a PR but I have the same question about the version number. Also the script seems to be unable to locate sqlpackage.exe if it was installed via Btw I opened an issue in the relevant repo microsoft/azure-pipelines-extensions#1225 |
I did a PR microsoft/azure-pipelines-extensions#1226 |
Hey folks, I have a GitHub Action workflow failing with this error:
Reading through this conversation it seems like it's a mismatch in version of dacfx and sqlpackage.exe? However, I am using the I have tried to use the previous version of dbatools\dbatools.library but this gives me the same error. What am I missing? Thanks in advance! |
@jpomfret - if you add a script step that calls sqlpackage /version, does it return 162.2.111? |
hey @dzsquared
I think that dbatools uses the sqlpackage from the library module - but I'm not exactly sure how this works 🤔 I'll reach out to Chrissy on this too.. |
This topic shouldn't be closed. I had to copy this directory for deployment: |
Steps to Reproduce:
(DacFx/SqlPackage/SSMS/Azure Data Studio)
The text was updated successfully, but these errors were encountered: