0

I have a task

  - task: UsePythonVersion@0
    inputs:
      versionSpec: '3.13.x'
      addToPath: true
      architecture: 'x64'
    displayName: 'Use Python 3.13'

This task WORKS(!) on five of my machines but doesn't work on another 4.

These machines are near identical. Of the machines that are working they're all running windows 10, one working machine is using a domain service account, 4 of them are using the local Administrator account. Of the machines that aren't they're all using the domain service account. I am getting these errors:

Downloading: https://github.com/actions/python-versions/releases/download/3.13.3-14344076652/python-3.13.3-win32-x64.zip
Extracting archive
C:\WINDOWS\system32\chcp.com 65001
Active code page: 65001
C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('E:\agents\US99-APOLLO\_work\_temp\python-3.13.3-win32-x64.zip', 'E:\agents\US99-APOLLO\_work\_temp\29591c42-0639-4f39-b8ba-35d99b52a9a0')"
C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe ./setup.ps1
Check if Python hostedtoolcache folder exist...
Check if current Python version is installed...
Python3.13 (x64) was found in E:\agents\US99-APOLLO\_work\_tool\Python...
Deleting E:\agents\US99-APOLLO\_work\_tool\Python\3.13.3\x64...
Remove registry entries for Python 3.13(x64)...
Remove-Item : Requested registry access is not allowed.
At E:\agents\US99-APOLLO\_work\_temp\29591c42-0639-4f39-b8ba-35d99b52a9a0\setup.ps1:36 char:17
+ ...             Remove-Item -Path $key.PSParentPath -Recurse -Force -Verb ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (HKEY_LOCAL_MACH...1-5-18\Products:String) [Remove-Item], SecurityExce 
   ption
    + FullyQualifiedErrorId : System.Security.SecurityException,Microsoft.PowerShell.Commands.RemoveItemCommand
 
Remove-Item : Requested registry access is not allowed.
At E:\agents\US99-APOLLO\_work\_temp\29591c42-0639-4f39-b8ba-35d99b52a9a0\setup.ps1:36 char:17
+ ...             Remove-Item -Path $key.PSParentPath -Recurse -Force -Verb ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (HKEY_LOCAL_MACH...1-5-18\Products:String) [Remove-Item], SecurityExce 
   ption
    + FullyQualifiedErrorId : System.Security.SecurityException,Microsoft.PowerShell.Commands.RemoveItemCommand
 
Remove-Item : Requested registry access is not allowed.
At E:\agents\US99-APOLLO\_work\_temp\29591c42-0639-4f39-b8ba-35d99b52a9a0\setup.ps1:36 char:17
+ ...             Remove-Item -Path $key.PSParentPath -Recurse -Force -Verb ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (HKEY_LOCAL_MACH...1-5-18\Products:String) [Remove-Item], SecurityExce 
   ption
    + FullyQualifiedErrorId : System.Security.SecurityException,Microsoft.PowerShell.Commands.RemoveItemCommand
 
Remove-Item : Requested registry access is not allowed.
At E:\agents\US99-APOLLO\_work\_temp\29591c42-0639-4f39-b8ba-35d99b52a9a0\setup.ps1:36 char:17
+ ...             Remove-Item -Path $key.PSParentPath -Recurse -Force -Verb ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (HKEY_LOCAL_MACH...1-5-18\Products:String) [Remove-Item], SecurityExce 
   ption

But this registry deletion works on other machines. In fact, I set permissions to the paths being deleted explicitly and ended up with these errors under those paths:

C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('E:\AGENTS\US99-POSEIDON\_work\_temp\python-3.13.3-win32-x64.zip', 'E:\AGENTS\US99-POSEIDON\_work\_temp\51b9e1dc-43d4-401d-b546-18c47accf741')"
C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe ./setup.ps1
Check if Python hostedtoolcache folder exist...
Check if current Python version is installed...
Python3.13 (x64) was found in E:\AGENTS\US99-POSEIDON\_work\_tool\Python...
Deleting E:\AGENTS\US99-POSEIDON\_work\_tool\Python\3.13.3\x64...
Remove registry entries for Python 3.13(x64)...
VERBOSE: Performing the operation "Remove Key" on target "Item: 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\5F7602B6BBAFD5E47996C
A1F88A62718".
Remove-Item : Cannot delete a subkey tree because the subkey does not exist.
At E:\AGENTS\US99-POSEIDON\_work\_temp\51b9e1dc-43d4-401d-b546-18c47accf741\setup.ps1:36 char:17
+ ...             Remove-Item -Path $key.PSParentPath -Recurse -Force -Verb ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (HKEY_LOCAL_MACH...996CA1F88A62718:String) [Remove-Item], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.RemoveItemCommand
 
VERBOSE: Performing the operation "Remove Key" on target "Item: 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\8224E8E5B121AE94C92C8
B3EBCDE0508".
Remove-Item : Cannot delete a subkey tree because the subkey does not exist.
At E:\AGENTS\US99-POSEIDON\_work\_temp\51b9e1dc-43d4-401d-b546-18c47accf741\setup.ps1:36 char:17
+ ...             Remove-Item -Path $key.PSParentPath -Recurse -Force -Verb ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (HKEY_LOCAL_MACH...92C8B3EBCDE0508:String) [Remove-Item], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.RemoveItemCommand
 

I'm a bit beyond my wits end trying to figure out what is different about the machine that's working with the service account from the machine that isn't. Does anyone have any suggestions for debugging this?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.