Fix hidden exception in Finalize Job with graceful permission error handling #5243
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses the issue where detailed exception stack traces were being logged during the "Finalize Job" phase when
system.debug
was enabled, even though the job execution continued successfully.Problem
When the Azure Pipelines Agent attempts to archive extension logs from
/var/log/azure/Microsoft.VisualStudio.Services.TeamServicesAgentLinux/
, it sometimes encounters permission issues accessing certain files (like theevents
file). The current implementation catches these exceptions and logs the full stack trace in debug mode, which can be confusing for users:Solution
Added specific exception handling in the
DumpAgentExtensionLogs
method to gracefully handle permission-related errors:false
on permission errors, causing the outer catch block to log "Agent Azure VM extension logs not found. Skipping." instead of detailed exception informationBenefits
system.debug
is enabledThe fix ensures that permission issues are handled gracefully while still providing enough information for debugging purposes.
Fixes #5173.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
03nvsblobprodwcus014.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)055vsblobprodwcus02.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)1g1vsblobprodwcus01.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)3eavsblobprodwcus03.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js
(dns block)3zgvsblobprodwcus024.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)40qvsblobprodwcus022.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)4fdvsblobprodwcus012.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)5tbvsblobprodwcus06.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)61cvsblobprodwcus010.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)73dvsblobprodwcus07.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)8usvsblobprodwcus011.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)9owvsblobprodwcus020.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)arpvsblobprodwcus017.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)crcvsblobprodwcus021.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)fslvsblobprodwcus015.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)uubvsblobprodwcus018.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)vwmvsblobprodwcus016.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)xg1vsblobprodwcus019.vsblob.vsassets.io
dotnet build --configuration Release
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.