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.

'NoneType' object has no attribute 'id' for az backup protection enable-for-azurefileshare if fileshare already protected

See original GitHub issue

Describe the bug ‘NoneType’ object has no attribute ‘id’ for az backup protection enable-for-azurefileshare if fileshare already protected

To Reproduce

az backup protection enable-for-azurefileshare --azure-file-share $filesharename --policy-name $policyname --storage-account $storageaccount --resource-group $resourcegroup --vault-name $vaultname --subscription $subscription
az backup protection enable-for-azurefileshare --azure-file-share $filesharename --policy-name $policyname --storage-account $storageaccount --resource-group $resourcegroup --vault-name $vaultname --subscription $subscription```

Expected behavior Running command twice with same parameters works so that it is idempotent

Environment summary azure-cli 2.8.0

command-modules-nspkg 2.0.3 core 2.8.0 nspkg 3.0.4 telemetry 1.0.4

Additional context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:16
  • Comments:21 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
mepandcommented, Mar 21, 2021

We are working on making the API response idempotent and tracking it internally. Once the changes are live, we will update the thread. Since there is no immediate action pending on the PG team, closing this thread. Incase you have any further questions or concerns, please feel free to reopen this case or open a new one with reference to this issue.

1reaction
andresgomezfrrcommented, Sep 1, 2020

I have the same problem but the first time that I execute the command az backup protection enable-for-azurefileshare within an unprotected fileshare. Any idea?

The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'id'
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.11.0/libexec/lib/python3.8/site-packages/knack/cli.py", line 215, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.11.0/libexec/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 654, in execute
    raise ex
  File "/usr/local/Cellar/azure-cli/2.11.0/libexec/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/local/Cellar/azure-cli/2.11.0/libexec/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 711, in _run_job
    six.reraise(*sys.exc_info())
  File "/usr/local/Cellar/azure-cli/2.11.0/libexec/lib/python3.8/site-packages/six.py", line 703, in reraise
    raise value
  File "/usr/local/Cellar/azure-cli/2.11.0/libexec/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 688, in _run_job
    result = cmd_copy(params)
  File "/usr/local/Cellar/azure-cli/2.11.0/libexec/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 325, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/Cellar/azure-cli/2.11.0/libexec/lib/python3.8/site-packages/azure/cli/core/__init__.py", line 782, in default_command_handler
    return op(**command_args)
  File "/usr/local/Cellar/azure-cli/2.11.0/libexec/lib/python3.8/site-packages/azure/cli/command_modules/backup/custom_base.py", line 304, in enable_for_azurefileshare
    return custom_afs.enable_for_AzureFileShare(cmd, client, resource_group_name, vault_name, azure_file_share,
  File "/usr/local/Cellar/azure-cli/2.11.0/libexec/lib/python3.8/site-packages/azure/cli/command_modules/backup/custom_afs.py", line 72, in enable_for_AzureFileShare
    container_uri = helper.get_protection_container_uri_from_id(protectable_item.id)
AttributeError: 'NoneType' object has no attribute 'id'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Mute command failing with "AttributeError: 'NoneType' object ...
Wrong key; Bot not logged in, and trying to grab objects from cache; Bot cannot "see" the object. I'm pretty sure you didn't...
Read more >
AttributeError NoneType object has no attribute product
VM backup fails with the INTERNAL65535 error - AttributeError NoneType object has no attribute product. Last updated: Jun 3, 2022.
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 >
'NoneType' object has no attribute 'id' - asdeasoft.net
I am trying to do an eigenanalysis of a building, when I run the analysis, I get the 'NoneType' object has no attribute...
Read more >
Getting 'NoneType' object has no attribute 'id' error - Reddit
If your production database doesn't have any MolecularData items, then it would return a NoneType object with .last, and thus you would not...
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