Azure Devops pipeline PublishBuildArtifact task Error Container could not be found - azure

I am trying to publish the build artifact in ADO pipeline, But end up with the issue
Failed to upload artifact due to Container could not be found
Earlier the same script was working fine.
Only change I made was set trigger: none instead of trigger: master to stop CI build trigger and to run the pipeline manually.
yaml
trigger:
- master
pool:
vmImage: windows-2019
steps:
- task: NodeTool#0
inputs:
versionSpec: '16.x'
displayName: 'Node.js Install'
- task: Npm#1
inputs:
command: 'install'
workingDir: '$(System.DefaultWorkingDirectory)\OnlineBooking'
- script: |
workingDir: '$(System.DefaultWorkingDirectory)'
node build.js
displayName: 'Build Project'
- task: CopyFiles#2
inputs:
SourceFolder: 'D:\a\1\s\temp\OnlineBooking\build\wap\build'
Contents: 'OnlineBooking.zip'
TargetFolder: '$(build.artifactstagingdirectory)'
CleanTargetFolder: true
- task: PublishBuildArtifacts#1
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: 'OnlineBooking'
Log:
Retry attempt 0. Exception: The container 16892178 could not be found.
2021-08-13T15:05:54.9483088Z Intermittent failure attempting to call the restapis System.Threading.Tasks.Task`1[System.Net.Http.HttpResponseMessage] <AssociateAsync>b__0(). Retry attempt 1. Exception: The container 16892178 could not be found.
2021-08-13T15:05:54.9484146Z Intermittent failure attempting to call the restapis System.Threading.Tasks.Task`1[System.Net.Http.HttpResponseMessage] <AssociateAsync>b__0(). Retry attempt 2. Exception: The container 16892178 could not be found.
2021-08-13T15:05:54.9485219Z Fail to upload 'OnlineBooking/OnlineBooking.zip' due to 'The container 16892178 could not be found.'.
2021-08-13T15:05:54.9487833Z Microsoft.VisualStudio.Services.FileContainer.ContainerNotFoundException: The container 16892178 could not be found.
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.CreateItemForArtifactUpload(Int64 containerId, String itemPath, Guid scopeIdentifier, String artifactHash, Int64 fileLength, CancellationToken cancellationToken, Object userState)
at Microsoft.VisualStudio.Services.Agent.Worker.Build.FileContainerServer.<>c__DisplayClass17_1.<<AssociateAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Services.Agent.Worker.RetryHelper.Retry[T](Func`1 action, Func`2 timeDelayInterval, Func`2 shouldRetryOnException)
at Microsoft.VisualStudio.Services.Agent.Worker.RetryHelper.Retry[T](Func`1 action, Func`2 timeDelayInterval, Func`2 shouldRetryOnException)
at Microsoft.VisualStudio.Services.Agent.Worker.Build.FileContainerServer.AssociateAsync(IAsyncCommandContext context, ConcurrentQueue`1 associateQueue, CancellationToken token)
2021-08-13T15:05:54.9490406Z 1 files failed to upload, retry these files after a minute.
2021-08-13T15:05:54.9490658Z Retry file upload after 60 seconds.
2021-08-13T15:06:00.0088101Z Retry file upload after 55 seconds.
2021-08-13T15:06:05.0568617Z Retry file upload after 50 seconds.
2021-08-13T15:06:10.1177816Z Retry file upload after 45 seconds.
2021-08-13T15:06:15.2097932Z Retry file upload after 40 seconds.
2021-08-13T15:06:19.7734672Z Retry file upload after 35 seconds.
2021-08-13T15:06:24.8510986Z Retry file upload after 30 seconds.
2021-08-13T15:06:29.9148313Z Retry file upload after 25 seconds.
2021-08-13T15:06:34.9479097Z Retry file upload after 20 seconds.
2021-08-13T15:06:40.0238444Z Retry file upload after 15 seconds.
2021-08-13T15:06:45.0731398Z Retry file upload after 10 seconds.
2021-08-13T15:06:50.1178453Z Retry file upload after 5 seconds.
2021-08-13T15:06:55.1807933Z Start retry 1 failed files upload.

I tried your sample yaml(trigger: none), and it works fine with artifact task.
It's recommended to try again to check if it's a temporary issue.
If the issue persists, please confirm:
Change back to "trigger: master", enable CI trigger, will the pipeline work fine?
Does it work for another account(eg: organization owner)?
Tick "Enable system diagnostics" checkbox to get pipeline diagnostic log for a further checking.

Related

Cache task in AzDO is timing out

My cache task fails with a timeout exception, wasn't able to find any information on the web
2021-11-19T13:12:49.5440178Z ##[section]Starting: Cache Maven local repo
2021-11-19T13:12:49.5444463Z ==============================================================================
2021-11-19T13:12:49.5444700Z Task : Cache
2021-11-19T13:12:49.5444880Z Description : Cache files between runs
2021-11-19T13:12:49.5445073Z Version : 2.0.1
2021-11-19T13:12:49.5445247Z Author : Microsoft Corporation
2021-11-19T13:12:49.5445454Z Help : https://aka.ms/pipeline-caching-docs
2021-11-19T13:12:49.5445913Z ==============================================================================
2021-11-19T13:12:50.3859003Z Resolving key:
2021-11-19T13:12:50.3867990Z - maven [string]
2021-11-19T13:12:50.3868628Z - "Linux" [string]
2021-11-19T13:12:50.3869252Z - **/pom.xml [file pattern; matches: 1]
2021-11-19T13:12:50.3870147Z - s/pom.xml --> 425BE14263A590554133E4A4AE3B095D0207EE19CADB68111111A8623073C9
2021-11-19T13:12:50.3870747Z Resolved to: maven|"Linux"|6BG0VLzocHR1ABXQNLQ+q7oxXHj2Ln9xNBME=
2021-11-19T13:12:50.3872532Z Resolving restore key:
2021-11-19T13:12:50.3873112Z - maven [string]
2021-11-19T13:12:50.3873653Z - "Linux" [string]
2021-11-19T13:12:50.3874064Z Resolved to: maven|"Linux"|**
2021-11-19T13:12:50.3874469Z Resolving restore key:
2021-11-19T13:12:50.3874998Z - maven [string]
2021-11-19T13:12:50.3875403Z Resolved to: maven|**
2021-11-19T13:12:50.4071086Z ApplicationInsightsTelemetrySender will correlate events with X-TFS-Session 018d9b8b-7e2e-4eb4-9081-60a8aac6ca19
2021-11-19T13:12:50.4271999Z Getting a pipeline cache artifact with one of the following fingerprints:
2021-11-19T13:12:50.4272751Z Fingerprint: `maven|"Linux"|6BG0VLzocHR1ABXQNLQ+CkcxTTgq7oxXHj2Ln9xNBME=`
2021-11-19T13:12:50.4273230Z Fingerprint: `maven|"Linux"|**`
2021-11-19T13:12:50.4273649Z Fingerprint: `maven|**`
2021-11-19T13:12:51.4866539Z There is a cache hit: `maven|"Linux"|6BG0VLzocHR1ABXQNLQ+CkcxTTgq7oxXHj2Ln9xNBME=`
2021-11-19T13:12:51.4878034Z Used scope: 1506;0fc5062f-55dd-476b-baba-8952a15401e7;refs/heads/EOD_STORES;52820a17-3ace-4f9e-ba77-2330a6eccacb
2021-11-19T13:12:51.5808454Z Entry found at fingerprint: `maven|"Linux"|6BG0VLzocHR1ABXQNLQ+CkcxTTgq7oxXHj2Ln9xNBME=`
2021-11-19T13:13:51.9289494Z [https://vb8vsblobprodsu6weus46.blob.core.windows.net/db908636dc538642c896c6b0557076a854/1F68E25AD7A9B91792F6DE976146515E90F7488470FD5DB9D2166AEB7C2451A201?sv=2019-07-07&sr=b&spr=https&se=2021-11-20T14:07:21Z&sp=r&rscl=x-e2eid-7f1caaa0-030b4341-adf321f6-8515e4e2-session-018d9b8b-7e2e4eb4-908160a8-aac6ca19] Try 1/5, Task was requested to be canceled.
2021-11-19T13:45:52.9504822Z ApplicationInsightsTelemetrySender correlated 3 events with X-TFS-Session 018d9b8b-7e2e-4eb4-9081-60a8aac6ca19
2021-11-19T13:45:52.9581543Z ##[error]Attempt timed out after 00:01:00.
2021-11-19T13:45:52.9618987Z ##[section]Finishing: Cache Maven local repo

WARNING: Uploading artifacts as "archive" to coordinator... failed id=1515 responseStatus=500 Internal Server Error status=500

I'm using Gitlab self server community version ci/cd function, It has been running well, But suddenly one day,All the projects in the gitlab/cicd has failed, it mentions below errors:
Uploading artifacts for successful job
Uploading artifacts...
promotion-api/my-boot-module-system/target/*.jar: found 1 matching files and directories
WARNING: Uploading artifacts as "archive" to coordinator... failed id=1515 responseStatus=500 Internal Server Error status=500 token=xrDFnLeB
WARNING: Retrying... context=artifacts-uploader error=invalid argument
WARNING: Uploading artifacts as "archive" to coordinator... failed id=1515 responseStatus=500 Internal Server Error status=500 token=xrDFnLeB
WARNING: Retrying... context=artifacts-uploader error=invalid argument
WARNING: Uploading artifacts as "archive" to coordinator... failed id=1515 responseStatus=500 Internal Server Error status=500 token=xrDFnLeB
FATAL: invalid argument
ERROR: Job failed: exit code 1
Below is the code in .gitlab-ci.yml
deploy-java:
stage: deploy
dependencies:
- build-java
image:
name: docker/compose:latest
before_script:
- docker info
- docker-compose -v
script:
- cd promotion-api
- docker-compose build
- docker images
- docker ps -a
- docker-compose up -d
tags:
- promotion
2021-3-29:
I switched the runner from linux version to docker, seems all fine till now
You ran into a bug in GitLab itself. Instead of a rather obscure HTTP status 500 it should say what the issue is explicitly. It is likely not a problem in your repository or CI settings.
Follow these issues to find out more:
Artifact is stopped in the transfer, possibly because it takes longer than some timeout to upload: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/26869
Artifact is larger than 1 GB: https://gitlab.com/gitlab-org/gitlab/-/issues/267111
For me the problem was that gitlab had run out of disk-space.
After having deleted unnecessary artifacts and files everything was working correctly again.
You can check your system status (if you host your own gitlab) here: www.gitlab-url.com/admin/system_info
(Go to: Admin Area > Monitoring > System Info)
Hope it helps!

Cannot find downloaded artifact in DownloadBuildArtifact task

I created a pipeline to download and install an artifact from another pipeline. I used DownloadPipelineArtifact task. Here is my yaml:
jobs:
- job: DownloadLeaf
timeoutInMinutes: 180
pool:
vmImage: 'vs2017-win2016'
steps:
- task: DownloadBuildArtifacts#0
inputs:
buildType: 'current'
project: 'Leaf'
pipeline: 'Leaf'
buildVersionToDownload: 'latest'
branchName: 'refs/heads/develop'
downloadType: 'specific'
itemPattern: '**/*.exe'
downloadPath: $(Build.ArtifactStagingDirectory)
- task: CmdLine#2
inputs:
script: |
cd $(Build.ArtifactStagingDirectory)
dir
Apparently the download worked, because using the dir command the artifact has been identified in the folder where the download was made.
However, I switched the download task to DownloadBuildArtifact # 0 because of the warning:##[warning]Please use Download Build Artifact task for downloading Build Artifact type artifact. After this, despite being displayed in a log that the download was successful, I can't find the artifact using the dir command. I cannot identify what I may be doing wrong. Am i doing something wrong?
Here is my DownloadBuildArtifact task:
steps:
- task: DownloadBuildArtifacts#0
inputs:
buildType: 'current'
project: 'Leaf'
pipeline: 'Leaf'
buildVersionToDownload: 'latest'
branchName: 'refs/heads/develop'
downloadType: 'specific'
itemPattern: '**/*.exe'
downloadPath: $(Build.ArtifactStagingDirectory)
- task: CmdLine#2
inputs:
script: |
cd $(Build.ArtifactStagingDirectory)
dir
Raw log:
*2020-10-24T22:25:44.6766419Z ==============================================================================
2020-10-24T22:25:44.6766756Z Task : Download build artifacts
2020-10-24T22:25:44.6767272Z Description : Download files that were saved as artifacts of a completed build
2020-10-24T22:25:44.6767721Z Version : 0.167.2
2020-10-24T22:25:44.6767954Z Author : Microsoft Corporation
2020-10-24T22:25:44.6768343Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/download-build-artifacts
2020-10-24T22:25:44.6768815Z ==============================================================================
2020-10-24T22:25:44.7132255Z ##[debug]Using node path: C:\agents\2.175.2\externals\node\bin\node.exe
2020-10-24T22:25:45.6767362Z ##[debug]agent.TempDirectory=D:\a\_temp
2020-10-24T22:25:45.6799878Z ##[debug]loading inputs and endpoints
2020-10-24T22:25:45.6809455Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2020-10-24T22:25:45.6830354Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2020-10-24T22:25:45.6834904Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2020-10-24T22:25:45.6838469Z ##[debug]loading INPUT_ALLOWPARTIALLYSUCCEEDEDBUILDS
2020-10-24T22:25:45.6841199Z ##[debug]loading INPUT_BRANCHNAME
2020-10-24T22:25:45.6843928Z ##[debug]loading INPUT_BUILDTYPE
2020-10-24T22:25:45.6846813Z ##[debug]loading INPUT_BUILDVERSIONTODOWNLOAD
2020-10-24T22:25:45.6849185Z ##[debug]loading INPUT_DEFINITION
2020-10-24T22:25:45.6851986Z ##[debug]loading INPUT_DOWNLOADPATH
2020-10-24T22:25:45.6854370Z ##[debug]loading INPUT_DOWNLOADTYPE
2020-10-24T22:25:45.6855945Z ##[debug]loading INPUT_ITEMPATTERN
2020-10-24T22:25:45.6859404Z ##[debug]loading INPUT_PARALLELIZATIONLIMIT
2020-10-24T22:25:45.6873519Z ##[debug]loading INPUT_PROJECT
2020-10-24T22:25:45.6876551Z ##[debug]loading INPUT_SPECIFICBUILDWITHTRIGGERING
2020-10-24T22:25:45.6882628Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
2020-10-24T22:25:45.6890968Z ##[debug]loaded 15
2020-10-24T22:25:45.6933342Z ##[debug]Agent.ProxyUrl=undefined
2020-10-24T22:25:45.6934438Z ##[debug]Agent.CAInfo=undefined
2020-10-24T22:25:45.6935114Z ##[debug]Agent.ClientCert=undefined
2020-10-24T22:25:45.6935697Z ##[debug]Agent.SkipCertValidation=undefined
2020-10-24T22:25:45.9788900Z ##[debug]check path : D:\a\_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.167.2\node_modules\artifact-engine\lib.json
2020-10-24T22:25:45.9790062Z ##[debug]adding resource file: D:\a\_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.167.2\node_modules\artifact-engine\lib.json
2020-10-24T22:25:45.9790858Z ##[debug]system.culture=en-US
2020-10-24T22:25:46.1254482Z ##[debug]check path : D:\a\_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.167.2\task.json
2020-10-24T22:25:46.1255912Z ##[debug]adding resource file: D:\a\_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.167.2\task.json
2020-10-24T22:25:46.1258030Z ##[debug]system.culture=en-US
2020-10-24T22:25:46.4230574Z ##[debug]buildType=current
2020-10-24T22:25:46.4234210Z ##[debug]specificBuildWithTriggering=false
2020-10-24T22:25:46.4237891Z ##[debug]buildVersionToDownload=latest
2020-10-24T22:25:46.4240323Z ##[debug]allowPartiallySucceededBuilds=false
2020-10-24T22:25:46.4243177Z ##[debug]branchName=refs/heads/develop
2020-10-24T22:25:46.4246085Z ##[debug]downloadPath=D:\a\1\a
2020-10-24T22:25:46.4250041Z ##[debug]downloadType=specific
2020-10-24T22:25:46.4250962Z ##[debug]tags=null
2020-10-24T22:25:46.4253431Z ##[debug]System.TeamFoundationCollectionUri=https://dev.azure.com/isystemsbr/
2020-10-24T22:25:46.4260547Z ##[debug]SYSTEMVSSCONNECTION auth param AccessToken = ***
2020-10-24T22:25:46.4347429Z ##[debug]VSTS_HTTP_RETRY=undefined
2020-10-24T22:25:46.8211875Z ##[debug]System.TeamProjectId=8c3c84b6-802b-4187-a1bb-b75ac9c7d48e
2020-10-24T22:25:46.8212703Z ##[debug]Build.BuildId=265
2020-10-24T22:25:46.8258573Z Downloading artifacts for build: 265
2020-10-24T22:25:46.8262012Z ##[debug]set BuildNumber=265
2020-10-24T22:25:46.8291773Z ##[debug]Processed: ##vso[task.setvariable variable=BuildNumber;issecret=false;]265
2020-10-24T22:25:46.8987923Z Linked artifacts count: 0
2020-10-24T22:25:46.8992590Z Successfully downloaded artifacts to D:\a\1\a
2020-10-24T22:25:46.8994991Z ##[debug]task result: Succeeded
2020-10-24T22:25:46.9008324Z ##[debug]Processed: ##vso[task.complete result=Succeeded;]
2020-10-24T22:25:46.9143509Z ##[section]Finishing: DownloadBuildArtifacts
2020-10-24T22:25:46.9183934Z ##[debug]Evaluating condition for step: 'CmdLine'
2020-10-24T22:25:46.9186164Z ##[debug]Evaluating: SucceededNode()
2020-10-24T22:25:46.9187490Z ##[debug]Evaluating SucceededNode:
2020-10-24T22:25:46.9188768Z ##[debug]=> True
2020-10-24T22:25:46.9189395Z ##[debug]Result: True
2020-10-24T22:25:46.9189994Z ##[section]Starting: CmdLine
2020-10-24T22:25:46.9610741Z ==============================================================================
2020-10-24T22:25:46.9611091Z Task : Command line
2020-10-24T22:25:46.9611430Z Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2020-10-24T22:25:46.9611980Z Version : 2.177.1
2020-10-24T22:25:46.9612217Z Author : Microsoft Corporation
2020-10-24T22:25:46.9612579Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2020-10-24T22:25:46.9612967Z ==============================================================================
2020-10-24T22:25:48.2360119Z ##[debug]VstsTaskSdk 0.9.0 commit 6c48b16164b9a1c9548776ad2062dad5cd543352
2020-10-24T22:25:48.4556832Z ##[debug]Entering D:\a\_tasks\CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9\2.177.1\cmdline.ps1.
2020-10-24T22:25:48.4707161Z ##[debug]Loading resource strings from: D:\a\_tasks\CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9\2.177.1\task.json
2020-10-24T22:25:48.5034641Z ##[debug]Loaded 6 strings.
2020-10-24T22:25:48.5099803Z ##[debug]SYSTEM_CULTURE: 'en-US'
2020-10-24T22:25:48.5132208Z ##[debug]Loading resource strings from: D:\a\_tasks\CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9\2.177.1\Strings\resources.resjson\en-US\resources.resjson
2020-10-24T22:25:48.5393625Z ##[debug]Loaded 6 strings.
2020-10-24T22:25:48.5873858Z ##[debug]INPUT_FAILONSTDERR: 'false'
2020-10-24T22:25:48.5923127Z ##[debug] Converted to bool: False
2020-10-24T22:25:48.5982469Z ##[debug]INPUT_SCRIPT: 'cd D:\a\1\a
2020-10-24T22:25:48.6062147Z ##[debug]dir'
2020-10-24T22:25:48.6109157Z ##[debug]INPUT_WORKINGDIRECTORY: 'D:\a\1\s'
2020-10-24T22:25:48.6346759Z ##[debug]Asserting container path exists: 'D:\a\1\s'
2020-10-24T22:25:48.6430456Z Generating script.
2020-10-24T22:25:48.6693519Z ##[debug]AGENT_VERSION: '2.175.2'
2020-10-24T22:25:48.6827782Z ##[debug]AGENT_TEMPDIRECTORY: 'D:\a\_temp'
2020-10-24T22:25:48.6866567Z ##[debug]Asserting container path exists: 'D:\a\_temp'
2020-10-24T22:25:48.7195168Z ##[debug]Asserting leaf path exists: 'C:\windows\system32\cmd.exe'
2020-10-24T22:25:48.7219612Z ========================== Starting Command Output ===========================
2020-10-24T22:25:48.7415327Z ##[debug]Entering Invoke-VstsTool.
2020-10-24T22:25:48.7529249Z ##[debug] Arguments: '/D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\34a60bd8-2b0b-4817-a73f-9a15c7a05e67.cmd""'
2020-10-24T22:25:48.7616224Z ##[debug] FileName: 'C:\windows\system32\cmd.exe'
2020-10-24T22:25:48.7648172Z ##[debug] WorkingDirectory: 'D:\a\1\s'
2020-10-24T22:25:48.7742359Z ##[command]"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\34a60bd8-2b0b-4817-a73f-9a15c7a05e67.cmd""
2020-10-24T22:25:48.7991894Z Volume in drive D is Temp
2020-10-24T22:25:48.7992528Z Volume Serial Number is F090-063D
2020-10-24T22:25:48.7993309Z
2020-10-24T22:25:48.7993950Z Directory of D:\a\1\a
2020-10-24T22:25:48.7994230Z
2020-10-24T22:25:48.7994896Z 10/24/2020 10:24 PM <DIR> .
2020-10-24T22:25:48.7995491Z 10/24/2020 10:24 PM <DIR> ..
2020-10-24T22:25:48.7999544Z 0 File(s) 0 bytes
2020-10-24T22:25:48.8000346Z 2 Dir(s) 11,552,690,176 bytes free
2020-10-24T22:25:48.8061024Z ##[debug]Exit code: 0
2020-10-24T22:25:48.8122555Z ##[debug]Leaving Invoke-VstsTool.
2020-10-24T22:25:48.8169679Z ##[debug]Leaving D:\a\_tasks\CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9\2.177.1\cmdline.ps1.
2020-10-24T22:25:48.8756691Z ##[section]Finishing: CmdLine
2020-10-24T22:25:48.8903823Z ##[debug]Evaluating condition for step: 'Checkout core_is/leaf-flowe#leaf/qa to s'
2020-10-24T22:25:48.8909144Z ##[debug]Evaluating: AlwaysNode()
2020-10-24T22:25:48.8910130Z ##[debug]Evaluating AlwaysNode:
2020-10-24T22:25:48.8912646Z ##[debug]=> True
2020-10-24T22:25:48.8913941Z ##[debug]Result: True
2020-10-24T22:25:48.8915107Z ##[section]Starting: Checkout core_is/leaf-flowe#leaf/qa to s
2020-10-24T22:25:48.9124816Z ==============================================================================
2020-10-24T22:25:48.9125153Z Task : Get sources
2020-10-24T22:25:48.9125469Z Description : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-10-24T22:25:48.9125797Z Version : 1.0.0
2020-10-24T22:25:48.9126173Z Author : Microsoft
2020-10-24T22:25:48.9127181Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-10-24T22:25:48.9127812Z ==============================================================================
2020-10-24T22:25:49.5279710Z Cleaning any cached credential from repository: core_is/leaf-flowe (Bitbucket)
2020-10-24T22:25:49.5286724Z ##[debug]Repository url=https://bitbucket.org/core_is/leaf-flowe
2020-10-24T22:25:49.5287323Z ##[debug]targetPath=D:\a\1\s
2020-10-24T22:25:49.5403584Z ##[section]Finishing: Checkout core_is/leaf-flowe#leaf/qa to s
2020-10-24T22:25:49.5493692Z ##[section]Starting: Finalize Job
2020-10-24T22:25:49.5536041Z Cleaning up task key
2020-10-24T22:25:49.5537617Z Start cleaning up orphan processes.
2020-10-24T22:25:49.5637572Z ##[section]Finishing: Finalize Job
2020-10-24T22:25:49.5741505Z ##[debug]Starting diagnostic file upload.
2020-10-24T22:25:49.5741821Z ##[debug]Setting up diagnostic log folders.
2020-10-24T22:25:49.5750076Z ##[debug]Creating diagnostic log files folder.
2020-10-24T22:25:49.5751523Z ##[debug]Creating diagnostic log environment file.
2020-10-24T22:25:50.0152319Z ##[debug]Creating capabilities file.
2020-10-24T22:25:50.0262750Z ##[debug]Copying 1 worker diag logs.
2020-10-24T22:25:50.0330190Z ##[debug]Copying 1 agent diag logs.
2020-10-24T22:25:50.0334272Z ##[debug]Zipping diagnostic files.
2020-10-24T22:25:50.0388793Z ##[debug]Uploading diagnostic metadata file.
2020-10-24T22:25:50.0490506Z ##[debug]Diagnostic file upload complete.
2020-10-24T22:25:50.0565102Z ##[section]Finishing: DownloadLeaf*
#Anton Sizikov,
Thanks for reply, but my problem was another. Unlike Downloadpipelineartifact#2, the DownloadBuildArtifacts#0 task did not work by entering the project name and pipeline for me:
- task: DownloadBuildArtifacts#0
inputs:
buildType: 'current'
project: 'Leaf'
pipeline: 'Leaf'
buildVersionToDownload: 'latest'
branchName: 'refs/heads/develop'
downloadType: 'specific'
itemPattern: '**/*.exe'
downloadPath: $(Build.ArtifactStagingDirectory)
By chance I decided to create the download task through the azure interface, that made the value of the "pipeline" and "project" fields change their value (would it be the ID?).
Anyway, the task looked like this:
- task: DownloadBuildArtifacts#0
inputs:
buildType: 'specific'
project: '8c3c84b6-802b-4187-a1bb-b75ac9c7d48e'
pipeline: '4'
specificBuildWithTriggering: true
buildVersionToDownload: 'latest'
allowPartiallySucceededBuilds: true
downloadType: 'specific'
itemPattern: '**/*.exe'
downloadPath: '$(System.ArtifactsDirectory)'
Know, I can identify my artifact downloaded using dir command.
Based on your log I can see that your artifact was downloaded to $(Build.ArtifactStagingDirectory) directory, which is D:\a\1\a in your case. Then you run dir command there:
Successfully downloaded artifacts to D:\a\1\a
2020-10-24T22:25:48.7993950Z Directory of D:\a\1\a
2020-10-24T22:25:48.7994230Z
2020-10-24T22:25:48.7994896Z 10/24/2020 10:24 PM <DIR> .
2020-10-24T22:25:48.7995491Z 10/24/2020 10:24 PM <DIR> ..
2020-10-24T22:25:48.7999544Z 0 File(s) 0 bytes
2020-10-24T22:25:48.8000346Z 2 Dir(s) 11,552,690,176 bytes free
Download Build Artifacts task works slightly differently comparing to the old task.
It puts the files into a <downloadPath>/<artifact-name> directory. You can see there you've got two of them in your expected path.
This is a known issue.

When using Azure DevOps CI/CD for a Linux web app how can I zip and publish the build artifact as a zip file only instead of copying to directory

Per these instructions I am creating devops project integrating CI/CD for a Linux Web App.
Here is my initial Pipelines pipelines/build job
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool#0
inputs:
versionSpec: '12.x'
displayName: 'Install Node.js'
- script: |
npm install -g #angular/cli
npm install
npm run build:ssr
displayName: 'npm install and build'
- task: CopyFiles#2
inputs:
Contents: |
dist/**
node_modules/**
package.json
TargetFolder: '$(Build.ArtifactStagingDirectory)'
CleanTargetFolder: true
OverWrite: true
- task: PublishBuildArtifacts#1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
When because the CopyFiles#2 task there are 65000 files copying over to the directory to be published in the following PublishBuildArtifacts#1 task.
Because of this I thought I could add the Artifact task after the copy task and this would produce a .zip file and make the deployment more efficient and many times over faster.
However, this was not the case and all it did was serve to zip the folder up, un-zip the folder and proceed to do the same individual file processing like show below. At the time it took me to write this post it has been about 14 minutes and this is how far it has gotten.
Async Command Start: Upload Artifact
Uploading 65244 files
Total file: 65244 ---- Processed file: 69 (0%)
Total file: 65244 ---- Processed file: 200 (0%)
Total file: 65244 ---- Processed file: 333 (0%)
Total file: 65244 ---- Processed file: 460 (0%)
Total file: 65244 ---- Processed file: 603 (0%)
Total file: 65244 ---- Processed file: 746 (1%)
Total file: 65244 ---- Processed file: 884 (1%)
Total file: 65244 ---- Processed file: 1026 (1%)
Total file: 65244 ---- Processed file: 1142 (1%)
Total file: 65244 ---- Processed file: 1268 (1%)
Total file: 65244 ---- Processed file: 1365 (2%)
Total file: 65244 ---- Processed file: 1509 (2%)
Total file: 65244 ---- Processed file: 1672 (2%)
Total file: 65244 ---- Processed file: 1839 (2%)
Total file: 65244 ---- Processed file: 1993 (3%)
Total file: 65244 ---- Processed file: 2188 (3%)
Total file: 65244 ---- Processed file: 2362 (3%)
Total file: 65244 ---- Processed file: 2540 (3%)
Total file: 65244 ---- Processed file: 2701 (4%)
Total file: 65244 ---- Processed file: 2854 (4%)
Total file: 65244 ---- Processed file: 3051 (4%)
Total file: 65244 ---- Processed file: 3256 (4%)
Total file: 65244 ---- Processed file: 3459 (5%)
Total file: 65244 ---- Processed file: 3656 (5%)
Total file: 65244 ---- Processed file: 3836 (5%)
Total file: 65244 ---- Processed file: 4025 (6%)
Total file: 65244 ---- Processed file: 4196 (6%)
Total file: 65244 ---- Processed file: 4385 (6%)
Total file: 65244 ---- Processed file: 4545 (6%)
Total file: 65244 ---- Processed file: 4694 (7%)
Total file: 65244 ---- Processed file: 4864 (7%)
Total file: 65244 ---- Processed file: 5044 (7%)
Total file: 65244 ---- Processed file: 5253 (8%)
Total file: 65244 ---- Processed file: 5422 (8%)
Total file: 65244 ---- Processed file: 5620 (8%)
Is there a way to do what I am looking for? Should I not copy and then zip but rather just zip? Is this because it is the Linux pathway vs the Windows pathway.
As of now this would not be possible to utilize as it would take an hour for a deployment.
Here is the task for the Deploy Azure App Service task
steps:
- task: AzureRmWebAppDeployment#4
displayName: 'Deploy Azure App Service'
inputs:
azureSubscription: '$(Parameters.ConnectedServiceName)'
appType: '$(Parameters.WebAppKind)'
WebAppName: '$(Parameters.WebAppName)'
packageForLinux: '$(System.DefaultWorkingDirectory)/**/**/*.zip'
RuntimeStack: 'NODE|12-lts'
StartupCommand: '$(Parameters.StartupCommand)'
Yes, you can archive a specific folder into a zip, 7z, or tar archive. Then you can publish only the archive as an artifact from the pipeline. Here's an example of archiving the dist, node_modules, and package.json content to a zip and then publishing it as an artifact.
The important bit here is replaceExistingArchive: false on the Archive tasks, this will add each folder/file to the archive. The one exception being if you archive to a compressed TAR file, those are always fully replaced. (Source)
Also the Artifact task just publishes the files so they are acccessible outside of the pipeline, it doesn't compress them into an archive.
steps:
- task: ArchiveFiles#2
displayName: 'Archive Dist Folder'
inputs:
rootFolderOrFile: 'dist'
includeRootFolder: false
archiveFile: '$(Build.ArtifactStagingDirectory)/archive.zip'
replaceExistingArchive: false
- task: ArchiveFiles#2
displayName: 'Archive node_modules Folder'
inputs:
rootFolderOrFile: 'node_modules'
includeRootFolder: false
archiveFile: '$(Build.ArtifactStagingDirectory)/archive.zip'
replaceExistingArchive: false
- task: ArchiveFiles#2
displayName: 'Archive package.json File'
inputs:
rootFolderOrFile: 'package.json'
includeRootFolder: false
archiveFile: '$(Build.ArtifactStagingDirectory)/archive.zip'
replaceExistingArchive: false
- task: PublishBuildArtifacts#1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/archive.zip'
ArtifactName: 'drop'
publishLocation: 'Container'
I wanted to update this answer to include my final solution that worked as of 4/17/2020. Remember things are always changing in the cloud space but as of now this is a full on solution.
Here are my pipeline build steps:
steps:
- task: NodeTool#0
inputs:
versionSpec: '12.x'
displayName: 'Install Node.js'
- script: |
npm install -g #angular/cli
npm install
npm run build:ssr
displayName: 'npm install and build'
- task: ArchiveFiles#2
displayName: 'Archive dist Folder'
inputs:
rootFolderOrFile: 'dist'
includeRootFolder: true
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/archive.zip'
replaceExistingArchive: false
- task: ArchiveFiles#2
displayName: 'Archive node_modules Folder'
inputs:
rootFolderOrFile: 'node_modules'
includeRootFolder: true
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/archive.zip'
replaceExistingArchive: false
- task: ArchiveFiles#2
displayName: 'Archive package.json File'
inputs:
rootFolderOrFile: 'package.json'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/archive.zip'
replaceExistingArchive: false
- task: PublishBuildArtifacts#1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/archive.zip'
ArtifactName: 'drop'
publishLocation: 'Container'
Here is my deploy step in the Releases part of the pipeline when using the task Deploy Azure App Service.
steps:
- task: AzureRmWebAppDeployment#4
displayName: 'Deploy Azure App Service'
inputs:
azureSubscription: '$(Parameters.ConnectedServiceName)'
appType: '$(Parameters.WebAppKind)'
WebAppName: '$(Parameters.WebAppName)'
packageForLinux: '$(System.DefaultWorkingDirectory)/**/**/*.zip'
RuntimeStack: 'NODE|12-lts'
StartupCommand: '$(Parameters.StartupCommand)'
For some reason the yaml says that I have a lot of undefined system variables but that is not true because A. it works and B. I believe that are from your subscription and on the server system.
Lastly make sure to create the proper PM2 start command for your express server or universal angular app server implementation. This is found in the azure portal
npm run serve:ssr
Remember using npm run is for Linux servers as Microsoft Windows uses node run

Gitlab runner artifacts : 405 Method Not allowed

I try to use artifacts on my Gitlab and when my runner try to put my artifact file on Giltlab, i have this message :
WARNING: Uploading artifacts to coordinator... failed id=504 responseStatus=405 Method Not Allowed status=405 Method Not Allowed token=HebbSqMD
WARNING: Retrying...
WARNING: Uploading artifacts to coordinator... failed id=504 responseStatus=405 Method Not Allowed status=405 Method Not Allowed token=HebbSqMD
WARNING: Retrying...
WARNING: Uploading artifacts to coordinator... failed id=504 responseStatus=405 Method Not Allowed status=405 Method Not Allowed token=HebbSqMD
FATAL: invalid argument
ERROR: Job failed: exit code 1
My job is :
build:
stage: build
script:
- echo "Building the app" > out.txt
artifacts:
paths:
- out.txt
Gitlab 8.16 or 8.17 : same probleme
Gitlab runner on other host (docker executor) : 1.11.0 o 1.10.4 : same probleme
Simply, verified artifacts enabled in /etc/gitlab/gitlab.rb file:
## Build Artifacts
# gitlab_rails['artifacts_enabled'] = true
# gitlab_rails['artifacts_path'] = "/mnt/storage/artifacts"

Resources