Skip to content

Fix: QueryPathInfo throws on invalid path error in daemon#15134

Merged
xokdvium merged 1 commit into
NixOS:masterfrom
pkpbynum:pb/fix-query-path-info-daemon
Feb 3, 2026
Merged

Fix: QueryPathInfo throws on invalid path error in daemon#15134
xokdvium merged 1 commit into
NixOS:masterfrom
pkpbynum:pb/fix-query-path-info-daemon

Conversation

@pkpbynum

@pkpbynum pkpbynum commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Motivation

This fixes a small regression introduced by #13951 (specific diff), which occurs when calling QueryPathInfo on an invalid path.

Current (bad) behavior: When called on an invalid path queryPathInfo throws an exception, resulting in the entire operation failing. This also implies the else clause is currently unreachable.

Corrected behavior: Catch InvalidPath exceptions and return 0 on the connection.

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@pkpbynum pkpbynum requested a review from Ericson2314 as a code owner February 3, 2026 02:03
@xokdvium xokdvium added backport 2.32-maintenance Automatically creates a PR against the branch backport 2.33-maintenance Automatically creates a PR against the branch labels Feb 3, 2026
@xokdvium

xokdvium commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

LGTM. On a separate note, I think the current approach where some stores return a nullptr and swallow the exception or allow the exception to escape is really bad (evidently). Would be nicer to consistently return nullptr instead.

@xokdvium xokdvium added this pull request to the merge queue Feb 3, 2026

@Ericson2314 Ericson2314 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Merged via the queue into NixOS:master with commit 27435e0 Feb 3, 2026
16 checks passed
@internal-nix-ci

Copy link
Copy Markdown

Successfully created backport PR for 2.32-maintenance:

@internal-nix-ci

Copy link
Copy Markdown

Successfully created backport PR for 2.33-maintenance:

lovesegfault added a commit to lovesegfault/rio-build that referenced this pull request Feb 24, 2026
Pin nix to 2.33.3 to avoid the QueryPathInfo regression in 2.32-2.33.2
(NixOS/nix#15134) where not-found paths send STDERR_ERROR instead of
STDERR_LAST + u64(0). Also fix read_stderr_loop to treat STDERR_ERROR
as a terminal message — previously it parsed the error payload but
continued looping for the next STDERR message, hanging forever when the
daemon had already moved on to waiting for the next opcode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
LunNova pushed a commit to LunNova/rio-build that referenced this pull request Mar 9, 2026
Pin nix to 2.33.3 to avoid the QueryPathInfo regression in 2.32-2.33.2
(NixOS/nix#15134) where not-found paths send STDERR_ERROR instead of
STDERR_LAST + u64(0). Also fix read_stderr_loop to treat STDERR_ERROR
as a terminal message — previously it parsed the error payload but
continued looping for the next STDERR message, hanging forever when the
daemon had already moved on to waiting for the next opcode.
brittonr pushed a commit to brittonr/nix that referenced this pull request Apr 1, 2026
…aemon

Fix: `QueryPathInfo` throws on invalid path error in daemon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.32-maintenance Automatically creates a PR against the branch backport 2.33-maintenance Automatically creates a PR against the branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants