Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

az lab create vm command fails with "The system cannot find the file specified." error #24233

Closed
DanielBrown-ranger1968 opened this issue Oct 17, 2022 · 4 comments
Assignees
Labels
Auto-Assign Auto assign by bot Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. CXP Attention This issue is handled by CXP team. Devtestlab az lab question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@DanielBrown-ranger1968
Copy link

This is autogenerated. Please review and update as needed.

Describe the bug

The command works in Azure CLI 2.40 but fails in 2.41

Command Name

az lab vm create --lab-name $LabName --resource-group $LabResourceGroup `
                --image-type custom `
                --image $image.name `
                --name $VMName `
                --size $VMSize `
                --disk-type 'Premium' `
                --admin-username $VMAdminUser `
                --admin-password $VmAdminPassword `
                --debug

Errors:

az : The system cannot find the file specified.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

We have a PowerShell script that executes this CLI command to create a DevTest lab VM from an existing custom image.
When run under Azure CLI 2.40, it succeeds but it fails when using CLI 2.41.
This script is part of an Azure DevOps pipeline and started failing when the hosted Azure Pipelines agents were updated to Azure CLI 2.41 recently.

I have no idea what file it is referring to in the error.

Expected Behavior

The specified VM is created in the DevTest Lab

Environment Summary

Windows-10-10.0.22623-SP0
Python 3.10.5
Installer: MSI

azure-cli 2.41.0

Extensions:
azure-devops 0.25.0
image-gallery 0.1.3
vm-repair 0.4.6

Dependencies:
msal 1.20.0b1
azure-mgmt.-resource 21.1.0b1

Additional Context

@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot CXP Attention This issue is handled by CXP team. Devtestlab az lab labels Oct 17, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Oct 17, 2022

route to CXP team

@PramodValavala-MSFT PramodValavala-MSFT self-assigned this Oct 18, 2022
@PramodValavala-MSFT PramodValavala-MSFT added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Client This issue points to a problem in the data-plane of the library. needs-author-feedback More information is needed from author to address the issue. labels Oct 18, 2022
@PramodValavala-MSFT
Copy link
Contributor

@DanBrown-TechSmith Could you share the complete output that you see? Also, try running the command by passing --debug to enable debug logs as well.

@DanielBrown-ranger1968
Copy link
Author

DanielBrown-ranger1968 commented Oct 18, 2022

After further experimentation, I have determined that the issue is related to the transition from a CMD launch script and a PS1 launch script for the AZ commands. It relates to this issue #24015.
The 2.40 CLI ends up using the az.ps1 script whereas 2.41 uses the az.cmd due to the rename of the PS1 script as detailed in that issue.
If I replace az lab vm create with azps lab vm create when using 2.41, it works fine.

This is the extent of the debug output:

az : The system cannot find the file specified.
At D:\Projects_Git\TechSmith\Tools-Build-DTL\scripts\CreateLabVMFromImage.ps1:229 char:17
+ ...             az lab vm create --lab-name $LabName --resource-group $La ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (The system cann...file specified.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

The really odd thing is that it only seems to be that specific command that fails since we run other az lab commands in the same script without issue.

@ghost ghost added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels Oct 18, 2022
@PramodValavala-MSFT
Copy link
Contributor

@DanBrown-TechSmith Thanks for sharing your findings here! That is odd to see that only one command fails, and like I've thought earlier, the error is about not finding az itself.

Glad to see that you have resolved your immediate issue! You could perhaps try a clean install of Azure CLI just to make sure everything is correct or try out some of the checks here. Closing this issue.

@PramodValavala-MSFT PramodValavala-MSFT removed the needs-team-attention This issue needs attention from Azure service team or SDK team label Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. CXP Attention This issue is handled by CXP team. Devtestlab az lab question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants