microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.47k stars 2.6k forks source link

[BUG]: GitHubRelease@1 does not output error message when failing to upload artifacts to release #19599

Open bluecmd opened 6 months ago

bluecmd commented 6 months ago

New issue checklist

Task name

GitHubRelease

Task version

1.227.0

Issue Description

When creating a new release and uploading artifacts, if the upload fails for whatever reason the output is not descriptive.

[..]
2024-03-01T20:00:26.4346923Z Uploaded file successfully: '/agent/_work/1/docker-broadcom-lldp-dbg.tar.gz'
2024-03-01T20:00:26.4352569Z Uploading file: '/agent/_work/1/docker-broadcom-macsec-dbg.tar.gz'.
2024-03-01T20:05:01.2223045Z ##[error]An unexpected error occurred while uploading the file: %s
2024-03-01T20:05:01.2244868Z ##[warning]Can't find loc string for key: CreateReleaseFailed
2024-03-01T20:05:01.2245539Z CreateReleaseFailed
2024-03-01T20:05:01.2246316Z Deleting the release for tag: build-202211-455
2024-03-01T20:05:01.7539361Z Release deleted successfully.
2024-03-01T20:05:01.7540992Z ##[error]Error
2024-03-01T20:05:01.8044627Z ##[section]Finishing: Make Github release with artifacts

This seems to me that there is a real error returned by Github somewhere that is not being outputted, instead the message ##[error]Error is shown. Also, the stray %s seems also like a bug.

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu 20.04

Relevant log output

