Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"az bicep upgrade" intermittently downgrades bicep version #15514

Open
JamieForsythe opened this issue Nov 7, 2024 · 4 comments
Open

"az bicep upgrade" intermittently downgrades bicep version #15514

JamieForsythe opened this issue Nov 7, 2024 · 4 comments
Assignees

Comments

@JamieForsythe
Copy link

Bicep version
v0.31.34

Describe the bug
Since upgrading to v0.31.34, running az bicep upgrade intermittently downgrades Bicep to v0.30.23. Re-running az bicep upgrade will then re-upgrade to v0.31.34, but this behaviour then repeats when the command is run in future.

Tried uninstalling Bicep and getting a clean install, but the issue persists.

To Reproduce

  • Upgrade to Bicep v0.31.34.
  • Run az bicep upgrade again (behaviour is intermittent, doesn't seem to happen every time).

Terminal output from reproducing the issue with a fresh install:

jamieforsythe@Jamies-MacBook-Pro ~ % ls -a ~/.azure/bin/
.	..
jamieforsythe@Jamies-MacBook-Pro ~ % az bicep install
Installing Bicep CLI v0.30.23...
The configuration value of bicep.use_binary_from_path has been set to 'false'.
Successfully installed Bicep CLI to "/Users/jamieforsythe/.azure/bin/bicep".
jamieforsythe@Jamies-MacBook-Pro ~ % az bicep upgrade
Installing Bicep CLI v0.31.34...
Successfully installed Bicep CLI to "/Users/jamieforsythe/.azure/bin/bicep".
jamieforsythe@Jamies-MacBook-Pro ~ % az bicep version
Bicep CLI version 0.31.34 (ec82b47d63)

jamieforsythe@Jamies-MacBook-Pro ~ % az bicep upgrade
Installing Bicep CLI v0.30.23...
Successfully installed Bicep CLI to "/Users/jamieforsythe/.azure/bin/bicep".
jamieforsythe@Jamies-MacBook-Pro ~ % az bicep version
Bicep CLI version 0.30.23 (ec3612efc7)

jamieforsythe@Jamies-MacBook-Pro ~ % az bicep upgrade
Installing Bicep CLI v0.31.34...
Successfully installed Bicep CLI to "/Users/jamieforsythe/.azure/bin/bicep".

Additional context
Our organisation has CI processes that run this command to keep our Bicep installation up-to-date, so we need to be able to rely on this command actually installing the latest version.

@JamieForsythe
Copy link
Author

We have now been able to replicate this issue on multiple different devices

@anthony-c-martin
Copy link
Member

I've noticed this happens immediately after we push a new release.

My suspicion is that our CDN (https://downloads.bicep.azure.com) is returning inconsistent results - perhaps because some endpoints happen to refresh at different times than others.

Some possible fixes:

  • Update AzureCLI to understand semantic versioning, and refuse to downgrade if az bicep upgrade is called.
  • Force a full refresh of the CDN after a new version is published.

@anthony-c-martin
Copy link
Member

@JamieForsythe if you're still able to repro - could you try running these commands with the --debug --verbose flags - e.g. az bicep upgrade --debug --verbose?

@JamieForsythe
Copy link
Author

JamieForsythe commented Nov 8, 2024

@anthony-c-martin from a quick test the issue seems far rarer now compared to yesterday, which I guess would support your theory.

Did manage to repro a couple of times and got the following:

jamieforsythe@Jamies-MacBook-Pro ~ % az bicep upgrade --debug --verbose
cli.knack.cli: Command arguments: ['bicep', 'upgrade', '--debug', '--verbose']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x102aa0680>, <function OutputProducer.on_global_arguments at 0x102c42f20>, <function CLIQuery.on_global_arguments at 0x102c80a40>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'bicep': ['azure.cli.command_modules.resource']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name                  Load Time    Groups  Commands
cli.azure.cli.core: resource                  0.049        51       231
cli.azure.cli.core: Total (1)                 0.049        51       231
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name                  Load Time    Groups  Commands  Directory
cli.azure.cli.core: Total (0)                 0.000         0         0  
cli.azure.cli.core: Loaded 51 groups, 231 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command  : bicep upgrade
cli.azure.cli.core: Command table: bicep upgrade
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x103a776a0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/jamieforsythe/.azure/commands/2024-11-08.09-06-12.bicep_upgrade.18729.log'.
az_command_data_logger: command args: bicep upgrade --debug --verbose
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x103af49a0>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x103af4a40>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x103af4b80>, <function register_upcoming_breaking_change_info.<locals>.update_breaking_change_info at 0x103af4c20>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x102c42fc0>, <function CLIQuery.handle_query_parameter at 0x102c80ae0>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x103af4ae0>]
urllib3.connectionpool: Starting new HTTPS connection (1): aka.ms:443
urllib3.connectionpool: https://aka.ms:443 "GET /BicepLatestRelease HTTP/1.1" 301 0
urllib3.connectionpool: Starting new HTTPS connection (1): downloads.bicep.azure.com:443
urllib3.connectionpool: https://downloads.bicep.azure.com:443 "GET /releases/latest HTTP/1.1" 200 41163
Installing Bicep CLI v0.30.23...
cli.azure.cli.command_modules.resource._bicep: Generated download URL https://downloads.bicep.azure.com/v0.30.23/bicep-osx-arm64. from system Darwin, machine arm64, release tag v0.30.23 and target platform None.
Successfully installed Bicep CLI to "/Users/jamieforsythe/.azure/bin/bicep".
cli.knack.cli: Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x103ac9580>, <function _x509_from_base64_to_hex_transform at 0x103ac9620>]
cli.knack.cli: Event: CommandInvoker.OnFilterResult []
cli.knack.cli: Event: Cli.SuccessfulExecute []
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x103a77920>]
az_command_data_logger: exit code: 0
cli.__main__: Command ran in 12.796 seconds (init: 0.066, invoke: 12.730)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3755 in cache file under /Users/jamieforsythe/.azure/telemetry/20241108090624771
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/homebrew/Cellar/azure-cli/2.65.0_2/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.65.0_2/libexec/lib/python3.11/site-packages/azure/cli/telemetry/__init__.py /Users/jamieforsythe/.azure /Users/jamieforsythe/.azure/telemetry/20241108090624771"
telemetry.process: Return from creating process 18755
telemetry.main: Finish creating telemetry upload process.

