Closed popcatalin81 closed 4 months ago
Interesting, haven't seen this before. What's even more interesting is that the output doesn't seem to suggest that those two arguments are being passed to the DacpacTool
, yet that seems to be the complaint of the tool. Can you reproduce this on your local machine? Also do you have a diff you can share with the changes to the workflow? Maybe that will give us some points as to where to look for this issue.
Can you share your .csproj?
This is the .csproj file
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="MSBuild.Sdk.SqlProj/2.6.1">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputPath>..\[Redacted].Database.Admin\bin</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<SqlServerVersion>Sql140</SqlServerVersion>
<AllowSnapshotIsolation>True</AllowSnapshotIsolation>
<ReadCommittedSnapshot>True</ReadCommittedSnapshot>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
</PropertyGroup>
<ItemGroup>
<Content Include="..\[Redacted].Database.Admin\**\*.sql" Exclude="..\[Redacted].Database.Admin\bin\**;..\[Redacted].Database.Admin\obj\**;..\[Redacted].Database.Admin\Script.*;..\[Redacted].Database.Admin\SeedData\**" />
<RefactorLog Include="..\[Redacted].Database.Admin\**\*.refactorlog" Exclude="..\[Redacted].Database.Admin\bin\**;..\[Redacted].Database.Admin\obj\**" />
<None Include="..\[Redacted].Database.Admin\**\*.publish.xml" Exclude="..\[Redacted].Database.Admin\bin\**;..\[Redacted].Database.Admin\obj\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\[Redacted].Database.Admin\**\*.sql" Exclude="..\[Redacted].Database.Admin\bin\**;..\[Redacted].Database.Admin\obj\**;..\[Redacted].Database.Admin\Script.*;"></None>
</ItemGroup>
<ItemGroup>
<Content Remove="..\[Redacted].Database.Admin\dbo\Tables\Alert.sql" />
</ItemGroup>
<ItemGroup>
<None Remove="..\[Redacted].Database.Admin\dbo\Tables\Alert.sql" />
</ItemGroup>
<ItemGroup>
<PostDeploy Include="..\[Redacted].Database.Admin\Script.PostDeployment.sql" />
<PreDeploy Include="..\[Redacted].Database.Admin\Script.PreDeployment.sql" />
</ItemGroup>
</Project>
Interesting, haven't seen this before. What's even more interesting is that the output doesn't seem to suggest that those two arguments are being passed to the
DacpacTool
, yet that seems to be the complaint of the tool. Can you reproduce this on your local machine? Also do you have a diff you can share with the changes to the workflow? Maybe that will give us some points as to where to look for this issue.
No, sadly I cannot reproduce this on my local machine. The workflow actions are identical from one to another (copy paste) However the github runner decided to use slighly different images for the workflows:
This fails:
And this one succeeds:
Sadly there's no way to force one image version or another in GH actions.
For future reference:
Found the issue. The build is broken by the github/codeql-action/init@v3 Github's CodeQL code analysis engine. The action adds hooks to the C# compiler in order to determine what C# projects and code to analyze, however it injects some extra parameters in the build process that are passed to the DacpacTool
task (and other tasks as well). But DacpacTool does not support any extra unknown parameters and instead of ignoring them it just throws.
One point of improvement for the future might be for DacpacTool
to have a switch to ignore unknown parameters during build.
How do you mitigate the parsing issue?
How do you mitigate the parsing issue?
I've split the build into two sections, first one builds the Db projects. Then the CodeQL Init action is called, then the build builds the rest of the projects and finally the Code QL analyze action is called, which means the build hooks are not installed when the DB projects are initially built.
@jmezach Wonder if this could be a solution: https://stackoverflow.com/a/76108416/183934
Version : 2.6.1 I'm receiving this strange error when running on Github Actions runner on a new workflow. Strangely the same build works on an older workflow (with exact same parameters). The only difference is the slightly updated
ubuntu-latest
image the runner is using for one workflow but not the other. The error:For the life of me I can't figure out why this is happening. Any suggestions are welcome. Thank you.