microsoft / azure-pipelines-tasks

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

[BUG]: Problem using UsePythonVersion@0 #19632

Open hariharans29 opened 6 months ago

hariharans29 commented 6 months ago

New issue checklist

Task name

UsePythonVersion@0

Task version

0.235.1

Issue Description

UsePythonVersion@0 fails intermittently (fails roughly 50% of the times) on MacOS-13 with a cryptic error (please see logs below).

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

MacOS-13

Relevant log output

2024-03-12T01:55:29.6773840Z ##[debug]Evaluating condition for step: 'Use Python'
2024-03-12T01:55:29.6798990Z ##[debug]Evaluating: SucceededNode()
2024-03-12T01:55:29.6799820Z ##[debug]Evaluating SucceededNode:
2024-03-12T01:55:29.6801040Z ##[debug]=> True
2024-03-12T01:55:29.6802190Z ##[debug]Result: True
2024-03-12T01:55:29.6803110Z ##[section]Starting: Use Python
2024-03-12T01:55:29.6815760Z ==============================================================================
2024-03-12T01:55:29.6816490Z Task         : Use Python version
2024-03-12T01:55:29.6816810Z Description  : Use the specified version of Python from the tool cache, optionally adding it to the PATH
2024-03-12T01:55:29.6817190Z Version      : 0.235.1
2024-03-12T01:55:29.6817550Z Author       : Microsoft Corporation
2024-03-12T01:55:29.6817810Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/tool/use-python-version
2024-03-12T01:55:29.6818290Z ==============================================================================
2024-03-12T01:55:29.7387620Z ##[debug]Using node path: /Users/runner/runners/3.236.1/externals/node20_1/bin/node
2024-03-12T01:55:30.2726110Z ##[debug]agent.TempDirectory=/Users/runner/work/_temp
2024-03-12T01:55:30.2768840Z ##[debug]loading inputs and endpoints
2024-03-12T01:55:30.2826960Z ##[debug]loading INPUT_VERSIONSPEC
2024-03-12T01:55:30.2941930Z ##[debug]loading INPUT_DISABLEDOWNLOADFROMREGISTRY
2024-03-12T01:55:30.3004610Z ##[debug]loading INPUT_ALLOWUNSTABLE
2024-03-12T01:55:30.3039540Z ##[debug]loading INPUT_ADDTOPATH
2024-03-12T01:55:30.3072550Z ##[debug]loading INPUT_ARCHITECTURE
2024-03-12T01:55:30.3104720Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2024-03-12T01:55:30.3135000Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2024-03-12T01:55:30.3232820Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2024-03-12T01:55:30.3234780Z ##[debug]loading SECRET_TELEMETRYGUID
2024-03-12T01:55:30.3268720Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
2024-03-12T01:55:30.3366740Z ##[debug]loaded 10
2024-03-12T01:55:30.3377720Z ##[debug]Agent.ProxyUrl=undefined
2024-03-12T01:55:30.3391250Z ##[debug]Agent.CAInfo=undefined
2024-03-12T01:55:30.3395450Z ##[debug]Agent.ClientCert=undefined
2024-03-12T01:55:30.3400390Z ##[debug]Agent.SkipCertValidation=undefined
2024-03-12T01:55:30.3611860Z ##[debug]Agent.ProxyUrl=undefined
2024-03-12T01:55:30.3713980Z ##[debug]Agent.CAInfo=undefined
2024-03-12T01:55:30.3755650Z ##[debug]Agent.ClientCert=undefined
2024-03-12T01:55:30.3860470Z ##[debug]check path : /Users/runner/work/_tasks/UsePythonVersion_33c63b11-352b-45a2-ba1b-54cb568a29ca/0.235.1/node_modules/azure-pipelines-tool-lib/lib.json
2024-03-12T01:55:30.3867920Z ##[debug]Agent environment resources - Disk: / Available 151728.00 MB out of 306871.00 MB, Memory: Used 9578.00 MB out of 14332.00 MB, CPU: Usage 9.13%
2024-03-12T01:55:30.3897450Z ##[debug]adding resource file: /Users/runner/work/_tasks/UsePythonVersion_33c63b11-352b-45a2-ba1b-54cb568a29ca/0.235.1/node_modules/azure-pipelines-tool-lib/lib.json
2024-03-12T01:55:30.3970220Z ##[debug]system.culture=en-US
2024-03-12T01:55:30.4630230Z dyld[7462]: terminating because inserted dylib ' �    ' could not be loaded: tried: ' � ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS � ' (no such file), ' � ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/1/s/ �  ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file)
2024-03-12T01:55:30.4649880Z ##[debug]task result: Failed
2024-03-12T01:55:30.4664100Z dyld[7462]: tried: ' �    ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS � ' (no such file), ' � ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/1/s/ �  ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file)
2024-03-12T01:55:30.4723160Z ##[error]Unhandled: Command failed: sw_vers -productVersion
dyld[7462]: terminating because inserted dylib ' � ' could not be loaded: tried: ' � ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS � ' (no such file), ' � ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/1/s/ �  ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file)
dyld[7462]: tried: ' � ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS � ' (no such file), ' � ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/1/s/ �  ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file)