jamieforsythe@Jamies-MacBook-Pro ~ % az bicep upgrade --debug --verbose
cli.knack.cli: Command arguments: ['bicep', 'upgrade', '--debug', '--verbose']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x101538680>, <function OutputProducer.on_global_arguments at 0x1016daf20>, <function CLIQuery.on_global_arguments at 0x101718a40>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'bicep': ['azure.cli.command_modules.resource']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name                  Load Time    Groups  Commands
cli.azure.cli.core: resource                  0.050        51       231
cli.azure.cli.core: Total (1)                 0.050        51       231
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name                  Load Time    Groups  Commands  Directory
cli.azure.cli.core: Total (0)                 0.000         0         0  
cli.azure.cli.core: Loaded 51 groups, 231 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command  : bicep upgrade
cli.azure.cli.core: Command table: bicep upgrade
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x10250f6a0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/jamieforsythe/.azure/commands/2024-11-08.09-06-30.bicep_upgrade.18757.log'.
az_command_data_logger: command args: bicep upgrade --debug --verbose
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x10258c9a0>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x10258ca40>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x10258cb80>, <function register_upcoming_breaking_change_info.<locals>.update_breaking_change_info at 0x10258cc20>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x1016dafc0>, <function CLIQuery.handle_query_parameter at 0x101718ae0>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x10258cae0>]
urllib3.connectionpool: Starting new HTTPS connection (1): aka.ms:443
urllib3.connectionpool: https://aka.ms:443 "GET /BicepLatestRelease HTTP/1.1" 301 0
urllib3.connectionpool: Starting new HTTPS connection (1): downloads.bicep.azure.com:443
urllib3.connectionpool: https://downloads.bicep.azure.com:443 "GET /releases/latest HTTP/1.1" 200 39033
Installing Bicep CLI v0.31.34...
cli.azure.cli.command_modules.resource._bicep: Generated download URL https://downloads.bicep.azure.com/v0.31.34/bicep-osx-arm64. from system Darwin, machine arm64, release tag v0.31.34 and target platform None.
Successfully installed Bicep CLI to "/Users/jamieforsythe/.azure/bin/bicep".
cli.knack.cli: Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x102561580>, <function _x509_from_base64_to_hex_transform at 0x102561620>]
cli.knack.cli: Event: CommandInvoker.OnFilterResult []
cli.knack.cli: Event: Cli.SuccessfulExecute []
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x10250f920>]
az_command_data_logger: exit code: 0
cli.__main__: Command ran in 2.936 seconds (init: 0.066, invoke: 2.870)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3754 in cache file under /Users/jamieforsythe/.azure/telemetry/20241108090633557
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/homebrew/Cellar/azure-cli/2.65.0_2/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.65.0_2/libexec/lib/python3.11/site-packages/azure/cli/telemetry/__init__.py /Users/jamieforsythe/.azure /Users/jamieforsythe/.azure/telemetry/20241108090633557"
telemetry.process: Return from creating process 18772
telemetry.main: Finish creating telemetry upload process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

4 participants