gpt4 book ai didi

azure - 由于 'Forbidden',无法上传 Windows dll(使用 PublishBuildArtifacts 到 Azure DevOps)

转载 作者:行者123 更新时间:2023-12-03 03:57:44 32 4
gpt4 key购买 nike

我有一个 Azure 构建管道,它使用我们公司网络中的专用构建计算机。作为管道的一部分,将创建一个 Windows dll 文件和一个 exe 文件。这两个文件都应使用 PublishBuildArtifacts@1 任务上传:

- task:  
inputs:
PathtoPublish: 'batchfiles/SSMD'
ArtifactName: 'ssmd-$(SSMD_VERSION).0.$(Build.BuildId)-$(GIT_VERSION)'
publishLocation: 'Container'

上传windows dll文件时出现以下错误:

Fail to upload 'C:\agent-azure-v2.174.1\_work\1\s\batchfiles\SSMD\SSMD-21.0.0.106.dll' due to 'Forbidden'.

exe文件的上传工作正常。

感谢您的帮助!

<小时/>

详细日志信息:

Starting: PublishBuildArtifacts
==============================================================================
Task : Publish build artifacts
Description : Publish build artifacts to Azure Pipelines or a Windows file share
Version : 1.158.3
Author : Microsoft Corporation
Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/publish-build-artifacts
==============================================================================
Async Command Start: Upload Artifact
Uploading 1 files
Total file: 1 ---- Processed file: 0 (0%)
Total file: 1 ---- Processed file: 0 (0%)
Fail to upload 'C:\agent-azure-v2.174.1\_work\1\s\batchfiles\SSMD\SSMD-21.0.0.106.dll' due to 'Forbidden'.
Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Forbidden
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.VisualStudio.Services.FileContainer.Client.FileContainerHttpClient.UploadFileAsync(Int64 containerId, String itemPath, Stream fileStream, Byte[] contentId, Int64 fileLength, Boolean isGzipped, Guid scopeIdentifier, CancellationToken cancellationToken, Int32 chunkSize, Int32 chunkRetryTimes, Boolean uploadFirstChunk, Object userState)
at Microsoft.VisualStudio.Services.FileContainer.Client.FileContainerHttpClient.UploadFileAsync(Int64 containerId, String itemPath, Stream fileStream, Guid scopeIdentifier, CancellationToken cancellationToken, Int32 chunkSize, Boolean uploadFirstChunk, Object userState, Boolean compressStream)
at Microsoft.VisualStudio.Services.Agent.Worker.Build.FileContainerServer.UploadAsync(IAsyncCommandContext context, Int32 uploaderId, CancellationToken token)

Detail upload trace for file that fail to upload: ssmd-21.0.0.106-gae26b4b/SSMD-21.0.0.106.dll
Begin chunking upload file 'ssmd-21.0.0.106-gae26b4b/SSMD-21.0.0.106.dll', chunk size '4194304 Bytes', total chunks '2'.
Attempt '1' for uploading chunk '1' of file 'ssmd-21.0.0.106-gae26b4b/SSMD-21.0.0.106.dll'.
Generate new HttpRequest for uploading file 'ssmd-21.0.0.106-gae26b4b/SSMD-21.0.0.106.dll', chunk '1' of '2'.
Start uploading file 'ssmd-21.0.0.106-gae26b4b/SSMD-21.0.0.106.dll' to server, chunk '1'.
Chunk '1' attempt '1' of file 'ssmd-21.0.0.106-gae26b4b/SSMD-21.0.0.106.dll' fail to send request to server. Error: Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Forbidden
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.VisualStudio.Services.FileContainer.Client.FileContainerHttpClient.UploadFileAsync(Int64 containerId, String itemPath, Stream fileStream, Byte[] contentId, Int64 fileLength, Boolean isGzipped, Guid scopeIdentifier, CancellationToken cancellationToken, Int32 chunkSize, Int32 chunkRetryTimes, Boolean uploadFirstChunk, Object userState).
Backoff 8.74 seconds before attempt '2' chunk '1' of file 'ssmd-21.0.0.106-gae26b4b/SSMD-21.0.0.106.dll'.

[...]

最佳答案

Fail to upload windows dll due to 'Forbidden' (using PublishBuildArtifacts to Azure DevOps)

根据您的描述,exe文件上传成功,dll文件上传失败。

这意味着我们的任务或管道是正确的。然后结合错误日志:

Fail to upload 'C:\agent-azure-v2.174.1\_work\1\s\batchfiles\SSMD\SSMD-21.0.0.106.dll' due to 'Forbidden'.

因此我们可以推测您的私有(private)构建机器或公司网络应该有一个代理 block .dll 文件。你应该检查一下。

要验证这一点,您可以尝试使用托管代理来验证此问题。

关于azure - 由于 'Forbidden',无法上传 Windows dll(使用 PublishBuildArtifacts 到 Azure DevOps),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63896636/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com