Skip to content

fix(windows): report why an atomic publish failed instead of blaming the repo - #1628

Merged
DeusData merged 1 commit into
mainfrom
fix/windows-publish-diagnostics
Aug 15, 2026
Merged

fix(windows): report why an atomic publish failed instead of blaming the repo#1628
DeusData merged 1 commit into
mainfrom
fix/windows-publish-diagnostics

Conversation

@DeusData

Copy link
Copy Markdown
Owner

In #1620 every index_repository run fails like this:

{"status":"error","hint":"Pipeline failed. Check repo_path exists and contains source files."}

The repository is fine. Every pass succeeds, gbuf.dump completes, the supervised worker exits 0, and no error-level line is emitted anywhere. The publish is failing on a filesystem permission problem, and two separate defects conspire to hide it.

1. cbm_rename_replace discarded GetLastError() and returned a bare CBM_NOT_FOUND. Callers log errno afterwards (finalize.rename_failed), so on Windows the one field that should explain an atomic-publish failure held whatever an unrelated CRT call happened to leave there. The Win32 error is now translated. ERROR_ACCESS_DENIED is the interesting case: MoveFileEx needs DELETE on the destination, which a cache file created under an empty or foreign DACL does not grant — precisely the state #1620 and #1601 describe.

2. cbm_pipeline_finalize_staged_generation returned PERSIST_FAILED on a failed sidecar removal with no log at all. That is the genuinely silent path.

Neither change fixes the underlying ACL problem — #1623 and the re-stamp work address that. Together they turn a report that misdirects the user at their own repository into one that names a permission failure on a specific file, which is the difference between an unactionable issue and a five-minute one.

platform + pipeline suites: 268 passed, 0 failed.

…the repo

#1620: every index_repository run fails, every pass succeeds, the worker exits
0, no error-level line appears anywhere, and the user is told:

  Pipeline failed. Check repo_path exists and contains source files.

The repository is fine. The publish is failing on a filesystem permission
problem, and two separate defects conspired to hide it.

cbm_rename_replace discarded GetLastError() on Windows and returned a bare
CBM_NOT_FOUND. Callers then log errno - see finalize.rename_failed - so the one
field that should explain the failure held whatever an unrelated CRT call left
there. The Win32 error is now translated to errno, with ERROR_ACCESS_DENIED the
interesting case: MoveFileEx needs DELETE on the destination, which a cache file
created under an empty or foreign DACL does not grant.

cbm_pipeline_finalize_staged_generation returned PERSIST_FAILED on a failed
sidecar removal with no log at all. That is the silent path: a publish that
fails must say so.

Neither change fixes the underlying ACL problem. Together they turn a report
that misdirects the user at their own repository into one naming a permission
failure on a specific file - which is the difference between an unactionable
issue and a five-minute one.

platform + pipeline suites: 268 passed, 0 failed.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant