Exit code 5 is documented for schema validation failures but never returned (schema errors exit with 2)
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu tại dsc/src/util.rs quanh L73 nơi EXIT_VALIDATION_FAILED (5) được định nghĩa và lần theo những đường thực sự gọi exit() cho lỗi kiểm thử schema, so sánh với đường exit(2) mà repro chạm tới. Tái hiện với dsc config test --file repro.dsc.config.yaml từ issue và kiểm tra nơi thông báo ERROR Schema được phát (có thể trong xử lý lệnh config/resource trong dsc/src). Xong nghĩa là lỗi schema trả về 5 kèm một test khẳng định điều đó, hoặc hằng không dùng bị xóa và bảng exit-code khớp với util.rs — xác nhận với maintainer nên đổi bên nào trước.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest version
- Search the existing issues.
Summary
The CLI reference says exit code 5 means "a resource definition or instance value was invalid against its JSON schema". When a resource instance fails schema validation, dsc exits with 2.
EXIT_VALIDATION_FAILED is still defined in dsc/src/util.rs L73 but nothing uses it, on v3.3.0 or main. Its last use was exit(EXIT_VALIDATION_FAILED) in config validate, removed in 8fff4fbb ("fix merge conflict", 2024-07-25). It looks like that was a side effect of the merge rather than a decision, but I couldn't confirm it.
The same table lists only codes 0 to 6, while util.rs also defines 7 (resource not found), 8 (assertion failed), 9 (server failed) and 10 (Bicep failed).
I don't know which side you'd rather change: return 5 for schema validation errors, or drop 5 from the docs (and add 7 to 10). Either works for me. I script against the exit codes and only need the docs and the binary to agree.
This is not the same as #817 or #1245, which are about exit codes coming back from resources.
Steps to reproduce
-
Save this as
repro.dsc.config.yaml. The property name has a typo (valuName).config testdoesn't write anything, so the key is never created:$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: typo in property name type: Microsoft.Windows/Registry properties: keyPath: HKCU\Software\DscExitCodeRepro valuName: Example -
Run:
dsc config test --file ./repro.dsc.config.yaml $LASTEXITCODE
Expected behavior
ERROR Schema: Additional properties are not allowed ('valuName' was unexpected)
5
Actual behavior
ERROR Schema: Additional properties are not allowed ('valuName' was unexpected)
2
Other inputs on dsc 3.3.0:
| Input | Exit |
|---|---|
| unknown resource property (above) | 2 |
wrong property type, valueData: { DWord: "x" } |
2 |
same two cases with dsc resource test -r Microsoft.Windows/Registry |
2 |
| unknown top-level key in the document | 2 |
| invalid YAML | 4 |
parameter default above its maxValue |
4 |
Error details
2026-10-04T10:25:51.959520Z ERROR Schema: Additional properties are not allowed ('valuName' was unexpected)
Environment data
Name Value
---- -----
PSVersion 5.1.26100.9444
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.26100.9444
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Windows 11 Pro for Workstations 25H2, build 26200.
Version
3.3.0 (also reproduced on 3.4.0-preview.1)
Visuals
No response
- Ngôn ngữ chính
- Rust
- Star
- 532
- Fork
- 76
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 15
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không 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 PowerShell/DSC
-
Issue-Enhancement Needs Triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
PowerShell/DSC#1737 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`directives.version` is checked against dsc-lib's crate version (3.2.0), not the running dsc versionĐang mởIssue-Bug
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 74/100
PowerShell/DSC#1735 · 1 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Issue-Enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
PowerShell/DSC#1729 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Feature Request: Support dsc functions in executable argsCó thể đã có người làm @SteveL-MSFT đã nhận 12 ngày trước. Đang mởIssue-Enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 62/100
PowerShell/DSC#1722 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Dev-UX Needs Triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
PowerShell/DSC#1694 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của PowerShell/DSC
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/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 85/100
wardian-app/Wardian#1603 ·
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 70/100
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
peteonrails/voxtype#844 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
uwuclxdy/clauth#107 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày