invalid_setting exits with 1 or 2 depending on the error class
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python, typescript
- Lĩnh vực
- backend-api-design, cli
Hướng nghiên cứu
Start with the exit code handling in src/selfgraph/cli.py and typescript/src/cli.ts, then trace how each CLI classifies errors by code or error class. Check the StoreError cases in src/selfgraph/stores/_cypher.py and typescript/src/stores/bolt.ts. Done means every invalid_setting error exits with code 2 in both CLIs, including the two reported cases.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
docs/cli.md says a bad flag or setting exits with code 2. Some invalid_setting errors exit with 1, because the CLI picks the exit code from the error class, not the code. invalid_setting is raised both as ValidationError (exit 2) and as StoreError (exit 1):
| Command | Error | Exit |
|---|---|---|
--store falkordb --uri h:0 entity list |
error[invalid_setting]: invalid FalkorDB address ... |
2 |
--store neo4j --uri 'bolt://u:p/x@h:1' entity list |
error[invalid_setting]: the store URI has an unencoded character ... |
2 |
--store hydradb --uri http://127.0.0.1:1 entity list |
error[invalid_setting]: 'http://127.0.0.1:1' is not a Bolt URI; use bolt://host:port |
1 |
--store neo4j --uri bolt://u:[email protected]:1 entity list (Python) |
error[invalid_setting]: cannot open a Bolt driver for 'bolt://***@127.0.0.1:1': URI userinfo is not supported ... |
1 |
Both CLIs exit 1 for the http:// case. The userinfo case is Python only, because the TypeScript driver accepts userinfo. A script that treats exit 2 as "fix your settings" and exit 1 as "the server failed" retries the last two forever.
Reproduce
On 04862c4, run the commands above with selfgraph and node typescript/dist/cli.js, then check $?.
Expected
Every invalid_setting, and the other input codes, exits with 2 whatever class raised it. For example, decide the exit code from exc.code, or raise these two as ValidationError.
Where
src/selfgraph/stores/_cypher.py,bolt_driver:StoreError(..., code="invalid_setting", field="uri")for a non-Bolt scheme and for a driver that rejects the URIsrc/selfgraph/cli.py,_USAGE_ERRORSand the exit code inmain- The same in
typescript/src/stores/bolt.tsandtypescript/src/cli.ts
- Ngôn ngữ chính
- TypeScript
- Star
- 173
- Fork
- 58
- Merge trung bình
- 6 giờ
- Pull request đã merge (30 ngày)
- 120
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 hydra-db/selfgraph
-
approved-for-pr area: cli-mcp area: errors bug effort: S P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
hydra-db/selfgraph#401 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
approved-for-pr area: errors area: store bug effort: S P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
hydra-db/selfgraph#398 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
approved-for-pr area: errors area: write bug effort: S P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
hydra-db/selfgraph#392 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
approved-for-pr area: parity area: write bug effort: S P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
hydra-db/selfgraph#391 · 2 bình luận ·
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 76/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của hydra-db/selfgraph
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
code-yeongyu/senpi#7139 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
lingdojo/kana-dojo#34395 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug status: needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
mastra-ai/mastra#31093 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:web p2 product:business triage:active type:bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 89/100
cuadrao-ai/argus#2328 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug frontend good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
nikhilb2/simple_invoicing#907 ·