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:az webapp up -- AttributeError: 'ResourceNotFoundError' object has no attribute 'response'

See original GitHub issue

This is autogenerated. Please review and update as needed.

Describe the bug

Azure failed to install, saying something about the python 2to3 directory. I removed the sym link, cleaned up the install, ran it again without seeing that error. Then I logged in successfully. But, all I get is “Authorization” errors trying to launch the most basic Flask app (the app is mine and works locally). I created the resource/app service manually and tried to start the basic app again, and now I see this error. The exception raised while handling another exception still looks like it’s related to that botched attempt by Azure to install their version of python over my own, so I figured I’d send the feedback. Good luck!

Command Name az webapp up

Errors:

The command failed with an unexpected error. Here is the traceback:
'ResourceNotFoundError' object has no attribute 'response'
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.32.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/appservice/custom.py", line 3997, in webapp_up
    create_app_service_plan(cmd, rg_name, plan, _is_linux, hyper_v=False, per_site_scaling=False, sku=sku,
  File "/usr/local/Cellar/azure-cli/2.32.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/appservice/custom.py", line 1813, in create_app_service_plan
    raise ResourceNotFoundError(err_msg)
azure.cli.core.azclierror.ResourceNotFoundError: App service environment 'myservice' not found in subscription.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.32.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.32.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute
    raise ex
  File "/usr/local/Cellar/azure-cli/2.32.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/local/Cellar/azure-cli/2.32.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 713, in _run_job
    return cmd_copy.exception_handler(ex)
  File "/usr/local/Cellar/azure-cli/2.32.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/appservice/commands.py", line 38, in _ex_handler
    raise ex
  File "/usr/local/Cellar/azure-cli/2.32.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
    result = cmd_copy(params)
  File "/usr/local/Cellar/azure-cli/2.32.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/Cellar/azure-cli/2.32.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/usr/local/Cellar/azure-cli/2.32.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/appservice/custom.py", line 4001, in webapp_up
    if ex.response.status_code == 409:  # catch 409 conflict when trying to create existing ASP in diff location
AttributeError: 'ResourceNotFoundError' object has no attribute 'response'

To Reproduce:

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

  • Put any pre-requisite steps here…
  • az webapp up --resource-group {} --sku {} --name {} --app-service-environment {}

Expected Behavior

Environment Summary

macOS-11.4-x86_64-i386-64bit, Darwin 20.5.0
Python 3.10.1
Installer: HOMEBREW

azure-cli 2.32.0

Additional Context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
szofarcommented, Mar 3, 2022

@StrawnSC Yep, if I remember correctly I think the issue I was having (when I ran into the nested unhandled exception) was I had not properly created an ASE. It was searching for an ASE “myservice” which didn’t exist, since the tutorial I was following for that step called the service “myservice”, and I had erroneously assumed it would just auto-create the “myservice” service.

0reactions
szofarcommented, Mar 4, 2022

@StrawnSC Agreed. That would be a little easier to decipher than nested raised exceptions. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

'NoneType' object has no attribute 'append' error in Django ...
This is happening because items is an empty list therefore you cant append to it. Have you set a session with key 'items'...
Read more >
azure - 'str' object has no attribute 'cloud' - Server Fault
I am developing 1 web app for Azure by PHP. When i deploy this app to Azure by Azure CLI az webapp deployment...
Read more >
azure cli error 'NoneType' object has no attribute ...
Az CLI Error 'NoneType' object has no attribute 'server_farm_id' caused by using the wrong Azure subscription.
Read more >
AttributeError: 'function' object has no attribute - Microsoft Learn
Using protected keywords from the DataFrame API as column names results in a function object has no attribute error message.
Read more >
AttributeError: 'NoneType' object has no attribute 'COOKIES'
AttributeError : 'NoneType' object has no attribute 'COOKIES' ... line 133, in __call__ 2020-10-29 18:29:10,101: response ...
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