共用方式為


針對容器網路介面下載失敗進行疑難解答

本文討論如何識別並解決 CniDownloadTimeoutVMExtensionError 錯誤碼(也稱為錯誤碼 ERR_CNI_DOWNLOAD_TIMEOUT、錯誤號碼 41)或 WINDOWS_CSE_ERROR_DOWNLOAD_CNI_PACKAGE 當您嘗試建立及部署 Microsoft azure Kubernetes Service (AKS) 叢集時所發生的錯誤碼(錯誤號碼 35)。

必要條件

  • Curl 命令行工具
  • 從將部署 AKS 節點的相同環境進行網路存取(相同的 VNet、防火牆規則等)

徵兆

當您嘗試建立以 Linux 為基礎的 AKS 叢集時,您會收到下列錯誤訊息:

Message: We are unable to serve this request due to an internal error
SubCode: CniDownloadTimeoutVMExtensionError;
Message="VM has reported a failure when processing extension 'vmssCSE'.
Error message: "Enable failed: failed to execute command: command terminated with exit status=41\n[stdout]\n{
"ExitCode": "41",

當您嘗試建立以 Windows 為基礎的 AKS 叢集時,您會收到下列錯誤訊息:

Message="VM has reported a failure when processing extension 'vmssCSE' (publisher 'Microsoft.Compute' and type 'CustomScriptExtension').
Error message: 'Command execution finished, but failed because it returned a non-zero exit code of: '1'. The command had an error output of: 'ExitCode: |35|,
Output: |WINDOWS_CSE_ERROR_DOWNLOAD_CNI_PACKAGE|, Error: |Failed in downloading \r\nhttps://acs-mirror.azureedge.net/azure-cni/v1.4.56/binaries/azure-vnet-cni-overlay-windows-amd64-v1.4.56.zip.
Error: \r\nUnable to connect to the r|\r\nAt line:1 ...'
For more information, check the instance view by executing Get-AzVmssVm or Get-AzVm (https://aka.ms/GetAzVm). These commands can be executed using CloudShell (https://aka.ms/CloudShell)'. More information on troubleshooting is available at https://aka.ms/VMExtensionCSEWindowsTroubleshoot.

原因

您的叢集節點無法連線到用來下載容器網路介面 (CNI) 連結庫的端點。 在大部分情況下,之所以發生此問題,是因為網路虛擬設備封鎖安全套接字層 (SSL) 通訊或 SSL 憑證。

解決方案

執行 Curl 命令以確認您的節點可以下載二進位檔:

首先,嘗試從官方鏡像端點下載適用於Linux的 Azure CNI 套件。

curl -I https://acs-mirror.azureedge.net/cni/azure-vnet-cni-linux-amd64-v1.0.25.tgz

結果:

HTTP/2 200 
content-length: 970752
content-type: application/x-gzip
last-modified: Wed, 22 Jun 2022 00:00:00 GMT
etag: "0x8DA53F1234567"
server: ECAcc (dab/4B9E)
x-cache: HIT
cache-control: public, max-age=86400
accept-ranges: bytes
date: Thu, 05 Jun 2025 00:00:00 GMT

此命令會檢查端點是否可連線,並傳回 HTTP 標頭。 如果您看到 200 OK 回應,表示端點可供存取。

接下來,嘗試使用驗證進行下載,並在本機儲存檔案以進行進一步的故障排除。 這有助於判斷 SSL 或輸出連線是否已正確設定。

# Create a temporary directory for testing
mkdir -p /tmp/cni-test

# Download the CNI package to the temp directory
curl -L --fail https://acs-mirror.azureedge.net/cni/azure-vnet-cni-linux-amd64-v1.0.25.tgz --output /tmp/cni-test/azure-vnet-cni-linux-amd64-v1.0.25.tgz && echo "Download successful" || echo "Download failed"

結果:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 6495k  100 6495k    0     0  8234k      0 --:--:-- --:--:-- --:--:-- 8230k
Download successful

確認下載的檔案:

ls -la /tmp/cni-test/
file /tmp/cni-test/azure-vnet-cni-linux-amd64-v1.0.25.tgz

結果:

total 6500
drwxr-xr-x 2 user user    4096 Jun 20 10:30 .
drwxrwxrwt 8 root root    4096 Jun 20 10:30 ..
-rw-r--r-- 1 user user 6651392 Jun 20 10:30 azure-vnet-cni-linux-amd64-v1.0.25.tgz

/tmp/cni-test/azure-vnet-cni-linux-amd64-v1.0.25.tgz: gzip compressed data, from Unix, original size modulo 2^32 20070400

清除測試檔案:

rm -rf /tmp/cni-test/

如果您無法下載這些檔案,請確定允許下載端點的流量。 如需詳細資訊,請參閱 Azure 全域必要 FQDN/應用程式規則

參考資料

與我們連絡,以取得說明

如果您有疑問,可以詢問 Azure 社群支援。 您也可以向 Azure 意見反應社群提交產品意見反應。