Azure-cli: Not sure I understand the local context error

Created on 28 Sep 2020  路  8Comments  路  Source: Azure/azure-cli

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug
Interesting... not sure if local context worked or not...
image

To Reproduce
image

Expected behavior
1) Output from az config param-persist that either it's successfully turned on or not, without having user to run it the 2nd time to doublecheck
2) Being able to view what the validation error is about...

Environment summary

image

Additional context

Error Handling Local Context

Most helpful comment

Hi @chenlomis , let's keep this issue open until the root cause is addressed. For the screenshot you gave in the beginning, actually it is by design in 2.12.0. If param-persist(local-context) is turned on, CLI will raise an error and our error framework will automatically add a ValidationError. We will do 2 changes in the coming release:

  1. From param-persist(local-context) side, we will only print a warning message instead of throwing an error when pram-persist(local-context) is already on/off
  2. From error handling side, Houk will update the mechanism not to add "ValidationError" if it is CLIError. (@houk-ms please fix me if I'm not right)

What wired in your case is that there is an empty error when you run az group create. I'm not sure what's going wrong in your case. So if you come across it again, could you please run with --debug and paste the log to us. It will help us identify the root case a lot. Thanks very much. :)

All 8 comments

hi @arrownj could you pls have a look? thanks

Currently, CLIError message will be prefixed with the 'ValidationError', but I have no idea why the message is blank.

As we discussed, the 'ValidationError' will not shown to users any more unless we know it's a ValidationError.

Hi @chenlomis , why there is no output of az group create ? I tried as your commands and the group was created successfully. Could you please try once more with --debug ?

Thank you for all the follow ups
I'm not entirely sure what happened but when I reran the commands today it worked
image

I do think though.. if it's an output message indicating that the feature is already turned on.. perhaps we could make it a generic output instead of an error like what Houk suggested (?)

Hi @chenlomis , let's keep this issue open until the root cause is addressed. For the screenshot you gave in the beginning, actually it is by design in 2.12.0. If param-persist(local-context) is turned on, CLI will raise an error and our error framework will automatically add a ValidationError. We will do 2 changes in the coming release:

  1. From param-persist(local-context) side, we will only print a warning message instead of throwing an error when pram-persist(local-context) is already on/off
  2. From error handling side, Houk will update the mechanism not to add "ValidationError" if it is CLIError. (@houk-ms please fix me if I'm not right)

What wired in your case is that there is an empty error when you run az group create. I'm not sure what's going wrong in your case. So if you come across it again, could you please run with --debug and paste the log to us. It will help us identify the root case a lot. Thanks very much. :)

Thank you! Love the response. Will run --debug in my future screenshots/issues too

Close this first as not able to reproduce the empty error message problem.

Was this page helpful?
0 / 5 - 0 ratings