Bug: Azure CLI extensions from Nix packages are not discoverable in devbox shell
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start by tracing how Devbox configures package environments and launches commands in the shell, then inspect the Nix wrapper for az and how it handles PYTHONPATH. Reproduce with the listed azure-cli and extension packages and run az extension list; done means the declaratively installed extension is discovered in the Devbox shell.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happened?
When managing azure-cli and its extensions declaratively in devbox.json, the az command is unable to discover the extensions, even though the package files are correctly installed in the Nix profile.
This seems to be caused by the Nix wrapper for the az executable, which appears to create an isolated Python environment, ignoring the PYTHONPATH from the parent devbox shell. This prevents the Azure CLI's standard site-packages auto-discovery from working.
This contrasts with other ecosystems like helm, where setting a HELM_PLUGINS environment variable works as expected. The equivalent AZURE_EXTENSION_DIR does not work here because the Nix package for the extension installs it as a Python module (azext_*) rather than in a separate directory structure.
Steps to reproduce
-
Create a new directory and run
devbox init. -
Set the
devbox.jsonto the following content:{ "packages": [ "[email protected]", "[email protected]" ] } -
Start the shell with
devbox shell. -
Run the command to list extensions:
az extension list -
(Optional) Confirm the extension's files are present in the environment's
site-packages:# Path may vary slightly based on python version ls .devbox/nix/profile/default/lib/python3.13/site-packages/
This will show azext_log_analytics_solution@ and other related files, proving the package was installed by Devbox.
Expected behavior
The az extension list command should discover and list the log-analytics-solution extension, similar to this output:
Name Version State Type
----------------------- --------- -------- ------
log-analytics-solution 1.0.1 Enabled whl
Actual behavior
The az extension list command returns an empty list, and commands provided by the extension (e.g., az log-analytics-solution) are not found.
Analysis of the Cause
Debug logs from az extension list --debug show that the CLI never attempts to load extensions from any directory (~/.azure/cliextensions, site-packages, or a path from AZURE_EXTENSION_DIR). It seems the Nix wrapper script for az sanitizes the PYTHONPATH, breaking the auto-discovery mechanism that relies on finding azext_* modules.
Workaround
The current pragmatic workaround is to abandon the declarative management of extensions and use the imperative approach:
-
Only include the core
azure-cliindevbox.json.{ "packages": ["[email protected]"] } -
Inside the
devbox shell, manually install the extension.az extension add --name log-analytics-solution
This works because it installs the extension into ~/.azure/cliextensions, a path the az wrapper knows how to check.
Command
No response
devbox.json
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.17.1/.schema/devbox.schema.json",
"packages": [
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]"
],
"shell": {
"init_hook": [
"export SOPS_AGE_KEY_FILE=$(pwd)/.age.agekey"
]
}
}
Devbox version
0.17.1
Nix version
nix (Determinate Nix 3.17.3) 2.33.3
What system does this bug occur on?
macOS (Apple Silicon)
Debug logs
No response
- Ngôn ngữ chính
- Go
- Star
- 12.4k
- Fork
- 358
- Merge trung bình
- 17 giờ 12 phút
- Pull request đã merge (30 ngày)
- 31
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của jetify-com/devbox
-
feature triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
jetify-com/devbox#3038 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pulumi is outdatedĐang mởbug p4 package processed triage unrelated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
jetify-com/devbox#2898 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
p4 processed unrelated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
jetify-com/devbox#2750 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
StorydenĐang mởp4 package processed triage unrelated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
jetify-com/devbox#2685 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Plugin Request]: apacheKafkaĐang mởlooks easy p4 package processed triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
jetify-com/devbox#2656 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của jetify-com/devbox
Issue tương tự
-
CLI: `describe <ns>.<table>` reports "namespace does not exist" when only the table is missingCó thể đã có người làm @Shruthirdy đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
apache/iceberg-go#2423 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
post-v4
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
rishikanthc/Scriberr#506 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microsoft/TypeScript#65290 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] rollingUpdatePartition panics when live StatefulSet replicas sit far below the desired countĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
sgl-project/rbg#547 ·
Maintainer thường phản hồi trong vòng 1 ngày