Azure / azure-cli-extensions

Public Repository for Extensions of Azure CLI.
https://docs.microsoft.com/en-us/cli/azure
MIT License
376 stars 1.16k forks source link

Azure AEM extension issue #3117

Open ankit2809 opened 3 years ago

ankit2809 commented 3 years ago

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az vm aem set Extension Name: aem. Version: 0.1.1.

Errors:

'str' object has no attribute 'value'
Traceback (most recent call last):
python3.6/site-packages/knack/cli.py, ln 233, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 660, in execute
    raise ex
cli/core/commands/__init__.py, ln 723, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
cli/core/commands/__init__.py, ln 716, in _run_job
    six.reraise(*sys.exc_info())
...
cliextensions/aem/azext_aem/custom.py, ln 31, in set_aem
    skip_storage_analytics=skip_storage_analytics)
cliextensions/aem/azext_aem/custom.py, ln 57, in __init__
    os_type = self._vm.storage_profile.os_disk.os_type.value.lower()
AttributeError: 'str' object has no attribute 'value'

To Reproduce:

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

Expected Behavior

Environment Summary

Linux-4.15.0-1108-azure-x86_64-with-debian-10.2 (Cloud Shell)
Python 3.6.10
Installer: DEB

azure-cli 2.20.0

Extensions:
aem 0.1.1
ai-examples 0.2.5

Additional Context

yungezz commented 3 years ago

hi @MSSedusch could you pls look at the issue?

ankit2809 commented 3 years ago

I also tried to update aem extension using command "az extension update --name aem" but got the error :

cli.azure.cli.core.extension.operations: Executing pip with args: ['install', '--target', '/home/ankit_gupta1/.azure/cliextensions/aem', '/tmp/tmp3e6o16nw/aem-0.2.1-py2.py3-none-any.whl'] cli.azure.cli.core.extension.operations: Running: ['/opt/az/bin/python3', '-m', 'pip', 'install', '--target', '/home/ankit_gupta1/.azure/cliextensions/aem', '/tmp/tmp3e6o16nw/aem-0.2.1-py2.py3-none-any.whl', '-vv', '--disable-pip-version-check', '--no-cache-dir'] cli.azure.cli.core.extension.operations: The folder you are executing pip from can no longer be found.

MSSedusch commented 3 years ago

Can you please try to uninstall the aem extension and reinstall? (maybe even reinstall the Azure CLI completely) I was able to install aem 0.2.1 with the latest Azure CLI version 2.20.0 that you are using and could install the extension on a SLES 15 VM.

ankit2809 commented 3 years ago

I am executing the commands using Azure Cloud shell. Is it possible to reinstall aem here as well ? Also, we are using RHEL 8.2 where this issue is occuring.

MSSedusch commented 3 years ago

yes, that should be possible with

  az extension remove --name aem
  az extension add --name aem
ankit2809 commented 3 years ago

After removing and adding the extension, now I receive a new error :

(VMExtensionHandlerNonTransientError) The handler for VM extension type 'Microsoft.OSTCExtensions.AzureEnhancedMonitorForLinux' has reported terminal failure for VM extension 'AzureEnhancedMonitorForLinux' with error message: '[ExtensionOperationError] Non-zero exit code: 1, /var/lib/waagent/Microsoft.OSTCExtensions.AzureEnhancedMonitorForLinux-3.0.1.0/installer.py [stdout]

[stderr] File "/var/lib/waagent/Microsoft.OSTCExtensions.AzureEnhancedMonitorForLinux-3.0.1.0/installer.py", line 42 except Exception, e: ^ SyntaxError: invalid syntax '.

'Install handler failed for the extension. More information on troubleshooting is available at https://aka.ms/vmextensionlinuxtroubleshoot'

MSSedusch commented 3 years ago

The error looks like you are installing the default version of the AEM extension which does not work on RHEL 8.2. Can you install the new version with

az vm aem set -g {} -n {} --subscription {} --install-new-extension