Bug#962952: azure-cli: exception when connecting to azure services

2020-08-08 Thread Luca Boccassi
On Fri, 10 Jul 2020 17:25:59 +0100 Luca Boccassi 
wrote:
> On Fri, 2020-07-10 at 16:15 +0200, Jakub Wilk wrote:
> > * Luca Boccassi , 2020-07-10, 09:54:
> > > (note that the monitor functionality is but one of the many
features
> > > and subcommands, hence the downgrade in severity).
> > 
> > It's not just the monitor functionality, whatever that is.
> > All the "az vm" commands are broken, e.g.:
> > 
> >$ az vm list
> >The command failed with an unexpected error. Here is the
traceback:
> > 
> >No module named 'antlr4'
> >Traceback (most recent call last):
> >  File "/usr/lib/python3/dist-packages/knack/cli.py", line 215,
in invoke
> >cmd_result = self.invocation.execute(args)
> >  File "/usr/lib/python3/dist-
packages/azure/cli/core/commands/__init__.py", line 553, in execute
> >self.commands_loader.load_arguments(command)
> >  File "/usr/lib/python3/dist-
packages/azure/cli/core/__init__.py", line 345, in load_arguments
> >loader.load_arguments(command)  # this adds entries to the
argument registries
> >  File "/usr/lib/python3/dist-
packages/azure/cli/command_modules/vm/__init__.py", line 31, in
load_arguments
> >from azure.cli.command_modules.vm._params import
load_arguments
> >  File "/usr/lib/python3/dist-
packages/azure/cli/command_modules/vm/_params.py", line 31, in 
> >from azure.cli.command_modules.monitor.actions import
get_period_type
> >  File "/usr/lib/python3/dist-
packages/azure/cli/command_modules/monitor/actions.py", line 7, in

> >import antlr4
> >ModuleNotFoundError: No module named 'antlr4'
> > 
> > The "az vm" commands are so fundamental, that this bug renders the 
> > package unusable IMO.
> > 
> > As a quick work-around, I've moved the import to the function
that 
> > uses it; see the attachment.
> 
> Whether it's fundamental or not is pretty much subjective - I never
use
> it, for example. Anyway, there's a simple enough workaround as
> mentioned - install antlr4 with pip until it gets packaged. Not
ideal,
> but it will do for now. I've asked upstream if they can downgrade to
> antlr3 as well.

No answer from upstream, so applied your workaround in the latest
upload.

-- 
Kind regards,
Luca Boccassi


signature.asc
Description: This is a digitally signed message part


Bug#962952: azure-cli: exception when connecting to azure services

2020-07-10 Thread Luca Boccassi
On Fri, 2020-07-10 at 16:15 +0200, Jakub Wilk wrote:
> * Luca Boccassi , 2020-07-10, 09:54:
> > (note that the monitor functionality is but one of the many features
> > and subcommands, hence the downgrade in severity).
> 
> It's not just the monitor functionality, whatever that is.
> All the "az vm" commands are broken, e.g.:
> 
>$ az vm list
>The command failed with an unexpected error. Here is the traceback:
> 
>No module named 'antlr4'
>Traceback (most recent call last):
>  File "/usr/lib/python3/dist-packages/knack/cli.py", line 215, in invoke
>cmd_result = self.invocation.execute(args)
>  File 
> "/usr/lib/python3/dist-packages/azure/cli/core/commands/__init__.py", line 
> 553, in execute
>self.commands_loader.load_arguments(command)
>  File "/usr/lib/python3/dist-packages/azure/cli/core/__init__.py", line 
> 345, in load_arguments
>loader.load_arguments(command)  # this adds entries to the argument 
> registries
>  File 
> "/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/__init__.py", 
> line 31, in load_arguments
>from azure.cli.command_modules.vm._params import load_arguments
>  File 
> "/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/_params.py", 
> line 31, in 
>from azure.cli.command_modules.monitor.actions import get_period_type
>  File 
> "/usr/lib/python3/dist-packages/azure/cli/command_modules/monitor/actions.py",
>  line 7, in 
>import antlr4
>ModuleNotFoundError: No module named 'antlr4'
> 
> The "az vm" commands are so fundamental, that this bug renders the 
> package unusable IMO.
> 
> As a quick work-around, I've moved the import to the function that 
> uses it; see the attachment.

Whether it's fundamental or not is pretty much subjective - I never use
it, for example. Anyway, there's a simple enough workaround as
mentioned - install antlr4 with pip until it gets packaged. Not ideal,
but it will do for now. I've asked upstream if they can downgrade to
antlr3 as well.

-- 
Kind regards,
Luca Boccassi


signature.asc
Description: This is a digitally signed message part


Bug#962952: azure-cli: exception when connecting to azure services

2020-07-10 Thread Jakub Wilk

* Luca Boccassi , 2020-07-10, 09:54:

(note that the monitor functionality is but one of the many features
and subcommands, hence the downgrade in severity).


It's not just the monitor functionality, whatever that is.
All the "az vm" commands are broken, e.g.:

  $ az vm list
  The command failed with an unexpected error. Here is the traceback:

  No module named 'antlr4'
  Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/knack/cli.py", line 215, in invoke
  cmd_result = self.invocation.execute(args)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/__init__.py", 
line 553, in execute
  self.commands_loader.load_arguments(command)
File "/usr/lib/python3/dist-packages/azure/cli/core/__init__.py", line 345, 
in load_arguments
  loader.load_arguments(command)  # this adds entries to the argument 
