Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3.01k forks source link

Cloud Shell (bash) can not use "history" commans #27003

Closed MingYunChen closed 1 year ago

MingYunChen commented 1 year ago

Describe the bug

When I use Cloud Shell (bash) can not use "history" command, and use the "up" botton also can not check history command.

Related command

history

Errors

tina_chen [ ~ ]$ echo 1 1 tina_chen [ ~ ]$ echo 2 2 tina_chen [ ~ ]$ history 1 history

Issue script & Debug output

tina_chen [ ~ ]$ az --debug cli.knack.cli: Command arguments: ['--debug'] 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 0x7f2e8409f1f0>, <function OutputProducer.on_global_arguments at 0x7f2e83fbbd30>, <function CLIQuery.on_global_arguments at 0x7f2e83f52310>] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: No module found from index for '['--debug']' cli.azure.cli.core: Loading all modules and extensions cli.azure.cli.core: Discovered command modules: ['acr', 'acs', 'advisor', 'ams', 'apim', 'appconfig', 'appservice', 'aro', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'config', 'configure', 'consumption', 'container', 'cosmosdb', 'databoxedge', 'dla', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'identity', 'interactive', 'iot', 'keyvault', 'kusto', 'lab', 'managedservices', 'maps', 'marketplaceordering', 'monitor', 'mysql', 'netappfiles', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'resource', 'role', 'search', 'security', 'servicebus', 'serviceconnector', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'synapse', 'util', 'vm'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: acr 0.167 34 144 cli.azure.cli.core: acs 0.033 6 48 cli.azure.cli.core: advisor 0.005 3 6 cli.azure.cli.core: ams 0.015 22 100 cli.azure.cli.core: apim 0.016 14 68 cli.azure.cli.core: appconfig 0.008 9 47 cli.azure.cli.core: appservice 0.075 73 260 cli.azure.cli.core: aro 0.024 1 9 cli.azure.cli.core: backup 0.012 16 58 cli.azure.cli.core: batch 0.074 36 104 cli.azure.cli.core: batchai 0.008 10 30 cli.azure.cli.core: billing 0.019 19 52 cli.azure.cli.core: botservice 0.008 12 42 cli.azure.cli.core: cdn 0.012 39 133 cli.azure.cli.core: cloud 0.005 1 7 cli.azure.cli.core: cognitiveservices 0.006 8 31 cli.azure.cli.core: config 0.005 2 7 cli.azure.cli.core: configure 0.003 2 5 cli.azure.cli.core: consumption 0.011 8 9 cli.azure.cli.core: container 0.024 1 11 cli.azure.cli.core: cosmosdb 0.027 57 191 cli.azure.cli.core: databoxedge 0.012 5 27 cli.azure.cli.core: dla 0.009 23 62 cli.azure.cli.core: dls 0.008 7 41 cli.azure.cli.core: dms 0.006 3 22 cli.azure.cli.core: eventgrid 0.009 25 96 cli.azure.cli.core: eventhubs 0.036 13 19 cli.azure.cli.core: extension 0.004 1 7 cli.azure.cli.core: feedback 0.001 1 2 cli.azure.cli.core: find 0.003 1 1 cli.azure.cli.core: hdinsight 0.017 8 39 cli.azure.cli.core: identity 0.006 2 11 cli.azure.cli.core: interactive 0.002 1 1 cli.azure.cli.core: iot 0.164 19 82 cli.azure.cli.core: keyvault 0.017 22 131 cli.azure.cli.core: kusto 0.007 3 14 cli.azure.cli.core: lab 0.009 11 34 cli.azure.cli.core: managedservices 0.005 3 8 cli.azure.cli.core: maps 0.004 5 13 cli.azure.cli.core: marketplaceordering 0.009 1 2 cli.azure.cli.core: monitor 0.095 26 80 cli.azure.cli.core: mysql 0.282 13 47 cli.azure.cli.core: netappfiles 0.016 17 94 cli.azure.cli.core: network 1.264 103 336 cli.azure.cli.core: policyinsights 0.039 9 17 cli.azure.cli.core: privatedns 0.011 14 66 cli.azure.cli.core: profile 0.002 2 9 cli.azure.cli.core: rdbms 0.051 44 185 cli.azure.cli.core: redis 0.006 5 27 cli.azure.cli.core: relay 0.008 10 37 cli.azure.cli.core: resource 0.019 51 224 cli.azure.cli.core: role 0.006 17 61 cli.azure.cli.core: search 0.006 7 22 cli.azure.cli.core: security 0.012 48 104 cli.azure.cli.core: servicebus 0.023 12 15 cli.azure.cli.core: serviceconnector 0.093 8 129 cli.azure.cli.core: servicefabric 0.039 27 76 cli.azure.cli.core: signalr 0.006 8 30 cli.azure.cli.core: sql 0.033 57 215 cli.azure.cli.core: sqlvm 0.047 4 20 cli.azure.cli.core: storage 0.080 58 272 cli.azure.cli.core: synapse 0.025 54 246 cli.azure.cli.core: util 0.003 3 7 cli.azure.cli.core: vm 0.148 58 264 cli.azure.cli.core: Total (64) 3.198 1182 4557 cli.azure.cli.core: Loading extensions: cli.azure.cli.core: Name Load Time Groups Commands Directory cli.azure.cli.core: ai-examples 0.108 1 1 /usr/lib/python3.9/site-packages/azure-cli-extensions/ai-examples cli.knack.cli: Event: CommandLoader.OnLoadCommandTable [] cli.azure.cli.core: aks-preview 0.171 14 73 /home/tina_chen/.azure/cliextensions/aks-preview azext_mlv2.manual.vendored_curated_sdk.azure.ai.ml._azure_environments: Using the default cloud configuration: 'AzureCloud'. azext_mlv2.manual.vendored_curated_sdk.azure.ai.ml._azure_environments: Using the default cloud configuration: 'AzureCloud'. azext_mlv2.manual.vendored_curated_sdk.azure.ai.ml._azure_environments: Using the default cloud configuration: 'AzureCloud'. cli.azure.cli.core: ml 3.276 20 138 /usr/lib/python3.9/site-packages/azure-cli-extensions/ml cli.azure.cli.core: ssh 0.030 1 4 /usr/lib/python3.9/site-packages/azure-cli-extensions/ssh cli.azure.cli.core: Total (4) 3.585 36 216
cli.azure.cli.core: Loaded 1203 groups, 4737 commands. cli.azure.cli.core: Updated command index in 0.008 seconds. cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f2e831d14c0>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/tina_chen/.azure/commands/2023-07-26.09-38-14.unknown_command.864.log'. az_command_data_logger: command args: --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7f2e831790d0>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7f2e831a5280>, <function register_cache_arguments..add_cache_arguments at 0x7f2e831440d0>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []

 /\
/  \    _____   _ _  ___ _

/ /\ \ |_ / | | | \'/ \ / ____ \ / /| || | | | / // \\/|_,|| _|

Welcome to the cool new Azure CLI!

Use az --version to display the current version. Here are the base commands:

account             : Manage Azure subscription information.
acr                 : Manage private registries with Azure Container Registries.
ad                  : Manage Azure Active Directory Graph entities needed for Role Based Access
                     Control.
advisor             : Manage Azure Advisor.
afd                 : Manage Azure Front Door Standard/Premium. For classical Azure Front Door,
                     please refer https://docs.microsoft.com/en-us/cli/azure/network/front-
                     door?view=azure-cli-latest.
ai-examples         : Add AI powered examples to help content.
aks                 : Manage Azure Kubernetes Services.
ams                 : Manage Azure Media Services resources.
apim                : Manage Azure API Management services.
appconfig           : Manage App Configurations.
appservice          : Manage App Service plans.
aro                 : Manage Azure Red Hat OpenShift clusters.
backup              : Manage Azure Backups.
batch               : Manage Azure Batch.
bicep               : Bicep CLI command group.
billing             : Manage Azure Billing.
bot                 : Manage Microsoft Azure Bot Service.
cache               : Commands to manage CLI objects cached using the `--defer` argument.
capacity            : Manage capacity.
cdn                 : Manage Azure Content Delivery Networks (CDNs).
cloud               : Manage registered Azure clouds.
cognitiveservices   : Manage Azure Cognitive Services accounts.
config              : Manage Azure CLI configuration.
configure           : Manage Azure CLI configuration. This command is interactive.
connection          : Commands to manage Service Connector local connections which allow local
                     environment to connect Azure Resource. If you want to manage connection for
                     compute service, please run 'az webapp/containerapp/spring connection'.
consumption         : Manage consumption of Azure resources.
container           : Manage Azure Container Instances.
cosmosdb            : Manage Azure Cosmos DB database accounts.
databoxedge         : Support data box edge device and management.
deployment          : Manage Azure Resource Manager template deployment at subscription scope.
deployment-scripts  : Manage deployment scripts at subscription or resource group scope.
disk                : Manage Azure Managed Disks.
disk-access         : Manage disk access resources.
disk-encryption-set : Disk Encryption Set resource.
dla                 : Manage Data Lake Analytics accounts, jobs, and catalogs.
dls                 : Manage Data Lake Store accounts and filesystems.
dms                 : Manage Azure Data Migration Service (classic) instances.
eventgrid           : Manage Azure Event Grid topics, domains, domain topics, system topics
                     partner topics, event subscriptions, system topic event subscriptions and
                     partner topic event subscriptions.
eventhubs           : Eventhubs.
extension           : Manage and update CLI extensions.
feature             : Manage resource provider features.
feedback            : Send feedback to the Azure CLI Team.
find                : I'm an AI robot, my advice is based on our Azure documentation as well as
                     the usage patterns of Azure CLI and Azure ARM users. Using me improves
                     Azure products and documentation.
functionapp         : Manage function apps. To install the Azure Functions Core tools see
                     https://github.com/Azure/azure-functions-core-tools.
group               : Manage resource groups and template deployments.
hdinsight           : Manage HDInsight resources.
identity            : Managed Identities.
image               : Manage custom virtual machine images.
interactive         : Start interactive mode. Installs the Interactive extension if not
                     installed already.
iot                 : Manage Internet of Things (IoT) assets.
keyvault            : Manage KeyVault keys, secrets, and certificates.
kusto               : Manage Azure Kusto resources.
lab                 : Manage Azure DevTest Labs.
lock                : Manage Azure locks.
logicapp            : Manage logic apps.
login               : Log in to Azure.
logout              : Log out to remove access to Azure subscriptions.
managed-cassandra   : Azure Managed Cassandra.
managedapp          : Manage template solutions provided and maintained by Independent Software
                     Vendors (ISVs).
managedservices     : Manage the registration assignments and definitions in Azure.
maps                : Manage Azure Maps.
mariadb             : Manage Azure Database for MariaDB servers.
ml                  : Manage Azure Machine Learning resources with the Azure CLI ML extension
                     v2.
monitor             : Manage the Azure Monitor Service.
mysql               : Manage Azure Database for MySQL servers.
netappfiles         : Manage Azure NetApp Files (ANF) Resources.
network             : Manage Azure Network resources.
policy              : Manage resource policies.
postgres            : Manage Azure Database for PostgreSQL servers.
ppg                 : Manage Proximity Placement Groups.
private-link        : Private-link association CLI command group.
provider            : Manage resource providers.
redis               : Manage dedicated Redis caches for your Azure applications.
relay               : Manage Azure Relay Service namespaces, WCF relays, hybrid connections, and
                     rules.
resource            : Manage Azure resources.
resourcemanagement  : Resourcemanagement CLI command group.
rest                : Invoke a custom request.
restore-point       : Manage restore point with res.
role                : Manage user roles for access control with Azure Active Directory and
                     service principals.
search              : Manage Azure Search services, admin keys and query keys.
security            : Manage your security posture with Microsoft Defender for Cloud.
servicebus          : Servicebus.
sf                  : Manage and administer Azure Service Fabric clusters.
sig                 : Manage shared image gallery.
signalr             : Manage Azure SignalR Service.
snapshot            : Manage point-in-time copies of managed disks, native blobs, or other
                     snapshots.
sql                 : Manage Azure SQL Databases and Data Warehouses.
ssh                 : SSH into resources (Azure VMs, Arc servers, etc) using AAD issued openssh
                     certificates.
sshkey              : Manage ssh public key with vm.
stack               : A deployment stack is a native Azure resource type that enables you to
                     perform operations on a resource collection as an atomic unit.
staticwebapp        : Manage static apps.
storage             : Manage Azure Cloud Storage resources.
survey              : Take Azure CLI survey.
synapse             : Manage and operate Synapse Workspace, Spark Pool, SQL Pool.
tag                 : Tag Management on a resource.
term                : Manage marketplace agreement with marketplaceordering.
ts                  : Manage template specs at subscription or resource group scope.
upgrade             : Upgrade Azure CLI and extensions.
version             : Show the versions of Azure CLI modules and extensions in JSON format by
                     default or format configured by --output.
vm                  : Manage Linux or Windows virtual machines.
vmss                : Manage groupings of virtual machines in an Azure Virtual Machine Scale Set
                     (VMSS).
webapp              : Manage web apps.

cli.knack.cli: Event: Cli.SuccessfulExecute [] cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f2e831d1700>] az_command_data_logger: exit code: 0 cli.main: Command ran in 7.313 seconds (init: 0.186, invoke: 7.126) 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 3389 in cache telemetry.check: Negative: The /home/tina_chen/.azure/telemetry.txt was modified at 2023-07-26 09:35:49.186385, which in less than 600.000000 s

Expected behavior

When I use Cloud Shell (bash) can not use "history" command, and use the "up" botton also can not check history command.

Environment Summary

azure-cli 2.50.0

core 2.50.0 telemetry 1.0.8

Extensions: ai-examples 0.2.5 aks-preview 0.5.144 ml 2.18.0 ssh 1.1.6

Dependencies: msal 1.22.0 azure-mgmt-resource 23.1.0b2

Python location '/usr/bin/python3.9' Extensions directory '/home/tina_chen/.azure/cliextensions' Extensions system directory '/usr/lib/python3.9/site-packages/azure-cli-extensions'

Python (Linux) 3.9.14 (main, Feb 8 2023, 03:39:52) [GCC 11.2.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

yonzhan commented 1 year ago

Thank you for opening this issue, we will look into it.

microsoft-github-policy-service[bot] commented 1 year ago

Thank you for your feedback. This has been routed to the support team for assistance.

jiasli commented 1 year ago

This repo is only for Azure CLI. For Azure Cloud Shell issues, you may report to https://github.com/Azure/CloudShell.