question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

webapp:'NoneType' object has no attribute 'location' error when missing app service plan - need better error message

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
panchagnulacommented, Aug 3, 2020

@calvinsID can you check if we can add some useful validation on the client side here for ASP create command?

0reactions
calvinsIDcommented, Aug 3, 2020

@ssemyan Thanks for reporting the issue. This has been fixed with PR #14431, and will be in the upcoming CLI release v2.10.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

webapp:'NoneType' object has no attribute 'location' error ...
webapp:'NoneType' object has no attribute 'location' error when missing app service plan - need better error message #14282.
Read more >
Common error troubleshooting for Azure App Service and IIS ...
Provides troubleshooting advice for the most common errors when hosting ASP.NET Core apps on Azure Apps Service and IIS.
Read more >
Deploy an ASP.NET Core app targeting a new version of .NET ...
I have an existing Azure App Service running on ...
Read more >
Azure App Service Plan Tiers - Medium
It's easy to understand how the compute resource is growing between each tier. However, it's not only a matter of compute power or...
Read more >
Creating Windows/Linux Web App terraform: (Site Name ...
I could not find a way to resolve this as the error message was difficult ... The code for the service plan was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found