2024-03-12T01:55:30.4736870Z ##[debug]Processed: ##vso[task.issue type=error;]Unhandled: Command failed: sw_vers -productVersion
dyld[7462]: terminating because inserted dylib ' � ' could not be loaded: tried: ' � ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS � ' (no such file), ' � ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/1/s/ �  ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file)
dyld[7462]: tried: ' � ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS � ' (no such file), ' � ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/1/s/ �  ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file)

2024-03-12T01:55:30.4740950Z ##[debug]Processed: ##vso[task.complete result=Failed;]Unhandled: Command failed: sw_vers -productVersion
dyld[7462]: terminating because inserted dylib ' � ' could not be loaded: tried: ' � ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS � ' (no such file), ' � ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/1/s/ �  ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file)
dyld[7462]: tried: ' � ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS � ' (no such file), ' � ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/1/s/ �  ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file)

2024-03-12T01:55:30.4822290Z ##[error]Error: Command failed: sw_vers -productVersion
dyld[7462]: terminating because inserted dylib ' � ' could not be loaded: tried: ' � ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS � ' (no such file), ' � ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/1/s/ �  ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file)
dyld[7462]: tried: ' � ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS � ' (no such file), ' � ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/1/s/ �  ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file)

    at checkExecSyncError (node:child_process:890:11)
    at Object.execSync (node:child_process:962:15)
    at Object._getOsVersion (/Users/runner/work/_tasks/UsePythonVersion_33c63b11-352b-45a2-ba1b-54cb568a29ca/0.235.1/osutil.js:14:22)
    at Object.<anonymous> (/Users/runner/work/_tasks/UsePythonVersion_33c63b11-352b-45a2-ba1b-54cb568a29ca/0.235.1/installpythonversion.js:21:27)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
2024-03-12T01:55:30.4832650Z ##[debug]Processed: ##vso[task.issue type=error;]Error: Command failed: sw_vers -productVersion
dyld[7462]: terminating because inserted dylib ' � ' could not be loaded: tried: ' � ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS � ' (no such file), ' � ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/1/s/ �  ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file)
dyld[7462]: tried: ' � ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS � ' (no such file), ' � ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/1/s/ �  ' (no such file), '/Users/runner/work/1/s/ �  ' (no such file)

    at checkExecSyncError (node:child_process:890:11)
    at Object.execSync (node:child_process:962:15)
    at Object._getOsVersion (/Users/runner/work/_tasks/UsePythonVersion_33c63b11-352b-45a2-ba1b-54cb568a29ca/0.235.1/osutil.js:14:22)
    at Object.<anonymous> (/Users/runner/work/_tasks/UsePythonVersion_33c63b11-352b-45a2-ba1b-54cb568a29ca/0.235.1/installpythonversion.js:21:27)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
2024-03-12T01:55:30.5320600Z ##[section]Finishing: Use Python

Full task logs with system.debug enabled

No response

Repro steps

- task: UsePythonVersion@0
    displayName: Use Python 3.11
    inputs:
      versionSpec: 3.11
DmitriiBobreshev commented 6 months ago

Hi @hariharans29, thanks for the feedback, quickly checked the issue and couldn't reproduce it. To make sure that the problem is exactly in the UsePythonVersion, could you please comment other steps in the yml and run only UsePythonVersion task?

Ananta17 commented 5 months ago

+1 Saw the same issue in our pipeline several times as well. Also saw this with script running pip3 install pymsteams. It is a flaky issue and is not reproducible all the time.