2024-03-01T19:49:49.4993612Z ##[section]Starting: Make Github release with artifacts
2024-03-01T19:49:49.5019497Z ==============================================================================
2024-03-01T19:49:49.5019710Z Task         : GitHub Release
2024-03-01T19:49:49.5019804Z Description  : Create, edit, or delete a GitHub release
2024-03-01T19:49:49.5019938Z Version      : 1.227.0
2024-03-01T19:49:49.5020042Z Author       : Microsoft Corporation
2024-03-01T19:49:49.5020139Z Help         : https://aka.ms/AA5vv5o
2024-03-01T19:49:49.5020229Z ==============================================================================
2024-03-01T19:49:49.7974981Z Computing changes made in this release...
2024-03-01T19:49:50.1128520Z Fetching the latest non-draft release...
2024-03-01T19:49:51.5207496Z Found the latest non-draft release
2024-03-01T19:49:52.6168676Z Fetching the list of commits since the last published release...
2024-03-01T19:49:52.9510492Z Found the list of changes.
2024-03-01T19:49:52.9524758Z Changes computed successfully.
2024-03-01T19:49:52.9531555Z Creating a release for tag: build-202211-455
2024-03-01T19:49:53.5286914Z Uploading assets...
2024-03-01T19:49:53.5292214Z Searching for file(s) matching '/agent/_work/1/**/target/sonic-broadcom.*'.
2024-03-01T19:49:56.4713806Z Uploading file: '/agent/_work/1/sonic-buildimage.broadcom/target/sonic-broadcom.bin'.
2024-03-01T19:51:34.2630749Z Uploaded file successfully: '/agent/_work/1/sonic-buildimage.broadcom/target/sonic-broadcom.bin'
2024-03-01T19:51:34.2632155Z Uploading file: '/agent/_work/1/sonic-buildimage.broadcom/target/sonic-broadcom.bin.log'.
2024-03-01T19:51:40.4635848Z Uploaded file successfully: '/agent/_work/1/sonic-buildimage.broadcom/target/sonic-broadcom.bin.log'
2024-03-01T19:51:40.4637013Z Searching for file(s) matching '/agent/_work/1/**/target/sonic-aboot-broadcom.*'.
2024-03-01T19:51:43.1420546Z Uploading file: '/agent/_work/1/sonic-buildimage.broadcom/target/sonic-aboot-broadcom.swi'.
2024-03-01T19:52:59.3129255Z Uploaded file successfully: '/agent/_work/1/sonic-buildimage.broadcom/target/sonic-aboot-broadcom.swi'
2024-03-01T19:52:59.3130044Z Uploading file: '/agent/_work/1/sonic-buildimage.broadcom/target/sonic-aboot-broadcom.swi.log'.
2024-03-01T19:53:00.5247120Z Uploaded file successfully: '/agent/_work/1/sonic-buildimage.broadcom/target/sonic-aboot-broadcom.swi.log'
2024-03-01T19:53:00.5248303Z Searching for file(s) matching '/agent/_work/1/**/target/sonic-mellanox.*'.
2024-03-01T19:53:03.2589615Z Uploading file: '/agent/_work/1/sonic-buildimage.mellanox/target/sonic-mellanox.bin'.
2024-03-01T19:54:48.3313746Z Uploaded file successfully: '/agent/_work/1/sonic-buildimage.mellanox/target/sonic-mellanox.bin'
2024-03-01T19:54:48.3328359Z Uploading file: '/agent/_work/1/sonic-buildimage.mellanox/target/sonic-mellanox.bin.log'.
2024-03-01T19:54:49.0374129Z Uploaded file successfully: '/agent/_work/1/sonic-buildimage.mellanox/target/sonic-mellanox.bin.log'
2024-03-01T19:54:49.0375138Z Searching for file(s) matching '/agent/_work/1/**/target/sonic-innovium.*'.
2024-03-01T19:54:51.9399136Z Uploading file: '/agent/_work/1/sonic-buildimage.innovium/target/sonic-innovium.bin'.
2024-03-01T19:56:52.5892113Z Uploaded file successfully: '/agent/_work/1/sonic-buildimage.innovium/target/sonic-innovium.bin'
2024-03-01T19:56:52.5893156Z Uploading file: '/agent/_work/1/sonic-buildimage.innovium/target/sonic-innovium.bin.log'.
2024-03-01T19:56:53.7225477Z Uploaded file successfully: '/agent/_work/1/sonic-buildimage.innovium/target/sonic-innovium.bin.log'
2024-03-01T19:56:53.7226092Z Searching for file(s) matching '/agent/_work/1/docker-*-dbg.tar.gz'.
2024-03-01T19:56:53.7283014Z Uploading file: '/agent/_work/1/docker-broadcom-database-dbg.tar.gz'.
2024-03-01T19:57:37.3789106Z Uploaded file successfully: '/agent/_work/1/docker-broadcom-database-dbg.tar.gz'
2024-03-01T19:57:37.3789650Z Uploading file: '/agent/_work/1/docker-broadcom-dhcp-relay-dbg.tar.gz'.
2024-03-01T19:58:07.0741681Z Uploaded file successfully: '/agent/_work/1/docker-broadcom-dhcp-relay-dbg.tar.gz'
2024-03-01T19:58:07.0744588Z Uploading file: '/agent/_work/1/docker-broadcom-eventd-dbg.tar.gz'.
2024-03-01T19:58:27.9972881Z Uploaded file successfully: '/agent/_work/1/docker-broadcom-eventd-dbg.tar.gz'
2024-03-01T19:58:27.9974171Z Uploading file: '/agent/_work/1/docker-broadcom-fpm-frr-dbg.tar.gz'.
2024-03-01T19:59:02.8689296Z Uploaded file successfully: '/agent/_work/1/docker-broadcom-fpm-frr-dbg.tar.gz'
2024-03-01T19:59:02.8691725Z Uploading file: '/agent/_work/1/docker-broadcom-gbsyncd-broncos-dbg.tar.gz'.
2024-03-01T19:59:30.5153319Z Uploaded file successfully: '/agent/_work/1/docker-broadcom-gbsyncd-broncos-dbg.tar.gz'
2024-03-01T19:59:30.5153841Z Uploading file: '/agent/_work/1/docker-broadcom-gbsyncd-credo-dbg.tar.gz'.
2024-03-01T19:59:57.9558843Z Uploaded file successfully: '/agent/_work/1/docker-broadcom-gbsyncd-credo-dbg.tar.gz'
2024-03-01T19:59:57.9651798Z Uploading file: '/agent/_work/1/docker-broadcom-lldp-dbg.tar.gz'.
2024-03-01T20:00:26.4346923Z Uploaded file successfully: '/agent/_work/1/docker-broadcom-lldp-dbg.tar.gz'
2024-03-01T20:00:26.4352569Z Uploading file: '/agent/_work/1/docker-broadcom-macsec-dbg.tar.gz'.
2024-03-01T20:05:01.2223045Z ##[error]An unexpected error occurred while uploading the file: %s
2024-03-01T20:05:01.2244868Z ##[warning]Can't find loc string for key: CreateReleaseFailed
2024-03-01T20:05:01.2245539Z CreateReleaseFailed
2024-03-01T20:05:01.2246316Z Deleting the release for tag: build-202211-455
2024-03-01T20:05:01.7539361Z Release deleted successfully.
2024-03-01T20:05:01.7540992Z ##[error]Error
2024-03-01T20:05:01.8044627Z ##[section]Finishing: Make Github release with artifacts

Full task logs with system.debug enabled

Not available.

Repro steps

# This is hard to repro as it requires the Github upload to fail.
# Possibly it could be attempted with an artifact that is larger than 2 GiB, which
# I believe is the largest Github size allowed.
#
# That said, here is the configuration used:

    - task: GitHubRelease@1
      displayName: Make Github release with artifacts
      inputs:
        gitHubConnection: github
        repositoryName: kamelnetworks/sonic-buildimage
        action: create
        tagSource: userSpecifiedTag
        tag: 'build-$(Build.SourceBranchName)-$(Build.BuildId)'
        title: '$(Build.SourceBranchName)-v$(Build.BuildId)'
        isPreRelease: true
        addChangeLog: true
        changeLogCompareToRelease: lastNonDraftRelease
        releaseNotesSource: inline
        releaseNotesInline: 'Build version `SONiC.$(Build.SourceBranchName)-kamel.$(Build.BuildId)-$(Build.SourceVersion)`'
        assets: |
          $(Pipeline.Workspace)/**/target/sonic-broadcom.*
          $(Pipeline.Workspace)/**/target/sonic-aboot-broadcom.*
          $(Pipeline.Workspace)/**/target/sonic-mellanox.*
          $(Pipeline.Workspace)/**/target/sonic-innovium.*
          $(Pipeline.Workspace)/docker-*-dbg.tar.gz
github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

bluecmd commented 2 weeks ago

This is still an issue as far as I know