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

Cannot insert duplicate key row in object 'Build.tbl_Artifact' with unique index 'IX_Build_tbl_Artifact_BuildId_ArtifactNameId'. The duplicate key value is (1, 161, 7313, 192). #100

Open
AtkinsonHD opened this issue Mar 3, 2022 · 1 comment

Comments

@AtkinsonHD
Copy link

Hi keep getting an issue where we get duplicates in the build.tbl_artififact but I have no idea why.

Dependency Check completed with exit code 0.
Dependency Check reports:
 'C:\\agentA\\_work\\2\\TestResults\\dependency-check\\dependency-check-report.html',
 'C:\\agentA\\_work\\2\\TestResults\\dependency-check\\dependency-check-report.json',
  'C:\\agentA\\_work\\2\\TestResults\\dependency-check\\dependency-check-report.xml' ]
 Dependency Check succeeded with message "Dependency Check succeeded"
Ending Dependency Check...
 ##[section]Async Command Start: Upload Artifact
 Uploading 1 files
File upload succeed.
 'C:\agentA\_work\2\TestResults\dependency-check\dependency-check-report.html' to file container: '#/36563/dependency-check'
 ##[section]Async Command End: Upload Artifact
 ##[error]Cannot insert duplicate key row in object 'Build.tbl_Artifact' with unique index 'IX_Build_tbl_Artifact_BuildId_ArtifactNameId'. The duplicate key value is (1, 161, 7313, 192).
 ##[section]Async Command Start: Upload Artifact
Uploading 1 files
 File upload succeed.
 Upload 'C:\agentA\_work\2\TestResults\dependency-check\dependency-check-report.json' to file container: '#/36563/dependency-check'
 Associated artifact 1627 with build 7313
 ##[section]Async Command End: Upload Artifact
 ##[section]Async Command Start: Upload Artifact
 Uploading 1 files
File upload succeed.
 Upload 'C:\agentA\_work\2\TestResults\dependency-check\dependency-check-report.xml' to file container: '#/36563/dependency-check'
 Associated artifact 1627 with build 7313
 ##[section]Async Command End: Upload Artifact
 ##[section]Finishing: Dependency Check

Spotted my versions has "Report Filename" - Report output filename. Will set the report output name in 'reportsDirectory' to specified filename. Will not work if format is ALL, or multiple formats are supplied to the 'format' parameter. Filename must have an extension or dependency-check will assume it is a path.

Can this be used to alter something?
We actually upload our reports directly to sonarcube so we dont actually need them as atifacts, so could this feature be disabled with an override?

@jtbatzer
Copy link

jtbatzer commented Nov 9, 2023

I also received this error today

##[debug]File: 'E:\TFSBuild_Directory\39\TestResults\dependency-check\dependency-check-report.html' took 203 milliseconds to finish upload
##[debug]Detail upload trace for file: dependency-check/dependency-check-report.html
##[debug]File 'dependency-check/dependency-check-report.html' will be uploaded in one chunk.
##[debug]Attempt '1' for uploading chunk '1' of file 'dependency-check/dependency-check-report.html'.
##[debug]Generate new HttpRequest for uploading file 'dependency-check/dependency-check-report.html', chunk '1' of '1'.
##[debug]Start uploading file 'dependency-check/dependency-check-report.html' to server, chunk '1'.
##[debug]Finished upload chunk '1' of file 'dependency-check/dependency-check-report.html', elapsed 132 (ms), response code 'Created'.
File upload succeed.
Upload 'E:\TFSBuild_Directory\39\TestResults\dependency-check\dependency-check-report.html' to file container: '#/28444/dependency-check'
Async Command End: Upload Artifact
##[error]Cannot insert duplicate key row in object 'Build.tbl_Artifact' with unique index 'IX_Build_tbl_Artifact_BuildId_ArtifactNameId'. The duplicate key value is (1, 99, 8537, 15).
##[debug]Microsoft.VisualStudio.Services.Common.VssServiceException: Cannot insert duplicate key row in object 'Build.tbl_Artifact' with unique index 'IX_Build_tbl_Artifact_BuildId_ArtifactNameId'. The duplicate key value is (1, 99, 8537, 15).
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.TeamFoundation.Build.WebApi.BuildHttpClientCompatBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken, Func`3 processResponse)
   at Microsoft.TeamFoundation.Build.WebApi.BuildHttpClientCompatBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken, Func`3 processResponse)
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.BuildServer.AssociateArtifactAsync(Int32 buildId, Guid projectId, String name, String jobId, String type, String data, Dictionary`2 propertiesDictionary, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.ArtifactCommandExtensionUtil.UploadArtifactAsync(IAsyncCommandContext context, VssConnection connection, Guid projectId, Int64 containerId, String containerPath, Int32 buildId, String name, String jobId, Dictionary`2 propertiesDictionary, String source, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.Agent.Worker.AsyncCommandContext.WaitAsync()
   at Microsoft.VisualStudio.Services.Agent.Worker.StepsRunner.RunStepAsync(IStep step, CancellationToken jobCancellationToken)
Async Command Start: Upload Artifact

Any progress on this issue?

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

2 participants