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 aks install-cli --client-version 1.30.5 --install-location ./kubectl sent 404 Not Found #30101

Open
DidouJazz opened this issue Oct 16, 2024 · 7 comments
Labels
AKS az aks/acs/openshift Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.

Comments

@DidouJazz
Copy link

Describe the bug

Running this on Rocky Linux.

Here is my AZ CLi version:
az version
{
"azure-cli": "2.38.2",
"azure-cli-core": "2.38.2",
"azure-cli-telemetry": "1.0.6",
"extensions": {}
}

When running:
az aks install-cli --client-version 1.30.5 --install-location ./kubectl
Downloading client to "./kubectl" from "https://storage.googleapis.com/kubernetes-release/release/v1.30.5/bin/linux/amd64/kubectl"
Connection error while attempting to download client (HTTP Error 404: Not Found)

As AKS 1.30.5 has been released (and is now default for 1.30), the corresponding kubectl version should also be available to download.

Workaround (but not considered as a solution):
Download version 1.30.4 but as we have scripted everything we are getting 1.30.5 automatically.
Dowload version 1.30.5 from https://dl.k8s.io/release/v1.30.5/bin/linux/amd64/kubectl

Exepcted results:
Same as for 1.30.4:
Downloading client to "./kubectl" from "https://storage.googleapis.com/kubernetes-release/release/v1.30.5/bin/linux/amd64/kubectl"
Please ensure that . is in your search PATH, so the kubectl command can be found.
Downloading client to "/tmp/tmpplxuv1d9/kubelogin.zip" from "https://github.com/Azure/kubelogin/releases/download/v0.1.4/kubelogin.zip"
Please ensure that /usr/local/bin is in your search PATH, so the kubelogin command can be found.

Related command

az aks install-cli --client-version 1.30.5 --install-location ./kubectl

Errors

Connection error while attempting to download client (HTTP Error 404: Not Found)

Issue script & Debug output