registries
File 
"/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/__init__.py", line 
31, in load_arguments
  from azure.cli.command_modules.vm._params import load_arguments
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/_params.py", 
line 31, in 
  from azure.cli.command_modules.monitor.actions import get_period_type
File 
"/usr/lib/python3/dist-packages/azure/cli/command_modules/monitor/actions.py", line 
7, in 
  import antlr4
  ModuleNotFoundError: No module named 'antlr4'

The "az vm" commands are so fundamental, that this bug renders the 
package unusable IMO.


As a quick work-around, I've moved the import to the function that 
uses it; see the attachment.


--
Jakub Wilk
--- unpacked/usr/lib/python3/dist-packages/azure/cli/command_modules/monitor/actions.py	2020-05-29 09:56:48.0 +0200
+++ /usr/lib/python3/dist-packages/azure/cli/command_modules/monitor/actions.py	2020-07-10 16:07:49.530265759 +0200
@@ -4,7 +4,6 @@
 # 
 
 import argparse
-import antlr4
 
 from azure.cli.command_modules.monitor.util import (
 get_aggregation_map, get_operator_map, get_autoscale_operator_map,
@@ -92,6 +91,7 @@
 class MetricAlertConditionAction(argparse._AppendAction):
 
 def __call__(self, parser, namespace, values, option_string=None):
+import antlr4
 from azure.cli.command_modules.monitor.grammar import (
 MetricAlertConditionLexer, MetricAlertConditionParser, MetricAlertConditionValidator)
 


Bug#962952: azure-cli: exception when connecting to azure services

2020-07-10 Thread Luca Boccassi
Control: severity -1 important

On Tue, 16 Jun 2020 19:40:46 +0530 Ritesh Raj Sarraf  wrote:
> Package: azure-cli
> Version: 2.6.0-1
> Severity: important
> 
> rrs@priyasi:~/NoBackup$ az vm user update --resource-group 
> lab40-obs-ubuntu-docker-494104 --name obs-ubuntu-docker --username rrs 
> --password 
> 
> The command failed with an unexpected error. Here is the traceback:
> 
> No module named 'antlr4'
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/knack/cli.py", line 215, in invoke
> cmd_result = self.invocation.execute(args)
>   File "/usr/lib/python3/dist-packages/azure/cli/core/commands/__init__.py", 
> line 553, in execute
> self.commands_loader.load_arguments(command)
>   File "/usr/lib/python3/dist-packages/azure/cli/core/__init__.py", line 345, 
> in load_arguments
> loader.load_arguments(command)  # this adds entries to the argument 
> registries
>   File 
> "/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/__init__.py", 
> line 31, in load_arguments
> from azure.cli.command_modules.vm._params import load_arguments
>   File 
> "/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/_params.py", 
> line 31, in 
> from azure.cli.command_modules.monitor.actions import get_period_type
>   File 
> "/usr/lib/python3/dist-packages/azure/cli/command_modules/monitor/actions.py",
>  line 7, in 
> import antlr4
> ModuleNotFoundError: No module named 'antlr4'
> 
> To open an issue, please run: 'az feedback'
> 19:37 ♒ ॐ ♅ ⛢   ☹ => 1  
> 
> 
> I couldn't find any antlr4 named python module in Debian.

Hi,

Thanks for the report. Yes, usage of antlr4 is unfortunate, as nobody
packages it (you can get it via pip as a workaround).

I'll ask if it's possible to downgrade to antlr3. If not, I'll try and
find the time to package and upload it, although I am a bit wary as I
know literally nothing about antlr.

(note that the monitor functionality is but one of the many features
and subcommands, hence the downgrade in severity).

-- 
Kind regards,
Luca Boccassi


signature.asc
Description: This is a digitally signed message part


Bug#962952: azure-cli: exception when connecting to azure services

2020-06-16 Thread Ritesh Raj Sarraf
Package: azure-cli
Version: 2.6.0-1
Severity: important

rrs@priyasi:~/NoBackup$ az vm user update --resource-group 
lab40-obs-ubuntu-docker-494104 --name obs-ubuntu-docker --username rrs 
--password 

The command failed with an unexpected error. Here is the traceback:

No module named 'antlr4'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/knack/cli.py", line 215, in invoke
cmd_result = self.invocation.execute(args)
  File "/usr/lib/python3/dist-packages/azure/cli/core/commands/__init__.py", 
line 553, in execute
self.commands_loader.load_arguments(command)
  File "/usr/lib/python3/dist-packages/azure/cli/core/__init__.py", line 345, 
in load_arguments
loader.load_arguments(command)  # this adds entries to the argument 
registries
  File 
"/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/__init__.py", line 
31, in load_arguments
from azure.cli.command_modules.vm._params import load_arguments
  File 
"/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/_params.py", line 
31, in 
from azure.cli.command_modules.monitor.actions import get_period_type
  File 
"/usr/lib/python3/dist-packages/azure/cli/command_modules/monitor/actions.py", 
line 7, in 
import antlr4
ModuleNotFoundError: No module named 'antlr4'

To open an issue, please run: 'az feedback'
19:37 ♒ ॐ ♅ ⛢   ☹ => 1  


I couldn't find any antlr4 named python module in Debian.

-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.6.0-2-amd64 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_USER
Locale: LANG=en_IN.UTF-8, LC_CTYPE=en_IN.UTF-8 (charmap=UTF-8), LANGUAGE=en_US 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages azure-cli depends on:
ii  python33.8.2-3
ii  python3-azure-cli  2.6.0-1

azure-cli recommends no packages.

azure-cli suggests no packages.

-- no debconf information