Skip to content

Commit b62be0d

Browse files
jsbattigclaude
andcommitted
fix: Empty error messages in add_golden_repo_index subprocess failures (Bug #361, v9.3.98)
When index creation failed and the error was in stdout (not stderr), error messages showed "Failed to create FTS index: " with nothing after the colon. Applied stderr→stdout→exit-code fallback chain to all 5 index types (init, semantic, fts, temporal, scip) plus the CalledProcessError handler. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 98f8ca3 commit b62be0d

5 files changed

Lines changed: 403 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## v9.3.98
9+
10+
### Bug Fixes
11+
12+
- fix: add_golden_repo_index shows empty error messages when subprocess fails (Bug #361). When index creation failed and the error was in stdout (not stderr), the error message showed "Failed to create FTS index: " with nothing after the colon. Applied stderr-or-stdout-or-exit-code fallback chain to all 5 index types (init, semantic, fts, temporal, scip) plus the CalledProcessError handler, ensuring diagnostic information is always present in error messages.
13+
814
## v9.3.97
915

1016
### Bug Fixes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
AI-powered semantic code search for your codebase. Find code by meaning, not just keywords.
44

5-
**Version 9.3.97** - [Changelog](CHANGELOG.md) | [Migration Guide](docs/migration-to-v8.md) | [Architecture](docs/architecture.md)
5+
**Version 9.3.98** - [Changelog](CHANGELOG.md) | [Migration Guide](docs/migration-to-v8.md) | [Architecture](docs/architecture.md)
66

77
## Quick Navigation
88

src/code_indexer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
HNSW graph indexing (O(log N) complexity).
77
"""
88

9-
__version__ = "9.3.97"
9+
__version__ = "9.3.98"
1010
__author__ = "Seba Battig"

src/code_indexer/server/repositories/golden_repo_manager.py

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2388,8 +2388,13 @@ def background_worker() -> Dict[str, Any]:
23882388
init_result.returncode != 0
23892389
and "already exists" not in init_output.lower()
23902390
):
2391+
error_details = (
2392+
init_result.stderr
2393+
or init_result.stdout
2394+
or f"Exit code {init_result.returncode}"
2395+
)
23912396
raise GoldenRepoError(
2392-
f"Failed to initialize repo before indexing: {init_result.stderr}"
2397+
f"Failed to initialize repo before indexing: {error_details}"
23932398
)
23942399
# Capture output for logging regardless of outcome
23952400
if init_result.stdout:
@@ -2409,8 +2414,13 @@ def background_worker() -> Dict[str, Any]:
24092414
captured_stdout = result.stdout
24102415
captured_stderr = result.stderr
24112416
if result.returncode != 0:
2417+
error_details = (
2418+
result.stderr
2419+
or result.stdout
2420+
or f"Exit code {result.returncode}"
2421+
)
24122422
raise GoldenRepoError(
2413-
f"Failed to create semantic index: {result.stderr}"
2423+
f"Failed to create semantic index: {error_details}"
24142424
)
24152425

24162426
# fts - execute cidx index --rebuild-fts-index (FTS only)
@@ -2425,8 +2435,13 @@ def background_worker() -> Dict[str, Any]:
24252435
captured_stdout = result.stdout
24262436
captured_stderr = result.stderr
24272437
if result.returncode != 0:
2438+
error_details = (
2439+
result.stderr
2440+
or result.stdout
2441+
or f"Exit code {result.returncode}"
2442+
)
24282443
raise GoldenRepoError(
2429-
f"Failed to create FTS index: {result.stderr}"
2444+
f"Failed to create FTS index: {error_details}"
24302445
)
24312446

24322447
# temporal - execute cidx index --index-commits with options
@@ -2458,8 +2473,13 @@ def background_worker() -> Dict[str, Any]:
24582473
captured_stdout = result.stdout
24592474
captured_stderr = result.stderr
24602475
if result.returncode != 0:
2476+
error_details = (
2477+
result.stderr
2478+
or result.stdout
2479+
or f"Exit code {result.returncode}"
2480+
)
24612481
raise GoldenRepoError(
2462-
f"Failed to create temporal index: {result.stderr}"
2482+
f"Failed to create temporal index: {error_details}"
24632483
)
24642484

24652485
# Bug #131: Update enable_temporal flag in BOTH tables after successful temporal index creation
@@ -2527,8 +2547,13 @@ def background_worker() -> Dict[str, Any]:
25272547
captured_stdout = result.stdout
25282548
captured_stderr = result.stderr
25292549
if result.returncode != 0:
2550+
error_details = (
2551+
result.stderr
2552+
or result.stdout
2553+
or f"Exit code {result.returncode}"
2554+
)
25302555
raise GoldenRepoError(
2531-
f"Failed to create SCIP index: {result.stderr}"
2556+
f"Failed to create SCIP index: {error_details}"
25322557
)
25332558

25342559
return {
@@ -2539,8 +2564,13 @@ def background_worker() -> Dict[str, Any]:
25392564
"stderr": captured_stderr,
25402565
}
25412566
except subprocess.CalledProcessError as e:
2567+
error_details = (
2568+
e.stderr
2569+
or e.stdout
2570+
or f"Exit code {e.returncode}"
2571+
)
25422572
raise GoldenRepoError(
2543-
f"Failed to add index: Command failed with exit code {e.returncode}: {e.stderr}"
2573+
f"Failed to add index: Command failed: {error_details}"
25442574
)
25452575
except Exception as e:
25462576
raise GoldenRepoError(f"Failed to add index: {str(e)}")

0 commit comments

Comments
 (0)