cli.knack.cli: Command arguments: ['aks', 'install-cli', '--debug', '--client-version', '1.30.5', '--install-location', './kubectl']
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 0x7fbe8d4b9a60>, <function OutputProducer.on_global_arguments at 0x7fbe8d3ca430>, <function CLIQuery.on_global_arguments at 0x7fbe8d3cf8b0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'aks': ['azure.cli.command_modules.acs']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: acs 0.110 8 58
cli.azure.cli.core: Total (1) 0.110 8 58
cli.azure.cli.core: Loaded 8 groups, 58 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : aks install-cli
cli.azure.cli.core: Command table: aks install-cli
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7fbe8c926f70>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/root/.azure/commands/2024-10-16.11-19-53.aks_install-cli.14096.log'.
az_command_data_logger: command args: aks install-cli --debug --client-version {} --install-location {}
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7fbe8c8be430>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7fbe8c8a3940>, <function register_cache_arguments..add_cache_arguments at 0x7fbe8c8a3a60>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7fbe8d3ca4c0>, <function CLIQuery.handle_query_parameter at 0x7fbe8d3cf940>, <function register_ids_argument..parse_ids_arguments at 0x7fbe8c8a39d0>]
cli.azure.cli.command_modules.acs.custom: Downloading client to "./kubectl" from "https://storage.googleapis.com/kubernetes-release/release/v1.30.5/bin/linux/amd64/kubectl"
cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception:
cli.azure.cli.core.util: Traceback (most recent call last):
File "/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/acs/custom.py", line 2537, in k8s_install_kubectl
_urlretrieve(file_url, install_location)
File "/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/acs/custom.py", line 2652, in _urlretrieve
req = urlopen(url, context=_ssl_context())
File "/usr/lib64/python3.9/urllib/request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python3.9/urllib/request.py", line 523, in open
response = meth(req, response)
File "/usr/lib64/python3.9/urllib/request.py", line 632, in http_response
response = self.parent.error(
File "/usr/lib64/python3.9/urllib/request.py", line 561, in error
return self._call_chain(*args)
File "/usr/lib64/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/usr/lib64/python3.9/urllib/request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/lib64/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
cmd_result = self.invocation.execute(args)
File "/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 663, in execute
raise ex
File "/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job
result = cmd_copy(params)
File "/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 333, in call
return self.handler(*args, **kwargs)
File "/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/acs/custom.py", line 2489, in k8s_install_cli
k8s_install_kubectl(cmd, client_version, install_location, base_src_url)
File "/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/acs/custom.py", line 2541, in k8s_install_kubectl
raise CLIError(
knack.util.CLIError: Connection error while attempting to download client (HTTP Error 404: Not Found)

cli.azure.cli.core.azclierror: Connection error while attempting to download client (HTTP Error 404: Not Found)
az_command_data_logger: Connection error while attempting to download client (HTTP Error 404: Not Found)
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7fbe8c9271f0>]
az_command_data_logger: exit code: 1
cli.main: Command ran in 0.602 seconds (init: 0.095, invoke: 0.507)
telemetry.save: Save telemetry record of length 2944 in cache
telemetry.check: Negative: The /root/.azure/telemetry.txt was modified at 2024-10-16 11:10:38.608182, which in less than 600.000000 s

Expected behavior

Downloading client to "./kubectl" from "https://storage.googleapis.com/kubernetes-release/release/v1.30.5/bin/linux/amd64/kubectl"
Please ensure that . is in your search PATH, so the kubectl command can be found.
Downloading client to "/tmp/tmpplxuv1d9/kubelogin.zip" from "https://github.com/Azure/kubelogin/releases/download/v0.1.4/kubelogin.zip"
Please ensure that /usr/local/bin is in your search PATH, so the kubelogin command can be found.

Environment Summary

azure-cli 2.38.2 *

core 2.38.2 *
telemetry 1.0.6 *

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1

Python location '/usr/bin/python3'
Extensions directory '/home/sas/.azure/cliextensions'

Python (Linux) 3.9.18 (main, Aug 23 2024, 00:00:00)
[GCC 11.4.1 20231218 (Red Hat 11.4.1-3)]

Legal docs and information: aka.ms/AzureCliLegal

Additional context

No response

@DidouJazz DidouJazz added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Oct 16, 2024
Copy link

Hi @DidouJazz,

2.38.2 is not the latest Azure CLI(2.65.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

@azure-client-tools-bot-prd azure-client-tools-bot-prd bot added the Auto-Resolve Auto resolve by bot label Oct 16, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Oct 16, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Oct 16, 2024

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

@microsoft-github-policy-service microsoft-github-policy-service bot added AKS az aks/acs/openshift Service Attention This issue is responsible by Azure service team. Auto-Assign Auto assign by bot labels Oct 16, 2024
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @dyu1208, @FumingZhang, @andyliuliming.

@lwr20
Copy link

lwr20 commented Oct 16, 2024

2.38.2 is not the latest Azure CLI(2.65.0).

FWIW I can repro this on 2.65.0.

$ az aks install-cli --client-version 1.30.5 --install-location ./kubectl
The detected architecture of current device is "x86_64", and the binary for "amd64" will be downloaded. If the detection is wrong, please download and install the binary corresponding to the appropriate architecture.
Downloading client to "./kubectl" from "https://storage.googleapis.com/kubernetes-release/release/v1.30.5/bin/linux/amd64/kubectl"
Connection error while attempting to download client (HTTP Error 404: Not Found)
$ az --version
azure-cli                         2.65.0

core                              2.65.0
telemetry                          1.1.0

Extensions:
account                            0.2.5
aks-preview                       0.5.92

Dependencies:
msal                              1.31.0
azure-mgmt-resource               23.1.1

Python location '/opt/az/bin/python3'
Extensions directory '/home/lwr20/.azure/cliextensions'

Python (Linux) 3.11.8 (main, Sep 25 2024, 11:34:06) [GCC 9.4.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

@lwr20
Copy link

lwr20 commented Oct 16, 2024

Probably related to: kubernetes/k8s.io#2396

Seems that az CLI should migrate this URL to https://dl.k8s.io/release

@lwr20
Copy link

lwr20 commented Oct 16, 2024

@BenTheElder
Copy link

Yes, please use dl.k8s.io as the officially supported download host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AKS az aks/acs/openshift Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

4 participants