webapp:'NoneType' object has no attribute 'location' error when missing app service plan - need better error message
See original GitHub issueDescribe the bug When creating a web app when the app service plan does not exist, you get the message:
az webapp create: error: 'NoneType' object has no attribute 'location'
However, when running with --debug you can see the error is the app service plan is missing:
msrest.http_logger : {"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Web/serverFarms/myplan' under resource group 'mygroup' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}
We should report the plan is missing so the user knows what is wrong.
To Reproduce Try to create a web app with a non-existing app service plan:
az webapp create --deployment-container-image-name hello-world -g mygroup -p nonexisting-plan -n mywebapp
Expected behavior The user should be told the app service plan specified in the command does not exist instead of telling them “‘NoneType’ object has no attribute ‘location’” which means nothing.
Environment summary az cli
az --version azure-cli 2.8.0
command-modules-nspkg 2.0.3 core 2.8.0 nspkg 3.0.4 telemetry 1.0.4
Python location ‘/opt/az/bin/python3’ Extensions directory ‘/home/scott/.azure/cliextensions’
Python (Linux) 3.6.10 (default, Jun 19 2020, 07:14:24) [GCC 5.4.0 20160609]
Additional context This is the same bug as #6545 which was closed without any action because the issue was not addressed as an un-useful error message
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (8 by maintainers)
Top GitHub Comments
@calvinsID can you check if we can add some useful validation on the client side here for ASP create command?
@ssemyan Thanks for reporting the issue. This has been fixed with PR #14431, and will be in the upcoming CLI release v2.10.0