Skip to content

[REGRESSION]: UniversalPackagesV0 - Failed to get artifact tool. Artifact tool path was not set by pre-job execution. #21992

@kcsaul

Description

@kcsaul

New issue checklist

Task name

UniversalPackagesV0

Breaking task version

0.272.0

Last working task version

0.270.1

Regression Description

Existing pipelines using this task to conditionally download artifacts are unexpectedly failing with the "Artifact tool path was not set by pre-job execution." due to changes introduced recently under #21939.

It appears this is happening because the pre-job/execution step added is being skipped due to the associated step conditions being evaluated prematurely at the start of the job. The initial steps in the job determine variables that are subsequently checked by the step condition where this task is used to download artifacts. In other words, our existing pipelines only download artifacts when they're needed.

We've got other tasks for which pre-execution steps are also skipped due to conditions, but those tasks don't subsequently fail because something wasn't done during the pre-job - presumably because when those tasks are run, it's able to do what's needed at that point, rather than failing because it wasn't done upfront during the pre-job phase. It'd be preferable if this task were to behave in a similar way - that is, download the artifact tool on demand like it did previously, if it's not already been downloaded during the pre-job/execution step.

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

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows

Relevant log output

2026-04-12T22:54:40.7427673Z ##[section]Starting: *****
2026-04-12T22:54:40.7458898Z ==============================================================================
2026-04-12T22:54:40.7459498Z Task         : Universal packages
2026-04-12T22:54:40.7459875Z Description  : Download or publish Universal Packages
2026-04-12T22:54:40.7460345Z Version      : 0.272.0
2026-04-12T22:54:40.7460695Z Author       : Microsoft Corporation
2026-04-12T22:54:40.7461139Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/package/universal-packages
2026-04-12T22:54:40.7461694Z ==============================================================================
2026-04-12T22:54:41.4715812Z ##[error]Failed to get artifact tool. Artifact tool path was not set by pre-job execution.
2026-04-12T22:54:41.5112030Z ##[section]Finishing: *****

Full task logs with system.debug enabled

UNSUCCESSFUL RUN
 [REPLACE THIS WITH YOUR INFORMATION] 
SUCCESSFUL RUN
 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

Suspect it'd be easy to reproduce using a conditional step that uses this task, which checks a variable set during an initial step (executed after the pre-job/execution steps phase).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions